Pranab's site — Home

djot

Apr 23, 2023 to right arrow Feb 04, 2024 (IST)


EDIT: Whoa! Inane mind dump ahead! Just check out the post on why I like djot. I’m keeping this link for something to at least laugh at, and to build a habit of not breaking links.

I was reading an article by matklad and I realised the formatting looked a lot like the default Asciidoctor output, so I went hunting around for how he built his site and found an article on markup formats. Turns out djot is a really nice format, which includes some interesting ideas from asciidoc as well as markdown.

Sadly, the tooling around it is quite limited. Current implementations include one in Javascript, another in Lua, and a third in Rust. And the syntax reference link at djot.net seems broken.

The Javascript implementation is the current focus, while the Lua one is the first (that may be phased out), and the Rust one is unofficial, with a single link in the djot.net page and no other mention.

I think all three allow for creating an ast, so it should be easy to work them in with other tools, but it’s still a fair bit of work (for me) to set up a static site or generate other documents from it.

Maybe it’s a good reason to really get into Javascript (Rust is a bit overkill), although the hexo static site generator has an extension for it, and other Javascript ones like 11ty should also be able to easily plug it in.

Alternatively, just use the cli given by djot.js to output the ast and manipulate it in any language, then feed it back into djot.js or pandoc. Even the html output can act as an ast of sorts if you’re already familiar with it. Maybe I’ll try that, but it’s still a lot of work (as a non-programmer) to replicate everything that static site generators and other tools can do for you.

Again, sorry for that. Please check out the post with some actual content.