[TW5] use JSON as alternative to plugin

169 views
Skip to first unread message

Greg Davis

unread,
Apr 27, 2015, 7:28:44 PM4/27/15
to tiddl...@googlegroups.com
This is probably old hat for the long time TiddlyWiki Pros, maybe the idea will help others.

Without setting up node.js to build plugins, would saving the required tiddlers as a JSON be an acceptable way to distribute custom setups? I remember coming across
a way to do plugins without node.js but it was some what complicated, at the moment I can't find the link to the instructions.

Originally I was just looking for an easier way to apply customizations to new empty TiddlyWikis instead of dragging tiddlers between them. Finally got a Left Menu to
work and customized close to what I want and it struck me that I could use export to JSON as a way to transfer the necessary tiddlers.

I tagged all the tiddlers needed for the customization and then used Advanced Search to export those tiddlers to a JSON. That can then be imported to an empty
TiddlyWiki. TaDa, new wiki ready with what I wanted for the base.

I've shared an example of this custom TiddlyWiki, custom_5-1-8.html - https://dl.dropboxusercontent.com/sh/h8q01y5kygoyhch/AAD0hwllkUF6ivZ5WZ7awzhBa/custom_5-1-8.html

The JSON with customizations, custom-edition.json - https://www.dropbox.com/sh/h8q01y5kygoyhch/AADJLpqPvbj8ARQSJ2NwYdUya/custom-edition.json?dl=0

A JSON with sample content, sample-content.json - https://www.dropbox.com/sh/h8q01y5kygoyhch/AABiU_qHWe7_TIWIqQzDgc0pa/sample-content.json?dl=0

Greg

Mat

unread,
Apr 28, 2015, 6:57:09 AM4/28/15
to tiddl...@googlegroups.com
Thank you for sharing. Do I understand you right; instead of having to drag-to-import multiple tiddlers, and instead of creating a plugin (or having to know how) you propose exporting all tiddlers for a (or several) specific features into one single JSON file. This (single) file can then be dragged into the TW.

How obvious! ...and yet I hadn't thought of it! So thank you Greg!  :-)

BTW, this triggered me to post Export panel, including Export current story #1687

<:-)

Duarte Farrajota Ramos

unread,
Apr 28, 2015, 11:13:12 AM4/28/15
to tiddl...@googlegroups.com
Yes this is indeed very useful, thanks for sharing.
I would see this as the preferable method for sharing addons, that way one can build a local filesystem library that can easily be imported to new wikis.
I would also eventually like to see the possibility to export all currently open tiddlers.

Greg Davis

unread,
Apr 28, 2015, 3:02:54 PM4/28/15
to tiddl...@googlegroups.com
Thanks. With all the recent discussion of importing large amounts of information or exporting with JSONs it just struck me. Several lightbulbs have come on recently. ;-) I had not realized how close this is to plugins till this morning when I ran across http://tiddlywiki.com/#PluginMechanism . I did find one link about creating plugins http://tiddlywiki.com/dev/#How%20to%20create%20plugins%20in%20the%20browser but have not been able to make it work yet. Not sure if there is something that is not included in an empty TiddlyWiki or things have changed since that was written. Not as elegant or flexible as a true plugin but makes it easier to transfer configurations or content than drag and drop.

Mat - Yes, I believe you understood. As long as a user does a good job of tagging it can be easier to reuse things this way. One of my projects, a KJV bible, was floundering as I tried to get the basic navigation to work. Recent posts like Richards got me working at it again and this is one of the results. On it I am tagging the main navigation structure as bible, all the actual content as kjv, probably will go back and add tags for old and new. That way I could create separate JSONs for the navigation and the KJV portion, even individual JSONS for the Old KJV and New KJV. Then if I got ambitious I could load the navigation JSON in a new TiddlyWiki and start on another public domain bible like the WEB.

As I said, not as elegant as true plugins, but new or casual users may not have realized they could save things this way. I seen posts where people say they could remove their personal content from a TiddlyWiki then share the TW. If tagged in a way to distinguish personal material something like Advanced Search and Export to JSON would make this easier.

Greg

Jeremy Ruston

unread,
Apr 30, 2015, 12:01:25 PM4/30/15
to TiddlyWiki
Hi Greg

> Without setting up node.js to build plugins, would saving the required tiddlers as a JSON be an acceptable way to distribute custom setups? 

A plugin is in fact implemented as a JSON string of tiddlers, much like a .json tiddlers file. The difference is that the tiddlers within a plugin act as shadow tiddlers: if they are overridden then they can be restored by deleting the overriding tiddler. Plugins can also be updated by the TW upgrade procedure. If those two features aren't important then it is perfectly reasonable to use .json tiddlers files.

Best wishes

Jeremy.


 

--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/34d9f1e6-60c9-44d6-901b-48f85e4aad0d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com
Reply all
Reply to author
Forward
0 new messages