Is there any automated way of generating the html file of the TiddlyWiki node.js version?

136 views
Skip to first unread message

muynars...@gmail.com

unread,
Dec 9, 2020, 1:25:18 AM12/9/20
to TiddlyWiki
Hi everyone,

I use the TiddlyWiki on my personal computer daily... I run its Node.js version. I'd like to create a simple script that will automatically generate the HTML file of my TiddlyWiki (at a time that I know that my computer is turned on during the day) and upload it to a cloud server where I host this HTML to the internet. I'm ok with the details of how to do this script, but I need a way to generate the HTML file automatically instead of manually clicking on the "save changes" button and downloading the file manually every day. Is there any way of doing it? I've tried looking for the command-line options with  "tiddlywiki --help" but I didn't find anything related to generating the HTML file there... Is it possible?

Eric Shulman

unread,
Dec 9, 2020, 3:06:06 AM12/9/20
to TiddlyWiki
On Tuesday, December 8, 2020 at 10:25:18 PM UTC-8 muynars...@gmail.com wrote:
I run its Node.js version... I need a way to generate the HTML file automatically instead of manually clicking on the "save changes" button... I've tried looking for the command-line options

The command-line option you want is "--build <target>", where the <target> is defined in the tiddlywiki.info file.  For more info, see https://tiddlywiki.com/#tiddlywiki.info%20Files.  Specifically, the example tiddlywiki.info file, where it shows:
"build": {
"index": [
"--rendertiddler","$:/core/save/all","index.html","text/plain"]
}

Thus, with the above definition, the command line would be:
tiddlywiki --build index

enjoy,
-e

muynars...@gmail.com

unread,
Dec 9, 2020, 8:18:24 AM12/9/20
to TiddlyWiki
Thanks Eric,

In my case, I entered the folder where the tiddlywiki.info exists and got the following output with this command:

$ tiddlywiki --build index
 syncer-server-filesystem: Dispatching 'save' task: $:/StoryList

After this command, I didn't find any HTML file that was generated. The original content of my tiddlywiki.info file was:

{
    "description": "Basic client-server edition",
    "plugins": [
        "tiddlywiki/tiddlyweb",
        "tiddlywiki/filesystem",
        "tiddlywiki/highlight"
    ],
    "themes": [
        "tiddlywiki/vanilla",
        "tiddlywiki/snowwhite"
    ],
    "build": {
        "index": [
            "--rendertiddler",
            "$:/plugins/tiddlywiki/tiddlyweb/save/offline",
            "index.html",
            "text/plain"
        ],
        "externalimages": [
            "--savetiddlers",
            "[is[image]]",
            "images",
            "--setfield",
            "[is[image]]",
            "_canonical_uri",
            "$:/core/templates/canonical-uri-external-image",
            "text/plain",
            "--setfield",
            "[is[image]]",
            "text",
            "",
            "text/plain",
            "--rendertiddler",
            "$:/plugins/tiddlywiki/tiddlyweb/save/offline",
            "externalimages.html",
            "text/plain"
        ],
        "static": [
            "--rendertiddler",
            "$:/core/templates/static.template.html",
            "static.html",
            "text/plain",
            "--rendertiddler",
            "$:/core/templates/alltiddlers.template.html",
            "alltiddlers.html",
            "text/plain",
            "--rendertiddlers",
            "[!is[system]]",
            "$:/core/templates/static.tiddler.html",
            "static",
            "text/plain",
            "--rendertiddler",
            "$:/core/templates/static.template.css",
            "static/static.css",
            "text/plain"
        ]
    }
}

I also tried making a backup of this tiddlywiki.info file and changing the original to be like the one of your example with just the index object inside build... But the result of the command tiddlywiki --build index seems to be the same. Am I missing some step?

muynars...@gmail.com

unread,
Dec 9, 2020, 8:35:19 AM12/9/20
to TiddlyWiki
Ah, sorry... An "output" folder was generated with the HTML file that I needed. That works perfectly for what I need. Thanks!

muynars...@gmail.com

unread,
Dec 9, 2020, 8:41:31 AM12/9/20
to TiddlyWiki
One last doubt: is it possible to save tiddlywiki macros inside this tiddlywiki.info file and execute those macros from the backend with the tiddlywiki command-line?

Soren Bjornstad

unread,
Dec 9, 2020, 7:50:52 PM12/9/20
to TiddlyWiki
TiddlyWiki macros are not "executable" in the usual sense of that word, they are just ways to substitute text for other text, possibly with parameters. So I don't think macros are what you're looking for here.

Can you explain what exactly you're trying to accomplish? There's a way to do almost anything in TiddlyWiki, it just might not involve macros...
Reply all
Reply to author
Forward
0 new messages