[TW5] wikirule modules

69 views
Skip to first unread message

Matrix

unread,
Feb 25, 2019, 7:46:30 PM2/25/19
to TiddlyWikiDev
Hi folks -

I wanted such a simple thing... always the entry-point to a very deep rabbit-hole. Checkboxes: I looked at a bunch of options and settled on https://github.com/tgrosinger/tw5-checklist as my favorite. I wanted to hide the Clear All and New Item pieces of it, so I did. I wanted it to be configurable, so I added another option like the ones already present. Finally, I decided those options should be per-tiddler, instead of global.... and that's where my troubles started. After a lot of searching and trying things and breaking my whole wiki, I've come to believe it's impossible to get the current tiddler from a wikirule module. Is that true? If there's a way, I'd love to know what it is! Also, if there are any detailed API docs for this stuff, that would be great! I looked at https://tiddlywiki.com/dev/#WikiRuleModules but there's not enough detail on what's accessible from this type of module. I wonder about the "global $tw: false" and whether that is actually a comment or something I could change and get access to more stuff?

Thanks for any info... much love for TW!

Jeremy Ruston

unread,
Feb 26, 2019, 7:51:35 AM2/26/19
to TiddlyWikiDev
Hi Matrix

Wikitext rules are part of the parsing process: Converting the raw text of a tiddler into a tree that represents its syntactic components.

The results of parsing a tiddler are cached until that tiddler is modified, and so a given tiddler might only be parsed once while being rendered many times. Variables are part of the widget render tree, and so are not available.

$tw is available within wikitext rule modules; the comment you found is an instruction to jshint (https://jshint.com/) not to treat it as a missing variable.

Best wishes

Jeremy.




--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/761ad761-7797-400f-826a-6e0530a20429%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Jeremy Ruston
mailto:jeremy...@gmail.com

Thomas Elmiger

unread,
Mar 9, 2019, 10:07:54 AM3/9/19
to TiddlyWikiDev
Hi Matrix,

Could you tell us a bit more about what options you want to add and how you did what you already did? (CSS, hacking the plugin,...)

I helped optimizing the plugin you use, so I am quite interested.

Cheers,
Thomas

Reply all
Reply to author
Forward
0 new messages