Command line to export a tiddlywiki.html file to json file

Hello

I have stand alone tiddlywikis files, not using node js or server

is there a way to export to json file from command line in linux?

thank you

Node.js is most commonly used with tiddlywiki to run the server using the –listen command line option. However, there are many other command line options. For your use case, the load command can be used to load a standalone wiki and the render command can be used to select tiddlers to render to a json file. Like this:

node tiddlywiki.js --load 'my-standalone-wiki.html' --render "." tiddlers.json \
  text/plain '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[sometag]]'

Replace tiddlers.json with whatever filename you want to save the output to.
Replace [tag[sometag]] with whatever filter selects the tiddlers you want in the output json.

See https://tiddlywiki.com/#Installing%20TiddlyWiki%20on%20Node.js for more on installing node.js

1 Like