Single line break query

183 views
Skip to first unread message

Jon

unread,
Nov 3, 2019, 7:29:51 AM11/3/19
to tiddl...@googlegroups.com
Hi,

Is using the triple quotes the only way to produce a single line break?

For a page of text which includes headers and bullets etc. each piece of text needs to be enclosed in the quotes.

Do not other people find this a tad inconvenient?

Is there another way around it?

Regards
Jon


Eric Shulman

unread,
Nov 3, 2019, 7:52:31 AM11/3/19
to TiddlyWiki
On Sunday, November 3, 2019 at 4:29:51 AM UTC-8, Jon wrote:
Is using the triple quotes the only way to produce a single line break?
For a page of text which includes headers and bullets etc. each piece of text needs to be enclosed in the quotes.
Is there another way around it?

You can use <br> to force a line break in text content.

enjoy,
-e

Jon

unread,
Nov 3, 2019, 7:59:54 AM11/3/19
to TiddlyWiki
Ah, yes. That's better.

This is probably a stupid question, but when in text editor mode, could this not be inserted in the text automatically when pressing the enter key for a new line?

If that would be problematic, how about another keyboard shortcut?

Regards
Jon

Jon

unread,
Nov 3, 2019, 8:13:07 AM11/3/19
to TiddlyWiki
Didn't think to first look at the docs which I shall do first!

Regards
Jon

On Sunday, 3 November 2019 12:29:51 UTC, Jon wrote:

PMario

unread,
Nov 3, 2019, 8:42:39 AM11/3/19
to TiddlyWiki
Hi Jon,


I didn't test side effects, but it should be a starting point.

-m

Jon

unread,
Nov 3, 2019, 9:31:54 AM11/3/19
to TiddlyWiki
Hi Mario,

I hadn't seen that and I've managed to get it working in my wiki.

Seems to do everything I want and I suppose as it's a tag that can be removed, hopefully there shouldn't be any unintended consequences.

Thanks
Jon

Jon

unread,
Nov 3, 2019, 9:45:03 AM11/3/19
to TiddlyWiki
As an additional query, I'd be looking to create a template (haven't done before) so that each tiddler would be tagged with "text" for instance.

However, that would create unecessary clutter.

I'm not that familiar with using other fields, but could the stylesheet be applied using another field in a template, which is therefore hidden from view?

Regards
Jon

On Sunday, 3 November 2019 12:29:51 UTC, Jon wrote:

TonyM

unread,
Nov 3, 2019, 5:52:31 PM11/3/19
to TiddlyWiki
Jon

You are getting further from the initial issue but there is a class field on tiddlers that can be used to apply css to this tiddler.

Its quite easy to create own new tiddler button that creates custom tiddlers with text, fields and tags to a desired standard.

If you are familiar with wordprocessors you may realise there is a difference between a line break and a paragraph. Initialy it seems annoying that line breaks seem to collapse in wiki text but when you start writing wiki text with widgets and macros you become greatful that you don't end up with unwanted line breaks every where.

I can share more methods soon.

Tony

Jon

unread,
Nov 3, 2019, 6:27:51 PM11/3/19
to TiddlyWiki
Hi Tony,

Yes, a new tiddler button with associated css sounds good. I've seen references to this before so I'll investigate.

Thanks
Jon

Aidan Grey

unread,
Nov 3, 2019, 6:48:50 PM11/3/19
to TiddlyWiki
I created a simple button for this myself. It's very simple. 

Create a button.
For the action, use this:

<$action-sendmessage
    $message="tm-edit-text-operation"
    $param="suffix-lines"
    character="<br>"
    count="1"
/>



--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1baa8778-0a76-40fa-ba10-dae34fa98fd5%40googlegroups.com.

TonyM

unread,
Nov 3, 2019, 6:52:51 PM11/3/19
to TiddlyWiki
Jon,

Please shareback when you get a solution.

When typing content into a tiddler I often use in addition to bullet points the ";" and ":" line prefixes eg;

;Heading
:indents
:indents

As these come with their own automatic line breaks. 
I am trying to develop an override in wiki text where a leading period "." eg

.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Would force a paragraph break, such the above would render as

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  • This actually wraps each paragraph and lines in `<p></p>`
  • I would then have an edit toolbar button to place period at the beginning of all/or selected lines.
  • This would then be an alternative to wrapping the test with """ """
  • You could have an editoolbar that directly wraps each paragraph and line in `<p></p>`
Regards
Tony

pedruchini

unread,
Nov 3, 2019, 7:52:26 PM11/3/19
to TiddlyWiki
Hi,

This is what I do in all my wikis:

I put this in a tiddler tagged $:/tags/Stylesheet

dl dt {
   font-weight: normal;
   margin-top: 0px;
}

Then, instead of

"""
one
two
three
"""

I write:

;one
;two
;three

And instead of

"""
one
two
three

four
"""

I write

;one
;two
;three
>
;four

In other words, I changed the behaviour of ";" (term).

In case I need:

;term
:definition

I write

;''term''
:definition

This is not very elegant, I know, but it works for me. Of course, Tony, your solution
(the leading period [.]) would be an improvement.

Jon

unread,
Nov 4, 2019, 1:32:30 AM11/4/19
to TiddlyWiki
Thanks everyone, I'll play around with the options later and report back.

Regards
Jon


On Sunday, 3 November 2019 23:48:50 UTC, Aidan Grey wrote:
I created a simple button for this myself. It's very simple. 

Create a button.
For the action, use this:

