Charlie, Nice job.
Just to add to your suite of tools, there is also sortby sortsub operators and the new filter operator, See Filter Improvements in 5.1.23 I also thought I should mention this as people may find you post for some time to come, and knowing even more options are available may help. I think in the future you may be able to create *an even more elegant solution*. I personally have not had a chance to explore all the new 5.1.23 changes but even more are in 5.1.24 See https://tiddlywiki.com/prerelease/#Sort%20Filter%20Run%20Prefix Regards Tones On Sunday, 6 June 2021 at 11:37:11 UTC+10 [email protected] wrote: > 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/e1978f47-5503-4f77-af20-0fba1b180f3en%40googlegroups.com.

