I'll have a look at an innerwiki solution now. You can mess with it
from a module, so I'll have to create a fake browser to save, I think anyway.
This is brutal without documentation, but the API is not that bad once
you get an idea of where everything is, as long as you have an IDE like
netbeans to jump to declarations easily.
I thought maybe the
setfield command
was doing something special to save, so I learnt how to use it. As
predicted, no, it doesn't save. So I have no idea what use it is, it
seems to be pointless. UNLESS that's what the
--build command is for!
You run a few command WHILE THE SAME WIKI IS LOADED, so you make changes
to the loaded wiki THEN build! Or maybe you can string arguments
together? YOU CAN. WE DID IT!
Check this out.
- So I have a file called local/index--private.html, which is a standalone TiddlyWiki.
- I then convert that to a node.js wiki using --savewikifolder.
- Then I run --setfield to fix the names of some tiddlers, but that duplicates them for some reason, so
- I then delete the duplicates using --deletetiddlers.
- Then I set the output location using --output.
- Then I render the whole thing back to a standalone TiddlyWiki using --rendertiddler.
- Later I will add the rest of the script, that does all the robocopying and delete the temporary node.js wiki.
tiddlywiki --verbose --load "./local/index--private.html" --savewikifolder ./temp "[all[]]-[tag[private]]"
tiddlywiki temp --verbose --setfield "[[index--public]] [[quick--public]] [[license--public]]" "title" "publify--name--template" "text/plain" --deletetiddlers "[[index--public]] [[quick--public]] [[license--public]]" --output ./local --rendertiddler "$:/core/save/all" "index.html"
I did try to use the following command, to avoid the node.js part, but --setfield didn't work.
tiddlywiki --verbose --load "./index--private.html" --deletetiddlers "[tag[private]]" --setfield "[[index--public]] [[quick--public]] [[license--public]]" "title" "publify--name--template" "text/plain" --deletetiddlers "[[index--public]] [[quick--public]] [[license--public]]" --output ./ --rendertiddler "$:/core/save/all" "index.html" "text/plain"
Well
I learnt how to make a command macro for nothing. Oh well! I'll make a
proper tutorial for all of this later. We need documentation. That
should have taken me half an hour, but it took days!
Kalcifer