feeding newline

66 views
Skip to first unread message

Jean-Pierre Rivière

unread,
Apr 16, 2021, 11:28:56 AM4/16/21
to TiddlyWiki
With the edit-text widget, you can act on index within a dictionary, which is fine.
but with action-createtiddler, you can only create field, not indexed content. An option like "$useIndex=yes" would be cool to allow for getting indexes instead of fields.

but as for now, I need to write all my text by hand. And here I have not yet devised how to do this. I was thinking to create it with a set widget and a filter in which I wold get my index:data lines at the end of the process.

But I cbn't add a newline character because there is no way I can code it that I am aware.

So if you know how to summon newlines, please enlight me!

-- 
Jean-Pierre

Eric Shulman

unread,
Apr 16, 2021, 12:03:01 PM4/16/21
to TiddlyWiki
On Friday, April 16, 2021 at 8:28:56 AM UTC-7 jn.pierr...@gmail.com wrote:
But I can't add a newline character because there is no way I can code it that I am aware.
So if you know how to summon newlines, please enlight me!

Assign a literal newline to a variable.  Then you can add the variable to your text by using addsuffix<newline> within the filter syntax.
<$vars newline="
">
<$set name="output" filter="[...some filter operators...addsuffix<newline>]">
...
</$set>
</$vars>

-e

Jean-Pierre Rivière

unread,
Apr 16, 2021, 12:38:52 PM4/16/21
to TiddlyWiki
I had thought about using a variable but not seen any way to set that value to it. How clever of you! Many thanks again!

Jean-Pierre Rivière

unread,
Apr 16, 2021, 12:46:48 PM4/16/21
to TiddlyWiki
<newline>doesn't seem to work witg tge join operator.

My filter was:

<$vars id={{!!id}} name={{!!name}} url={{!!url}} newline="
">
<$set name=body filter="[[id:]addsuffix<id>] [[name:]addsuffix<name>] [[url:]addsuffix<url>] +[join<newline>]">

I get a single line, not three.
As for this code, well it was an early attempt. I'm converting it into using several action-setffield instead.
Le vendredi 16 avril 2021 à 18:03:01 UTC+2, Eric Shulman a écrit :

Jean-Pierre Rivière

unread,
Apr 16, 2021, 12:55:27 PM4/16/21
to TiddlyWiki
How stupid of me!!!

In fact I got "[[id:rnvp name:RNVP in url:https://rnvp.worki.ng/rnvp/]]" within my text field in my wiki. The square brackets tell the true story. the newline works, but the fault is in the way I tried feeding it to my tiddler later on. confirmed with an <$action-log $$message=<<msg>> $$filter="id name url"/> that the newline are there indeed.

BTW my feeding was <$action-setfield $tiddler="$proto$" $field=text $value=<<body>>/>

OK, closed thread.

Reply all
Reply to author
Forward
0 new messages