G'day,

*In the code further below, I use what I know and/or what I'm comfortable 
with.  Please, if you have code for alternative approaches, please share!  
This post is just about sharing code for studying.*

Working again on my French-Acadian dictionary 
<https://leptitaurele.neocities.org/>, I am redesigning the way of 
retrieving matching words per words tiddler (organized by letter of the 
alphabet, so a tiddler for words starting with letter "a", a tiddler for 
words starting with letter "b", etc. etc.

I decided that I needed a global macro to do the job of getting all 
relevant words for each list of words tiddler, so that I can code <<GetWords 
a>> to get all of the words starting with "a", <<GetWords b>> to get all of 
the words starting with "b", etc. etc.

Should be easy enough with a filter that takes the macro parameter and 
yields results of things like [prefix[a]], [prefix[b]], etc.

But [prefix[a]] won't catch words starting with accented a's ( â or à ).

[sort[]] has the smarts to treat accented a's as equal to "a", so sorting 
works A-1.

So for your perusal, the code I've come up with that works quite sweetly 
with the macro call <<GetWords "àâa">> :

\define lb() [

\define rb() ]

\define GetWords(FirstLetterOptions)
<$vars letterList={{{ 
[[$FirstLetterOptions$]split[]addprefix<lb>addprefix[prefix]addsuffix<rb>addprefix<lb>addsuffix<rb>join[
 
]addsuffix[ 
+]addsuffix<lb>addsuffix[sort]addsuffix<lb>addsuffix<rb>addsuffix<rb>] }}}>
@@.multicol
<$list variable="thisTiddler" filter=<<letterList>>>
<$link to=<<thisTiddler>>/><br>
</$list>
@@
</$vars>
\end

And the CSS for multicol :

/* MULTI COLUMN MODE */
.multicol {
   display:block;
   -moz-column-count:4;
   -moz-column-gap:1em;
   -webkit-column-count: 4;
   -webkit-column-gap:1em;
}

-- 
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/144bbd19-d514-461f-b00e-7d211b7b3e9cn%40googlegroups.com.

Reply via email to