pack and unpack few tiddlers internally: A Theme switcher

99 views
Skip to first unread message

Mohammad

unread,
Jun 16, 2019, 1:38:51 PM6/16/19
to TiddlyWiki
I am working on Tiddlyshow to finalize it as a plugin!
I have several themes for slideshow. I want to apply themes by a theme switcher!
What I do now is to apply the $:/tags/Stylesheet to bundle of tiddlers in selected theme and remove $:/tags/Stylesheet  tag
from previous theme tiddlers (each theme has 5 to 10 tiddlers)

I thought I can use the mechanism by TW itself! so I need a macro/tool to let me unload a theme (by packing internally into a JSON tiddler)
and unpack (load) the new selected one!

How can I do this? I am insisted to not add extra third party plugins to restrict any dependencies!


Mohammad

BJ

unread,
Jun 16, 2019, 4:49:18 PM6/16/19
to TiddlyWiki

Mohammad

unread,
Jun 17, 2019, 2:16:51 PM6/17/19
to TiddlyWiki
Hi BJ,

 Thanks, I failed to produce an example!

Best
Mohammad

BJ

unread,
Jun 17, 2019, 2:47:27 PM6/17/19
to TiddlyWiki
not sure what you mean...
you can copy how it is used:


put your tids that you want to swtich into individual plugins and give then a plugintype - 'mythemes' or something else. then create a startup module and copy the code from startup.js and change the type to 'mythemes' (or whatever you want to call it).

BJ

unread,
Jun 17, 2019, 3:23:10 PM6/17/19
to TiddlyWiki
you can see how the switcher is used in

$:/snippets/minithemeswitcher

Mohammad

unread,
Jun 18, 2019, 3:21:11 PM6/18/19
to TiddlyWiki
Hi BJ

Many thanks for your help. I go through them and will notify you if  I could not use them.

Best
Mohammad
Reply all
Reply to author
Forward
0 new messages