I've been trying to format widget code in a way that (to my eye) is 
remotely readable:


This was my starting point (this code is taken from the comments plugin) 
and is in a single tiddler

<$set name="username" value={{$:/status/UserName}} emptyValue="(anonymous)">
<$set name="target" filter="[<currentTiddler>]">
<$action-createtiddler $basetitle={{{ [[Comment by 
']addsuffix<username>addsuffix[' on ']addsuffix<currentTiddler>addsuffix[']] 
}}} role="comment" list=<<target>> text="" edit-mode="yes"/>
</$set>
</$set>

The filter is all one line which makes it very difficult to read and print.

Following a suggestion from Jeremy I changed this to:

<$set name="username" value={{$:/status/UserName}} emptyValue="(anonymous)">
<$set name="target" filter="[<currentTiddler>]">
<$action-createtiddler 
    $basetitle={{{ [[Comment by ']] +[addsuffix<username>] +[addsuffix[' on 
' ]] +[addsuffix<currentTiddler>] +[addsuffix[']] }}} 
      role="comment" list=<<target>> text="" edit-mode="yes"/>
</$set>
</$set>

And this worked - the filter is still on one line but it is slightly more 
readable - I looked up the reference
for filters and whitespace includes newlines so I tried this:

<$set name="username" 
           value={{$:/status/UserName}} 
           emptyValue="(anonymous)">
  <$set name="target" 
             filter="[<currentTiddler>]">
    <$action-createtiddler 
        $basetitle={{{ [[Comment by ']] 
                                +[addsuffix<username>] 
                                +[addsuffix[' on ' ]] 
                                +[addsuffix<currentTiddler>] 
                                +[addsuffix[']] }}} 
        role="comment"
        list=<<target>> 
        text="" 
        edit-mode="yes"/>
    </$set>
</$set>

But this does not work - so what's gone wrong? can't I have newlines in 
filters

This page says I can

https://tiddlywiki.com/#Filter%20Whitespace:%5B%5BFilter%20Whitespace%5D%5D%20%5B%5Bsubfilter%20Operator%20(Examples)%5D%5D

Can anybody suggest a formatting that works and that would look nice in
a printed media.

Cheers

/Joe



-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d5ce8e72-1165-41b9-b398-b6f6becec82d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to