Skip to content

whacked/tiddlywiki-org

Repository files navigation

emacs and org-mode interaction for TiddlyWiki 5

sporadic work in progress. caveat emptor: this is a bit of a hack

what this lets you do

  1. add org-mode type to TiddlyWiki + render it (now using mooz’s org-js)
  2. edit tid files in emacs

for live updating to edits made from emacs (or elsewhere)

see discussion on issue 1530 about how to get TW/TD to monitor + update tiddlers edited externally

also see this tiddlywiki fork

how to use / install

  1. generate the plugin’s tiddler: python compileorg.py -save $DIRNAME where $DIRNAME is the base path (contains the tiddlywiki.info file) of your tiddlywiki. this will auto-populate a tiddler that is the org-mode plugin.
  2. tiddlywiki $DIRNAME --server $PORTNUMBER [default 8080] / launch TiddlyDesktop

tiddlywiki-mode.el

provides a basic tiddlywiki mode that:

  1. narrows the buffer so the tid header metadata is hidden
  2. tries to apply the correct major mode based on the tiddlywiki-specified content type
  3. updates the timestamps on save

notes in using mooz’s renderer

  • currently outputting raw html (and not a widget tree) to TW from the plugin
  • don’t know how to disable the section header numbers from the html output; this is easily (and probably better) addressed using a stylesheet tiddler, for example:

stylesheet tiddler for mooz’s org-output

  • create a tiddler, any title, e.g. “org stylesheet”
  • important: must give add a tag called $:/tags/Stylesheet
  • set e.g. this text to stylize section header numbers (or hide them, or whatever)
span.section-number {
    font-family: monospace;
    opacity: 0.2;
    margin-right: 0.5em;
}

span.task-status {
    padding: 2px;
    margin: 2px;
}
span.task-status.todo {
    color: red;
    font-weight: bold;
}

current issues

usually resolved by restarting the server. At present these are minor annoyances.

new files created from emacs will not be picked up by the server

node server crashes

sometimes when renaming files from the browser. Haven’t looked deeper into cause.

auto-revert workaround

previous commit relied on auto-revert-mode, which caused a lag from the tiddlywiki server picking up the change and updating the file mtime. the update mechanism is overridden in this tiddlywiki fork such that auto-revert-mode is no longer necessary. I don’t know the larger impact of the workaround.

file name restrictions for interop

from experience (and not investigation), tiddler files and tiddler titles should have no spaces in them. TiddlyWiki will convert spaces in titles created through the browser into underscores, but reads the tiddler title from the title field in the tiddler headers.

This causes some trickiness in the org-style links when editing in emacs. It may be possible to use %20 for spaces in the links. Haven’t bothered trying, but mixing plain spaces and underscores will fail.

executable javascript tiddler

node build-executable-javascript.js $PATH_TO_TW_ROOT

About

TiddlyWiki 5 + emacs + org-mode = awesome

Resources

Stars

Watchers

Forks

Packages

No packages published