[tw5] GitHub saving individual tiddlers?

Does anyone have a solution for this yet?

I’m looking for a way to save tiddlywiki as individual tiddlers directly to git and GitHub (where the built-in GitHub saver saves the single-file tiddlywiki to a git service).

The single-file tiddlywiki doesn’t track well in git, with big diffs for small core changes. It’s also hard to trace back which tiddlers were changed, and autosave seems to push empty commits.

Locally, the node.js version could be made to save to a git repo, perhaps using a library like https://isomorphic-git.org, with changes staged locally until a ‘save’ commits them. Seems like it could work from single-file too, via browser storage?

I’m considering a hacky workaround for now; using the single file GitHub saver to trigger a GitHub action which runs node.js tiddlywiki to explode out the tiddlers and commit them. The single-file commit can be removed if used solely for saving. Then it’d be handy to have the opposite action too → build a single-file from the tiddlers.

This’d be less needed if the single-file tiddlywiki format was more diff-able, so maybe that’s an option too.

Any thoughts?

I personally use the file upload plugin to send individual tiddlers to GitHub, I made a button for it on my wiki :
https://Telumire.github.io/TiddlyTweaks/index.html#:[[Send%20tiddler%20with%20file%20upload]]

\whitespace trim
\define tiddler-attr()[[$(currentTiddler)$]]
<$button class=“tc-btn-invisible” tooltip=“send this tiddler with file upload”>
<$list filter="[match[yes]]+[!has[canonical_uri]]" variable=>
{{$:/plugins/commons/file-uploads/images/upload}}

<$action-sendmessage $message=“tm-upload-tiddlers” $param=<> />

</$list>
<$list filter="[match[yes]]+[has[canonical_uri]]" variable=>
<a class=“tc-tiddlylink” title=“open source file” href={{{[<_>get[_canonical_uri]]}}}>{{$:/core/images/globe}}
</$list>
<$list filter="[match[yes]]">

<$text text=" "/>
<$text text=“Send with file upload”/>

</$list>
</$button>

However the plugin will delete the content of your tiddler and attempt to link to the hosted file trough the _canonical_uri field, so I use it only for image tiddlers.
I’m sure you can find a workaround ?

Also take a look at this thread where saqimtiaz showcase a custom tiddlywiki able to send PR to github, it sound like it’s exactly what you want to achieve (no idea how he does that though) : Demo: updating docs and creating a PR from within TiddlyWiki

Part of the security structure of the browser is limited access to the file system. So basically you can only export/save one file at a time from within a browser page.

A workaround would be to export your sorted tiddlers as a JSON file. This should be ‘diffable’ .

Another possibility is to use the zip plugin to save a single zipped file. Then you could have a repeating process on the outside that locates the zip file, unzips, adds, commits, pushes.