"Right" way to deconstruct a standalone wiki?

108 views
Skip to first unread message

clutterstack

unread,
Dec 9, 2020, 6:49:08 PM12/9/20
to TiddlyWiki
Hi all,

Is there a "right" way, using node, to take a standalone index.html TiddlyWiki in a folder and break it into tiddlers that can then be used in a new node.js wiki build?

I am guessing that it's a matter of "why would you want to do that more than occasionally? And occasionally, it's not too much trouble to export your tiddlers to start a new node.js wiki."

But I'm curious to know whether it's a matter instead of "of course; there's a trivial way to accomplish this with a one-liner in the terminal."

I have one wiki that I'm using in standalone mode, but I'm using it to develop my plugins as I write in it. So I like to be able to go into VS Code, tweak the canonical copy of the plugin, rebuild the html file, reload in the browser, use the wiki a bit, and so on.

I have a build target in this wiki's tiddlywiki.info, called deconstruct, that contains an elaborate tiddler filter, and it seems to be working for me so far, purging plugins but keeping plugin settings etc. Then I have a shell function to copy the wiki to a backup file, deconstruct and then rebuild it.

I see the TiddlyWeb plugin makes a replacement tiddler for $:/core/save/all that includes the right tiddlers to build an offline wiki, but you have to have TiddlyWeb installed in the wiki.

Any thoughts?

Thanks,
Chris

Mark S.

unread,
Dec 9, 2020, 7:46:27 PM12/9/20
to TiddlyWiki

Soren Bjornstad

unread,
Dec 9, 2020, 7:47:55 PM12/9/20
to TiddlyWiki
Maybe I'm not following what you're asking for, but my Anki syncing plugin TiddlyRemember needs to turn single-file wikis into folder wikis. It just uses:

tiddlywiki --load wiki_path --savewikifolder output_directory

There is an optional filter argument after output_directory if you only want some of the tiddlers to be included in the new folder wiki.

clutterstack

unread,
Dec 9, 2020, 11:49:27 PM12/9/20
to TiddlyWiki
Thanks, Mark and Soren.

I see I didn't actually specify that my home-grown plugins live in a folder away from this wiki. Sorry. I want to rebuild using these files every time, to have the latest changes.

I think I abandoned savewikifolder mainly because it generates a new tiddlywiki.info file in addition to putting my plugins in a subdirectory, but that was before I concluded that I needed a shell function anyway. Without testing, I guess that savewikifolder and a shell script to move/delete some files would work, and might have advantages over my current method of running the wiki through render with a tiddler filter, a name filter, and a template.

So far I have the impression that I'm doing something weird, so it's not a one-liner, but it's possible, because there is just so much flexibility in TiddlyWiki.

Cheers,
Chris
Message has been deleted

Mohammad

unread,
Dec 10, 2020, 3:22:27 AM12/10/20
to TiddlyWiki
Hi Chris,
While I have tried many workflow for rapid plugin development, non of them is as flexible as TheDiveO TiddlywikiPluginSkeleton.

You can fire a new plugin by shell command 
npm run develop

and while you are developing your plugin or set of plugins in a single Tiddlywiki just create a release on the fly using the shell command
npm run release

You can have both node.js and single html, the packaged plugin and folder plugin all at once.

I myself have set of PowerShell script to

* update the kookma plugin library folder
* update my local plugin folder on my work machine
* create local backups, ...


The bad news is TheDiveO has not update the tools for some time but they work with latest TW but some small hacks.


Good luck
Mohammad

clutterstack

unread,
Dec 10, 2020, 11:21:15 AM12/10/20
to TiddlyWiki
Hi Mohammad,

Ah! I "always" meant to check out TheDiveO's tools, but when I first saw them the whole process seemed intimidating, and as I learned my way around, I just gradually incremented toward the process I have right now.

This is probably the "right" answer, concept-wise, for rapid plugin development.

Best,
Chris
Reply all
Reply to author
Forward
0 new messages