Folks,

I have long wanted a replacement for an editor toolbar button, in TWV in 
QuickEdit to quickly sort some lines;

I just realised we can do this on the fly with a macro, not how by default 
it creates a link

Alternatively we can add inside each list
<$text text=<<currentTiddler>><br>




\define sort(text order:"a-z")
<$list filter="[[$order$]match[a-z]] [[$order$]match[a]]" variable=nul>
   <$list filter="[[$text$]splitregexp[\n]sort[]]">

   </$list>
</$list>
<$list filter="[[$order$]match[z-a]] [[$order$]match[z]]" variable=nul>
   <$list filter="[[$text$]splitregexp[\n]!sort[]]">

   </$list>
<$list filter="[[$order$]match[n]] [[$order$]match[z]]" variable=nul>
   <$list filter="[[$text$]splitregexp[\n]nsort[]]">

   </$list>
</$list>
\end


<<sort """
a sdsht
b adrgwskslh
z agroitgjitsij
d adrgvoistrwpwrtlko
zest
""" a-z>>

This can't handle bullets etc.. eg *

If you want a learning task consider

   - what are the parameter which is the default?
   - Allow a click to copy the result to the clipboard.
   - Build a EditorToolbar button to sort and replace selected text 
   (Challenge)

Regards
Tones

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4860f125-310f-42ac-8c74-64b83af5fa4co%40googlegroups.com.

Reply via email to