kittywiki

kittywiki is a tiny little wiki program that's designed for building small websites! this website runs on it (and is in fact what i initially built it for) :3

i think being able to easily edit my website, create new pages, etc and have it go live instantly is really useful!! i've been interested in this idea for a while - in my almost-decade of having personal websites of some form i've built a couple custom CMSes inspired by wikis, but this one is the first that's actually kinda a normal wiki software with wiki features.

kittywiki is written in ocaml using the dream web framework, liquid templates, and irmin (for storing page contents in git). it's open source software,[1] licensed under the Be Gay Do Crimes License, and the source code is available on git.gay.

kittywiki vs gitit

when setting up this site, i initially used gitit, which is a wiki software written in haskell that uses a git repo to keep track of page history/revisions/etc. i really liked how simple and customizable it was (i wrote a custom set of templates to make it look like this site currently does), but unfortunately i ran into performance issues. it was constantly eating up 10-20% of a cpu core and i couldn't figure out how to fix it (in large part because i do not know haskell)! so, i ended up just writing my own thing[2] that is very similar but is much faster (and more flexible, while i'm at it)

things kittywiki has that gitit doesn't:

  • good performance
  • more flexible templates, making it easier to build your own site on top of it
  • ability to move pages
  • diffs using patience diff algorithm
  • OIDC authentication
  • slightly better file uploader
  • no jquery! and overall less javascript
  • a good page text editor (uses codemirror)

things gitit has that kittywiki doesn't:

  • categories, templates, recent changes, talk pages, user pages
  • search
  • more supported page formats (it uses pandoc to produce html instead of just using a markdown parser)
  • latex equation rendering with mathjax
  • username/password auth

future development (as a wiki)

kittywiki is not complete, there are still a lot of features i want to add!! here's a list

  • better auth:

    • right now it just allows anyone who can authenticate with the configured OIDC provider to edit anything. actual access controls would be useful
    • normal username/password auth would make it much easier to set up
    • support for a file that maps OIDC usernames to display names would be useful for OIDC providers that don't let you easily change it (cough cough tailscale)
  • caching: currently it does not cache anything !!! and despite that, it is fast enough for this tiny site and probably many others, but it would be a good idea to improve on that

  • more wiki features: user pages, talk pages, user contributions pages, recent changes, categories, templates

  • make a default set of liquid templates that looks like a normal wiki. maybe just copy gitit's UI

  • add editor for liquid templates to web ui, and store them in VC as well! and allow pages to include templates, combine markdown and liquid?

  • automatically generate sprite sheet for 88x31 buttons

longer-term plans (as a general-purpose tool)

i want kittywiki to become a general-purpose tool for building dynamic server-rendered sites (not just static html/markdown). i think the ability of software like emacs, squeak/smalltalk, etc to allow you to introspect and modify the tool/application while in use is incredibly powerful. i want to work towards a goal of kittywiki being a similarly malleable, living, reflective system built on simple components and abstractions that combine well. i want to, wherever possible, remove the distinctions between using and developing the application/tool

at least at the start, i (roughly) plan to do this by:

  • developing the basis for a plugin system so that kittywiki can load and unload external modules at runtime
  • developing a system that allows the kittywiki binary to recompile and replace itself, and store its own code in the git/irmin repository it currently just uses for page data
    • or possibly compile to bytecode on the fly? unsure
  • developing a web-based editor for editing all the ocaml source code of kittywiki, and implementing web server routes for modifying the code in the repo
  • getting rid of liquid templates in favor of a custom template language that's better integrated with ocaml
  • developing various features to better integrate the editing experience into the page content, like maybe a button that lets you click an element on a page and jump to the part of the source that generated it?

this is all very broad in scope and given i have a full time job, i'm unsure when i'll have the time, but i would really like to get to this someday. i've dreamt of a system like this for so many years :) [3]

  1. the osi would probably argue otherwise but i do not care

    ↩︎︎
  2. yeah i guess i really did write an entire wiki program to avoid having to learn haskell. oops ,,, i will learn haskell eventually i promise!!!

    ↩︎︎
  3. a bit of a tangent - around 5 years ago, i built a web-based tool that runs a web server (and javascript transpiler) in a service worker in your browser and provides a code editor for editing not just a JS app, but also the editor and the web server! only a very small amount of bootstrapping code was used (sent by the server at first run, so the browser can load into local storage and run an initial FS image containing the server and editor code).
    i distinctly remember a moment in the development process where i was able to stop using any external tools to develop the editor and instead, just export an image of my live environment every now and then and save that to the server. it was incredibly satisfying and fulfilling

    ↩︎︎