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
> <http://editormagic.tiddlyspot.com/#action-createtiddler>
> action-deletefield
> <http://editormagic.tiddlyspot.com/#action-deletefield>
> action-deletetiddler
> <http://editormagic.tiddlyspot.com/#action-deletetiddler>action-listops
> <http://editormagic.tiddlyspot.com/#action-listops>action-navigate
> <http://editormagic.tiddlyspot.com/#action-navigate>action-sendmessage
> <http://editormagic.tiddlyspot.com/#action-sendmessage>action-setfield
> <http://editormagic.tiddlyspot.com/#action-setfield>browse
> <http://editormagic.tiddlyspot.com/#browse>button
> <http://editormagic.tiddlyspot.com/#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!

<:-)

-- 
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/65a594b4-facd-402e-b6ca-6f422cf2664f%40googlegroups.com.

Reply via email to