TiddlyWiki on node.js

Hello,

is it possible to save my tiddlywiki that is stored on node.js (works and saves fine) on Git as HTML file (I want to save on both in the same time)

Thanks

Hi,
It’s not possible to save it at the same time. But you can create a single file version eg: whenever you start your wiki.

The tiddlywiki.info file looks as follows. I did manually format the elements that start with "--render..." and their parameters into 1 line, for better human readability.

{
    "description": "Basic client-server edition",
... snip ... I did remove stuff here.

    "build": {
        "index": [
            "--rendertiddler","$:/plugins/tiddlywiki/tiddlyweb/save/offline","index.html","text/plain"
        ],
        "static": [
... snip ... I did remove stuff here.
        ]
    }
}

If you change the “build section” to:

    "build": {
        "index": [
            "--output", "x:/temp/",
            "--rendertiddler","$:/plugins/tiddlywiki/tiddlyweb/save/offline","index.html","text/plain"
        ],

You have to adjust your path with a drive name of your setting!!

Then type:

tiddlywiki.cmd myWiki --build index

it will build a single file wiki at the output directory. … The default path, if you don’t define the output parameter is in the wiki-folder at the same level as the tiddlers directory.

So if you create a batch script that first runs the build process and then starts your server you will have a backup, which is older than your actual wiki.

If you do it the other way around, which also works you will get a backup that contains the changed tiddlers.

have fun!
mario

I did change the topic name to: TiddlyWiki on node.js

This is very interesting, it allows save the output anywhere in your machine.

1 Like

See how I did this in Tidgi:

Tidgi itself can sync nodejs wiki to git.

Under the hood it programmatically calling git-sync-js package

calling its commitAndSync function

NodeJS to HTML:

  1. in github action
  2. runs these lines of tiddlywiki cli
  3. finally executes this task in tiddlywiki.info
2 Likes

Hi :grinning:
I am interested with this topic and your solution.

I want to ask

  1. The HTML output from your script, is it the static HTML? or the dynamic one?
  2. Is there any automation script like this but for storing the HTML in TiddlyHost?

Many Thanks

It is dynamic HTML, so full tiddlywiki feature can be used. I also want static one, but haven’t have time to build it yet, and I’m using tidgi to serve single page nodejs wiki like https://wiki.onetwo.ren/Index , so I don’t need static HTML anymore.

For 2 I also ask it in How to upload to tiddlyhost from a nodejs wiki? · simonbaird/tiddlyhost · Discussion #319 · GitHub today