Decided to make TWC "theme" for TW5, but need help with the javascript

86 views
Skip to first unread message

Leo Staley

unread,
May 2, 2015, 10:31:44 PM5/2/15
to tiddly...@googlegroups.com
I've decided to make the TWC "theme" for TW5, but I need a bit of advice and help with Javascript

If I'm understanding what a plugin is, it is a tiddler whose content is Javascript code, which (when activated as a plugin) tells the TiddlyWiki to create the tiddlers described by the javascript code, and to also execute any additional code of the plugin.

Now, I know both HTML and CSS decently well enough, but I don't know JavaScript very well at all. When I look at the Tiddler content of $:/themes/tiddlywiki/vanilla, it looks like there is a bunch of javascript making commands to 1) declare the titles of the tiddlers to be created, along with 2) tags, fields, etc, and 3) the text content in the tiddler's text field. 

That's where I get tripped up, trying to analyze it myself: none of the CSS and HTML in that tiddler are written in CSS, or HTML, or tiddlywiki markup language, each of which I know reasonably well; but rather, they are are mixed in or written with javascript language and syntax, which I do not know reasonably well. I compare the context of the tiddler $:/themes/tiddlywiki/vanilla/base, with the corresponding "text" portion of $:/themes/tiddlywiki/vanilla/ for that tiddler, and I just can't figure out what's making the output so different.

So, If someone could help me, I suppose, bridge that knowledge gap, I would be very grateful. (or even make a more user friendly interface to edit all of it! perhaps with a plugin?)

I know (Or will soon be figuring out) all the tiddlers, HTML elements and CSS rules I want to make, as well as the tiddlywiki markup, but I don't know how to say them in JavaScript like they are in the theme plugins. There also appear to be some somewhat complicated tiddlywiki list and macro rules, but if I can distinguish those from the javascript, I should be able to figure those out well enough.

Thanks in advance!

Leo


Andreas Hahn

unread,
May 4, 2015, 8:50:32 AM5/4/15
to tiddly...@googlegroups.com
Hi Leo,

the tiddlers of the plugins you are looking at are packed into a JSON format, therefore there is what you described as "javascripty-syntax" around it. But luckily there is a plugin that lets you package individual tiddlers into a plugin (or theme). So all you have to do to create your theme is to create the CSS/HTML tiddlers required for your theme, tag them accordingly (so they work) and then use a plugin packer to form a plugin (or theme).

There is a plugin-packer here: http://twguides.org/tinka.html

Note that when creating a theme, you have to set the "plugin-type" to "theme" (you would set it to "plugin" when creating a plugin). To understand all of the involved metadata-field, I recommend taking a look at http://tiddlywiki.com/#PluginMechanism to familarize yourself with the mechanism. Also let me know, if you have any more trouble with creating your theme.

/Andreas
--
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 http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/456dcf7b-a37e-4a5e-8b9f-9290d820ed96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leo Staley

unread,
May 4, 2015, 10:52:16 PM5/4/15
to tiddly...@googlegroups.com
THANKS! I'm definitely gonna try this, it looks like exactly what I'm looking for. 
Reply all
Reply to author
Forward
0 new messages