Org-Roam-Web

I’m a big Emacs user, and around the time I started using it for almost everything I decided to move my personal wiki from Tiddlywiki to Org-Mode. Specifically Org-Roam, a package that adds wiki-like functionality to Org-Mode.

It’s not perfect but it checks a lot of boxes for me. Once it has scanned all my wiki files (around 4.5k of them) it is speedy and very nice to use in Emacs. However, that’s in Emacs – there’s no convenient way to use the wiki via mobile or website. Out of the box, you’re stuck in the box so to speak. Which usually isn’t a problem, Emacs is amazing… but I wanted to be able to use my wiki from my phone.

I scoured the internet, and though there were some solutions to this problem, none of them quite fit for me. I decided to make my own.

Web Interface

viewing my wiki entry for “gruit”

I wrote a little web interface in php that reads my wiki files. The Org-Mode formatting is turned into HTML formatting using lots of regex, and links are clickable and take you to the referenced page. Perhaps most importantly, there is an editor, which means I can both view and edit my wiki on my phone!

searching the wiki

Links and Backlinks

A python script periodically scans all the files in my wiki and saves metadata and linking data to SQLite database. The web app uses this info to make the links work. When a page loads, php queries the database to find out which links lead to real files.

Additionally, the database is queries to generate backlinks – other wiki files that link to the current one. This makes it easy to fall down a rabbit hole of related articles, which of course is fantastic for spelunking through everything I’ve learned and collected.

I use php $_SESSION to store a record of each file I visit, which I use to generate breadcrumbs; to show where I’ve been and how in the world I went from “homebrewing” to “Terraria blocks.”

backlinks and breadcrumbs

It’s rough around the edges but I think it’s pretty snazzy.

Sync

I use syncthing to sync my wiki files between the web server and my primary computer. (I also run a WebDAV server to access my wiki files but that’s an explanation for another post.)

Code

(under construction)

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.