Editing tid files directly

96 views
Skip to first unread message

Haakon Robinson

unread,
Mar 18, 2020, 7:12:29 AM3/18/20
to TiddlyWiki
Hi! 

While looking around for info on the node.js server, I found this:

There are a few file system limitations you should be aware of that are related to how TiddlyWiki was designed:
  • The best, most general way to interact with a running wiki is via the HTTP or JavaScript API, rather than manipulating the file store directly
  • Any modification to the contents of the wiki folder (e.g. images) might thus sometimes require that your restart the node.js server
  • TiddlyWiki might support manipulating the file store directly in the future

I enjoy editing things with vim, so this got my interest. I was wondering if someone could expand on why synchronising changes to the file store directly would be challenging, and what would it take to implement?

Haakon


Jeremy Ruston

unread,
Mar 18, 2020, 8:32:14 AM3/18/20
to tiddl...@googlegroups.com
Hi Haakon

The reason that TW5 didn’t include bidirectional sync with the filesystem originally is that when TW5 was created Node.js was very new and the file system watching APIs didn’t work properly across all platforms.

Since then, a more subtle obstacle to implementing the feature has been that we’ve gradually added features that apply relatively complex processing to tiddler files as the contents are read during startup and the wiki is built (for example, see the “tiddlywiki.files” feature). That processing is in general not reversible so the only route to supporting direct file system changes is with the introduction of a new wiki folder format, which we’d see as a big change.

I’ve simplified the docs to try to make things clearer:

Note that TiddlyWiki on Node.js doesn't currently support directly modifying the tiddler files via the file system while it is running. The server must be restarted in order to for changes to take effect. The recommended way to interact with a running wiki is via the HTTP or JavaScript APIs.


Best wishes

Jeremy.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/0c395576-0588-42f4-96fb-73d371e2e89d%40googlegroups.com.

Soren Bjornstad

unread,
Mar 22, 2020, 10:09:06 AM3/22/20
to TiddlyWiki
Haakon,

You might be interested in the CodeMirror plugin and the vim plugin for that, which will let you use vim keybindings right in the wikitext editor. Go to Control Panel -> Plugins -> Get more plugins -> Open plugin library and search for "CodeMirror". It's a fairly lightweight implementation and doesn't offer remapping, plugins like Surround, or all text objects (weirdly, it has some but not others), but I find it's a nice compromise.

Note that once you've installed you have to go to Control Panel -> Settings -> CodeMirror to actually enable the vim keybindings or nothing will happen (that took me a while to figure out). Also, you may need to change the keyboard shortcut for canceling editing a tiddler away from Escape, or it will be difficult to switch modes.
Reply all
Reply to author
Forward
0 new messages