<$action-sendmessage
    $message="tm-edit-text-operation"
    $param="suffix-lines"
    character="<br>"
    count="1"
/>



On Sun, Nov 3, 2019, 4:27 PM Jon, <five...@gmail.com> wrote:
Hi Tony,

Yes, a new tiddler button with associated css sounds good. I've seen references to this before so I'll investigate.

Thanks
Jon

On Sunday, 3 November 2019 22:52:31 UTC, TonyM wrote:
Jon

You are getting further from the initial issue but there is a class field on tiddlers that can be used to apply css to this tiddler.

Its quite easy to create own new tiddler button that creates custom tiddlers with text, fields and tags to a desired standard.

If you are familiar with wordprocessors you may realise there is a difference between a line break and a paragraph. Initialy it seems annoying that line breaks seem to collapse in wiki text but when you start writing wiki text with widgets and macros you become greatful that you don't end up with unwanted line breaks every where.

I can share more methods soon.

Tony

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Jon

unread,
Nov 4, 2019, 2:47:24 AM11/4/19
to TiddlyWiki
Hi,

I won't get chance to look at this properly until later, but it's just occurred to me that what I don't want to do is introduce additional characters to the text, for instance <br>.

The option that Mario pointed out is attractive because it achieves the desired result using a tag which could then be removed thereby restoring everything to it's original state.

If I populated all my tiddlers with <br>, for instance, this wouldn't be the case.

So, this seems to be the way to go but I don't want to clutter every tiddler with the additional tag - which seems unecessary.

I just need to apply the desired action in another way.

Regards
Jon

PMario

unread,
Nov 5, 2019, 4:40:23 AM11/5/19
to TiddlyWiki
Hi Jon,

If you don't want to use a tag, to apply the "special" styling you can use the "user class" field.

eg: create a field named: class
add the value eg: myText

This field needs to be part of every tiddler, which needs special formatting. I think the tagging mechanism will be more convenient.

----------------

create a tiddler named eg: my-styles and tag it: $:/tags/Stylesheet ... add

.myText {
  word-break: normal; 
  word-wrap: break-word;
  white-space: pre-wrap;
}

This will have the same effect as tagging it and use the data-xxxx definition.

have fun!
mario

Jon

unread,
Nov 6, 2019, 1:18:32 PM11/6/19
to TiddlyWiki
Hi Mario,

Thanks - I was stuck. I think this would be a good solution and I can see that Tiddler Commander would allow the removal of the field from all tiddlers if needed later.

However, the CSS seems to be mis-applying itself as the toolbar icons are spread about the page.

Any ideas for a correction?

Regards
Jon

PMario

unread,
Nov 6, 2019, 5:59:43 PM11/6/19
to TiddlyWiki
uups,
didn't test it. I think it needs to be:

.myTest .tc-tiddler-body {
...

-m

Jon

unread,
Nov 7, 2019, 1:52:36 AM11/7/19
to tiddl...@googlegroups.com
Hi Mario,

for tiddlers with field class=myText

.myText .tc-tiddler-body {
  word-break: normal; 
  word-wrap: break-word;
  white-space: pre-wrap;
}

This works perfectly, thanks- but only in one of my wikis!!

I'd noticed this strange behaviour when I was experimenting with some basic CSS to get that to work first.

I used .myText { border: 2px solid blue; } and found this also only works in one of them.

Thinking there must be something in that wiki which is interfering with it, I downloaded an empty wiki and found .myText { border: 2px solid blue; } doesn't work in that either - but it works as expected at tiddlywiki.com

I've checked and double checked and I'm pretty sure I'm not doing anything else to account for the differences although it does seem pretty strange.

If you try .myText { border: 2px solid blue; } in a downloaded empty tiddlywiki does it work for you?

Regards
Jon

On Sunday, 3 November 2019 12:29:51 UTC, Jon wrote:

Jon

unread,
Nov 7, 2019, 2:32:14 AM11/7/19
to tiddl...@googlegroups.com
Right, well I've worked out why it wasn't working in the empty wiki.

Wanting to make sure I wasn't making any mistakes, I copied and pasted $:/tags/Stylesheet when adding the tag rather than typing it.
 
To double check if this was the problem, I then added another tag next to it and typed it out and deleted the original and then everything worked as expected. 

So, although the contents of both tags looked exactly the same when side by side, there was something about the copying & pasting that introduced the error.

Thanks again!

Jon

PMario

unread,
Nov 7, 2019, 3:43:58 AM11/7/19
to TiddlyWiki
On Thursday, November 7, 2019 at 8:32:14 AM UTC+1, Jon wrote:

So, although the contents of both tags looked exactly the same when side by side, there was something about the copying & pasting that introduced the error.

There may have been a space in front or at the end of the copy/pasted tag. ... I did have a similar problem some time ago.

-m

PMario

unread,
Nov 7, 2019, 3:46:17 AM11/7/19
to TiddlyWiki
I did a short test. ... If you copy the tag from a tag-pill and you are not careful, there will be a space at the front of the tag.

I'll have a closer look. ... May be we file an issue at github if there is an easy fix.

-m

Manningham Housing

unread,
Nov 7, 2019, 5:17:27 AM11/7/19
to TiddlyWiki
Ah, yes - that makes sense.

Regards
Jon

PMario

unread,
Nov 7, 2019, 6:23:02 AM11/7/19
to TiddlyWiki

Jon

unread,
Nov 7, 2019, 1:24:20 PM11/7/19
to tiddl...@googlegroups.com
Thanks, Mario.

Regards
Jon
Reply all
Reply to author
Forward
0 new messages