How do you edit your wiki with both the web app and external editors?

Sometimes, because of issues that happen to me when using the web browser on mobile devices, other times because of other reasons, I’d like to be able to edit my TiddlyWiki at any given time not only via the single-HTML-file web application, but also via normal text editors.

For example, when I’m from my desktop, or when I need to both visualize and edit some information at the same time, I could choose to open the webapp like I already do and do my work; other times, maybe when I’m on mobile or I already know that I just need to do some edits and know what kind, I may decide to open a native text editor and operate on tiddlers saved on the device’s file system.

My understanding is that if I were to use TiddlyWiki via the Node.js server, I could either use the web app as normal, and it would save to the server, or access the server’s OS (via SSH or SFTP for example) and edit the saved tiddlers there, then restart the node server to get the webapp updated… even if I was wrong on this, it’s not an acceptable solution for me, for various reasons I won’t go into detail now.

As I said, I currently just make edits from the HTML app. I get it served from my GitLab Pages repo, and use the integrated GitLab saver to sync the edited HTML file to that same repo, and everything works well, but at the same time I’m locked to only editing via the single-page-app… unless I were to do something like the following, which is the opposite of quick or comfortable:

  1. Download the HTML file to my device
  2. Open a terminal emulator and call a tiddlywiki command to export all raw tiddlers to files
  3. Edit the files as I want
  4. Use another tiddlywiki command to repack the edited tiddlers from files to the single-page HTML
  5. Upload the HTML file to the repo

I need an actually good solution. The only one I can really think of, which is kind of hacky but should work (I’ve not tried it in practice yet though), and it would run entirely on GitLab’s servers automatically, is to create a secondary repo (that will store raw tiddler files), and use it parallel to the primary (that stores the wiki in single HTML file).
In both repos, I will use CI workflows to first check what kind of commit is being made, to prevent infinite cycles (I could simply check the commit message ideally).

  • When I commit to the primary repo (the one with the HTML wiki), the workflow will make a commit to the secondary repo, extracting all tiddlers as raw files and pushing the changed ones.
  • When I manually commit to the secondary repo (the one with the .tid files), the workflow packs all files into the single HTML and pushes it to the primary repo.

That said… maybe some of you have a less complicated solution for doing what I’d like, although mine (if actually proven functioning) should work without any maintenance after the first setup. Do you? Let me know!


On a side note: do any of you people edit your wikis from an Amazon Kindle?
I’ve found that the integrated browser is an extremely ancient embedded version of WebKit, and TiddlyWiki doesn’t run on it at all, instead crashing on boot (despite the app, amazingly I’d say, working flawlessly on browsers at least as old as Firefox 36).

If I were to setup this ideally good way of being able to edit my wiki from text files, then I could even satisfy this particular one of my desires, as my Kindle is jailbroken and I have access to terminal emulators, text editors, and other goodies.

While I do this sometimes, I do it on Node, which you say is out-of-bounds.

Any solution involving git will likely have synchronization issues, even with automatic commits and sophisticated workflows, unless you use GitLab’s (or GitHub or whatever) online editor for the files – and that is defeating the purpose of using desktop text editors. Honestly, this might be a problem however you try to do this, as you really don’t have a single source of truth. There’s always the question of how you deal with conflicting edits.

Of course there’s the old cut-from-A, paste-to-B, edit on B, cut-from-B, paste-to-A mode, but that’s never pleasant. It still might be the best choice available, at least for editing single tiddlers at a time.

What do you think we are, masochists? :wink: No, never. I can’t really imagine it. (Of course, I mostly use an e-ink Kindle, so it wouldn’t even be possible. But I can’t imagine trying it on my wife’s Fire.)

