Darn... turns out it ain't quite enuff. OK, here's the real issue I'm trying to solve:
I'm trying to extract the widget names from the actual js widgets in order to create links to their respective widget doc on
tiddlywiki.com. The goal is a selectwidget where the user selects a widget title to get its docs show up in iframes.
The problem is thus about reshaping the widgets js code names into
tiddlywiki.com doc title format, i.e CamelCase.
The initial extraction is done like so:
[all[shadows]prefix[$:/core/modules/widgets/]removeprefix[$:/core/modules/widgets/]removesuffix[.js]splitbefore[/]!suffix[/]]
which gives this:
action-createtiddler
action-deletefield
action-deletetiddler
action-listops
action-navigate
action-sendmessage
action-setfield
browse
button
...
From here, the exact manipulation depends on the title. E.g "browse" merely needs a capital initial, whereas "action-creattiddler" should become "ActionCreateTiddler". First this filter is added:
sentencecase[]split[-]sentencecase[]join[]
so "action-creattiddler" and all the other such formatted become ActionCreatetiddler where only the capital T, for tiddler, is missing.
Thus my original question - but I missed to clarify that there are multiple suffixes that must also have uppercase initial:
field
tiddler
message
block
mangler
variables
catcher
call
(possibly some more) .
Here's the full construct thus far:
<$list filter=' [all[shadows]prefix[$:/core/modules/widgets/]removeprefix[$:/core/modules/widgets/]removesuffix[.js]splitbefore[/]!suffix[/]addsuffix[ ]sentencecase[]split[-]sentencecase[]join[]split[ ]addsuffix[ ]]'/>
Marks clever idea was in deed good for my simplified case with only one suffix but can anyone come up with something efficient also for this problem with multiple suffixes?
For my use case, one may argue that the complete list is not overly long so it could as well be a static title list - but the solution should not have to be modified if new widgets are added. In deed, the suffix list would still need to be hard coded but these are (hopefully) less likely to change.
The whole concept is part of a much more general thingy soon to be released :-)
Thank you!
<:-)