I'll just write my own personal wiki
Dec 30, 2019I’ve been using tiddlywiki as a personal bookmark manager since 2011 when Delicious was acquired. I’ve been running the node.js version since early 2016. I have a few thousand bookmarks and notes.
It has always sort of annoyed me that: it’s a browser-based GUI, its stored as a collection of files and sync poorly across multiple systems, and I have this extra process running.
What I want: command line access, use my existing editor, single executable, single data file, export.
Work in progress on Source Hut https://git.sr.ht/~rlonstein/wk (also on Github but I’m doing my development on sr.ht).
I designed a simple command line:
wk [n|new] <filename>
wk [s|search] <keyword>...
wk [a|add] --title <title> --tags [<tag>, ...] --text <text>
wk [e|edit] --title <title>
wk [d|del] --title <title>
wk [t|tag] [delete|edit|rename|list] [<tag>]
wk [x|export] [--format [json|markdown]] <keyword> ...
wk [i|import] [--format [json|markdown]] <filename>
I chose C++17 to reacquaint myself with the language, libraries, and toolchain. I’m using sqlite as the database.
What it notably doesn’t do (yet) is actual CamelCase wiki word linking, but I’m not sure that’s useful for a personal notebook and it may never get implemented.
Converting is a matter of exporting the existing tiddlers from
Tiddlywiki as json, munging with jq as below,
and slurping the result in via wk import
[.[]|{"metadata":
{title, created, modified, "tags": (.tags|split(" ")?),
"type": (if .type == "text/x-markdown" then "markdown"
else "text" end)},
text}]