Modifications for Wikitext

133 views
Skip to first unread message

Beanman

unread,
Oct 7, 2020, 11:11:15 AM10/7/20
to TiddlyWiki

Is there any way i could change the default behavior of wikitext so that it always behaves as if I'm using """ to get hard line breaks?  Never in my life have I pressed the enter key and not wanted to get a hard line break out of it, so is there any setting I can change, or maybe just make it so that pages start with the triple quotes by default?

Eric Shulman

unread,
Oct 7, 2020, 11:32:55 AM10/7/20
to TiddlyWiki
On Wednesday, October 7, 2020 at 8:11:15 AM UTC-7, Beanman wrote:

Is there any way i could change the default behavior of wikitext so that it always behaves as if I'm using """ to get hard line breaks?  Never in my life have I pressed the enter key and not wanted to get a hard line break out of it, so is there any setting I can change, or maybe just make it so that pages start with the triple quotes by default?

https://tiddlywiki.com/#Hard%20Linebreaks%20with%20CSS demonstrates how to use CSS to get "hard linebreaks" in your tiddler content.

In that example, it shows the syntax for making hard linebreaks conditionally based on tagging the tiddler.  However, you could make it apply to all tiddlers just as easily.

Just put the following CSS content into a tiddler (e.g., MyStylesheet), tagged with $:/tags/Stylesheet:
.tc-tiddler-body {
  word
-break: normal;
  word
-wrap: break-word;
  white
-space: pre-wrap;
}

enjoy,
-e  

TW Tones

unread,
Oct 7, 2020, 5:37:51 PM10/7/20
to TiddlyWiki
Beanman

This is a common issue raised with new users, and there are plenty of work arounds. There are good reasons for the default behaviour but it does challenge long learned habits.

There are some activities and projects occurring that will impact this and give wiki text authors a lot more possibilities so keep your eyes open.

However you may find in WYSIWYG editors such as Microsoft word etc you are often using double<enter> for paragraph breaks as well, however we do it, we do need to differentiate between lines and paragraphs. 
Yet when using wiki text it is more like a simple text editor so needing to indicate the paragraph seems unusual, but given wiki text gives you a lot of formatting and presentation options its ultimate objective is similar to WYSISWYG outputs.

Having used tiddlywiki in its various versions for more than a decade now I am very familiar with it, yet every now and then it annoys me, others and new users. Hence the ongoing work 

It seems Eric's great suggestion has some other effects, so I am looking at a way to make it conditional.

Tones

TW Tones

unread,
Oct 7, 2020, 5:52:37 PM10/7/20
to TiddlyWiki
Beanman,

Here is a conditional targeting of this behaviour, with this method just add the tag linewrap to tiddlers where you want this occurring.

See [[tiddlywiki.com for more|https://tiddlywiki.com/#Custom%20data-styles]]

Add [data-tags*="linewrap"]  in front of Eric suggested stylesheet and it will only apply to tiddlers tagged linewrap or what ever you call it.

Just put the following CSS content into a tiddler (e.g., MyStylesheet), tagged with $:/tags/Stylesheet:
[data-tags*="linewrap"] .tc-tiddler-body {

  word
-break: normal;
  word
-wrap: break-word;
  white
-space: pre-wrap;
}


Regards
Tony

TW Tones

unread,
Oct 7, 2020, 6:00:59 PM10/7/20
to TiddlyWiki
Post script

When using this alternate CSS you still need to ensure there is a blank line before any wiki text markup or it will not be evaluated

eg
Test
No wrapping

* list item

Tones

Beanman

unread,
Oct 8, 2020, 5:03:14 PM10/8/20
to TiddlyWiki

Thanks for the help you guys, works great!
Reply all
Reply to author
Forward
0 new messages