How can I insert Linbreaks when joining Tiddlers

56 views
Skip to first unread message

Jan

unread,
Jul 24, 2020, 4:53:00 AM7/24/20
to TiddlyWiki
Hello

I would like to do something like this:

{{{ [{$:/temp/StreamRoot}get[text]] [{$:/temp/StreamStart}get[text]]
[{$:/temp/ImplodeStream}get[text]] +[join{breaks}] ] }}}

This means Joinig three Tiddlers preserving their Linebreaks and
separating them with two linebreaks.
I would like to do this without a wikify-workaround because it is quite
a lot of expressions I would build that way.

Is this possible?

Thanks for helping!

Jan

TW Tones

unread,
Jul 24, 2020, 5:04:38 AM7/24/20
to TiddlyWiki
Jan

Eric provided a way in the last 6 months where he defined a macro containing a line break.

Perhaps search the forum.

From my mobile
Tony

Mat

unread,
Jul 24, 2020, 6:01:44 AM7/24/20
to TiddlyWiki
Jan wrote:
{{{ [{$:/temp/StreamRoot}get[text]] [{$:/temp/StreamStart}get[text]]
[{$:/temp/ImplodeStream}get[text]] +[join{breaks}] ] }}}

This means Joinig three Tiddlers preserving their Linebreaks and
separating them with two linebreaks.
I would like to do this without a wikify-workaround because it is quite
a lot of expressions I would build that way. 

What does "wikify workaround" mean? It is trivial to do something like this:

<$list filter="""filter to get your tiddlers""">

<$transclude/>
<br><br>

</$list>

and you can make it as a macro that simply takes the fitler as input.

<:-)

Mat

unread,
Jul 24, 2020, 6:02:41 AM7/24/20
to TiddlyWiki
should perhaps be <$transclude mode=block/>

Saq Imtiaz

unread,
Jul 24, 2020, 6:12:47 AM7/24/20
to TiddlyWiki
@Jan try this:

<$vars breaks="
">
{{{ [{$:/temp/StreamRoot}get[text]] [{$:/temp/StreamStart}get[text]] 
[{$:/temp/ImplodeStream}get[text]] +[join{breaks}] ] }}} 
</$vars>

Also, still would like to know why you found it necessary to tweak stream-root to exclude "Draft of".

Jan

unread,
Jul 24, 2020, 6:46:33 AM7/24/20
to tiddl...@googlegroups.com
Sorry, I can't find anything

Eric Shulman

unread,
Jul 24, 2020, 7:20:23 AM7/24/20
to TiddlyWiki
On Friday, July 24, 2020 at 3:12:47 AM UTC-7, Saq Imtiaz wrote:
@Jan try this:
<$vars breaks="
">
{{{ [{$:/temp/StreamRoot}get[text]] [{$:/temp/StreamStart}get[text]] 
[{$:/temp/ImplodeStream}get[text]] +[join{breaks}] ] }}} 
</$vars>

That should be:

<$vars breaks="

">
{{{ [{$:/temp/StreamRoot}get[text]] [{$:/temp/StreamStart}get[text]]
[{$:/temp/ImplodeStream}get[text]] +[join
<breaks>] ] }}}
</$vars>

1) The $vars defines "breaks" which is literally 2 line breaks between quotes.
2) The inline filter uses +[join<breaks>] to reference the variable

-e

Jan

unread,
Jul 24, 2020, 9:20:33 AM7/24/20
to tiddl...@googlegroups.com
Hi,
thank you all!
Eric's solution is the winner ;-).
THis trick is a great help!

Cheers Jan




Am 24.07.2020 um 13:20 schrieb Eric Shulman:

<$vars breaks="

">
{{{ [{$:/temp/StreamRoot}get[text]] [{$:/temp/StreamStart}get[text]]
[{$:/temp/ImplodeStream}get[text]] +[join
<breaks>] ] }}}
</$vars>

1) The $vars defines "breaks" which is literally 2 line breaks between quotes.
2) The inline filter uses +[join<breaks>] to reference the variable

-e
--
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/cdf7b201-272e-4ec9-8251-97271a219e12o%40googlegroups.com.

Eric Shulman

unread,
Jul 24, 2020, 11:43:21 AM7/24/20
to TiddlyWiki
On Friday, July 24, 2020 at 6:20:33 AM UTC-7, Jan wrote:
Eric's solution is the winner ;-).
Am 24.07.2020 um 13:20 schrieb Eric Shulman:
<$vars breaks="

">
{{{ [{$:/temp/StreamRoot}get[text]] [{$:/temp/StreamStart}get[text]]
[{$:/temp/ImplodeStream}get[text]] +[join
<breaks>] ] }}}
</$vars>
1) The $vars defines "breaks" which is literally 2 line breaks between quotes.
2) The inline filter uses +[join<breaks>] to reference the variable
Note: if you want to avoid the extra syntax of using <$vars>, you could also achieve these results by using a tiddler, like this:

1) Create a tiddler (e.g., $:/mystuff/linebreaks) containing just two newlines
2) Then, you can write:
{{{ [{$:/temp/StreamRoot}get[text]] [{$:/temp/StreamStart}get[text]]
[{$:/temp/ImplodeStream}get[text]] +[join{$:/mystuff/linebreaks}] }}}

-e

Reply all
Reply to author
Forward
0 new messages