Export single static html using render command

I would like to use --render command to generate a single static html file as I can do on the interface with button Export Static HTML.

After learning render command (https://tiddlywiki.com/static/RenderCommand.html) and test a few examples, I cannot generate any static file I would like to have, for example

tiddlywiki tiddlywiki --render "[tag[Heat Stress]]" "a.html" "text/plain" "$:/core/templates/static.template.html"

In this command, filter is not working. Just export all tiddlers in the story history.

If the story history included a view template with tiggraph, I get an error

$:/plugins/ihm/tidgraph/utils.js:386
   var div = document.getElementById(tidtree.id+'-table');
             ^

ReferenceError: document is not defined

Thanks for any suggestions.

The error is due to the fact that the tidgraph plugin uses a reference to the global document and can therefore not be rendered in the headless node.js mode, where there is only a fake DOM implementation available.

For your render command, if you want to output one file per tiddler try this:

--render '[tag[Heat Stress]]' '[encodeuricomponent[]addprefix[static/]addsuffix[.html]]' 'text/plain' '$:/core/templates/static.tiddler.html'

1 Like

Thanks for your suggestion. I will try it.