Have a node-based directory and synch it with syncthing (or with git, if git will let you run from 'droid terminal). Run node locally when you want to view your tiddler on mobile, or run it from your desktop (after synching).

You mean e-ink versions? That whole project was considered beta.

E-ink? That’s pretty cool. Must be a later Paper or Oasis?

You can edit wikis on Kindle Fire, at least 2018 and on. Via Tiddloid (or that other 'oid, maybe). Works best with an external keyboard. A good use is for checklist TW’s (travel lists, grocery lists, etc.) Don’t try to run something heavy like Streams.

It is an interesting challenge, given the constraints you have stated may seem somewhat impossible, but of course we can think outside the box, or the wiki in this case.

  • Although if you can find a working browser, native app or remote device you can access you may be better off.

Some thoughts;

  • What about exporting all your tiddlers to a location you can access with your kindle, in a format that you can read and edit using your kindle.
  • Then on return to your full wiki, a button, or workflow, that imports only the tiddlers that have changed and applies them to you wiki?
    • Even allowing you to review the changes if you want.

Additional levels of automation could be developed to make this almost transparent.

I am already starting to think of other approaches, but these are seriously influenced by the minutiae of you constraints include device features etc… and in many ways this is a niche requirement :nerd_face: in part by not having the “appropriate” device.

One of the features listed in TW5-Bob:

Two-way real-time syncing between the browser and file system

  • Updates the wiki in the browser immediately when any changes are made to the file system

Though it’s been a while since I used it myself, If I remember correctly I was able to edit files in a local editor using a tiddler template and then sync with git and the server would update.

Are you saying you can do real-time editing now with eInk displays? I thought we were still years from that. That would be very cool.

Hello again, thanks for the replies!

At the end this morning I did in fact manage to setup my cranky system, and it appears to work as intended with the small testing I did now, but we’ll see how things go in the long term.

Using a web IDE on the Git platforms that offer it is no different really from cloning a repo locally, editing some files, committing them, and pushing to the remote.
Obviously if you want to edit from different devices you have to first push all the locally stored commits from the first one, and then clone/pull on the second, but this is no different from the current workflow of only in-app TiddlyWiki editing. I still have to save all changes to Git (but it’s the single HTML file that gets synced to a repo, not many .tid files) by clicking the checkmark button, then wait at least ~45 seconds for the CI to update the page on my domain with the new modified HTML file, and then I can resume editing from another device. Never had a sync issue in months of using this method!

I have a 2021 base model e-ink Kindle, that I was luckily able to find new at a local shop, on a firmware version I knew was jailbreakable. Even if battery life suffers by a significant factor if you use this thing for other tasks on top of reading books or articles, it performs OK.
The screen isn’t that bad for typing, I wrote a few blog articles with the thing and liked the experience. In fact, e-ink’s slow refresh rate only really matters if you need to update large screen areas at once, if you are just typing text then you forget it after a while. (I find that even Tetris plays half decent on this tablet, so writing really isn’t an issue :upside_down_face:)

The Kindle Fire OS is simply Amazon’s fork of the Android Open Source Project, so yeah, no problems on that. In fact you could go as low as a Gingerbread version (2.3) Android device and still be able to use the TiddlyWiki app, since (and I tested this!) it works on at least as low as Firefox 36, which is the last Firefox version to support that old of an Android system. Now, on 10+ years old devices TiddlyWiki is too slow to really be used for anything, but that’s another story, the point is it doesn’t simply crash on boot :laughing:

The e-ink Kindle, instead, runs a system more similar to a desktop GNU+Linux system than Android ever is… only issue being that it uses decades-old libraries, including the WebKit one, and that’s why the system browser is so incompatible. I could install a more modern Linux system into a container, and run modern Firefox or Chromium, but that would be really slow, and has another bunch of complications, so no, I won’t be running web TiddlyWiki any time soon on the damn thing.

But that is based on the Node.js server, so not a good solution for me. Although,it’s nice to know about, and could come handy in the future.

I can do this now that I’ve set up the double-repo thing, because as I said before I only had instant access to the HTML wiki, not the single tiddler files, which would have required manual extraction for editing, then re-importing. Now I have instant access to my wiki for editing in both format, and can use the one I want in any particular moment. But I was asking for if there was any more elegant solution… which apparently there is not. Oh well.

So, that’s all. Now, as for the software I would use to edit the .tid files locally and sync changes to Git, I think I can rely on GitJournal on Android, and Leafpad + git cli on the Kindle. This however doesn’t strictly relate to TiddlyWiki, but just with general workflows of editing small text files and syncing them to git.

If anyone is curious, or for future readers that come across this post searching for the solution I needed (which, again, I wouldn’t call battle-tested for now because I cobbled it together just a few hours ago), all the CI and shell scripts I use are in my 2 repos:

Explained rapidly:

  • In each repo the different workflows always check for if the Git commit message is not equal to a predefined one, in which case it starts a second commit to parallel repo; this is to avoid infinite cycles, as they obviously would work both ways forever if this wasn’t the case
  • In the primary repo, with this command I extract the HTML wiki into a WikiFolder, that I then push to the secondary repo: tiddlywiki --verbose --load ../public/index.html --output ./Wiki --savewikifolder ./Wiki
  • In the secondary repo, I use this command to repack the WikiFolder into an HTML file, that I then push to the primary: tiddlywiki --verbose --output ./Output.tmp --rendertiddler "$:/core/save/all" "index.html" "text/plain"

That’s very exciting. I may have to try that. Don’t know if my firmware is jailbreakable or not. Will have to check.

Impressive!

Yes, and I thought you wanted to avoid that. I probably misunderstood your goals.

So am I right that if you want to start editing the tiddler files from a wiki you’ve recently edited as a single-file app, you would wrap that work in git pull and git commit/push.

My workflow is somewhat different, using Node. I edit only using the Node version, but publish for others’ consumption via a build command creating a single-file wiki and a push (at some point I’ll get that build in the CI server.) This is great, but there is one pain point, when I want to edit the tiddler files directly (fairly rare, but it happens), I have to restart the Node server and refresh the web app. This is quick, but it’s easy enough to forget to do it and wonder why my changes aren’t appearing. I haven’t found any way around that. I’m also thinking of adding an auto-committing file watcher – if there have been no changes in the last n minutes, automatically commit them. We’ll see.

Depending on the refresh rate of the device TiddlyWiki on eInk is actually very nice.

I have a eInk phone called a Hisense A5 Pro CC
that I use as a SHTF-type archive, stuff like pictures, notes (in TW), offline maps, et cetera, and it works pretty well honestly.

Only problem with the device itself is it’s system uses chinese characters and can be a bit difficult to work with, it’s less than stellar cellular reception, and it’s lack of a microSD card slot, but I’m getting a bit off track :sweat_smile:

2 Likes

In the West, you can use AliExpress (AE) to order e-ink devices (HiSense came up first on my search), including tablets running Android 8 and color e-ink. For some reason, e-ink devices are very much neglected in the local markets.

1 Like