A Very Simple Markup Language

Friday, 19th August 2022

You might have noticed I keep a fairly basic website these days. That's partly because of my time exploring Gemini.

Gemini provides an alternative space on the internet to share simple hyperlinked documents. Its minimalism makes it a lot of fun to play with and keeps Gemini wonderfully uncommercial.

Most of the content on Gemini is written in Gemtext. A markup language where each line is a new element and the beginning of each line indicates its type.

A document in Gemtext might look like this:

# Caolan's Capsule

Welcome to my small home on the small internet.

=> garden/ Garden
=> kitchen/ Kitchen
=> workshop/ Workshop
=> bookshelf/ Bookshelf
=> desk/ Desk

Compared to Markdown, I find this little markup language a joy to write and less distracting to read. Its lack of inline styles such as bold and italic - and even inline links - keeps me focused on the content.

I wanted to write my content for the web in a similar style but with one small alteration: the ability to hard-wrap text.

* Some paragraphs can get quite long and, depending on your editor, keeping it all on a single line can feel a bit cumbersome.

I find many text editors - including my current editor of choice, Kakoune - do not soft wrap text very well. I'd much prefer it if I could split content over multiple lines.

* Some paragraphs can get quite long and, depending
  on your editor, keeping it all on a single line can 
  feel a bit cumbersome.

So I designed my own syntax for a multi-line Gemtext that I'm calling Croftmark. I have written tools to convert Croftmark to HTML, Atom, and back to Gemtext .

There are more examples in the README.

Croftmark is not quite backwards-compatible with Gemtext because paragraphs must be separated by empty lines. But, in practice, most Gemtext authors already use this style and their Gemtext documents can be rendered by Croftmark.

I'm now using Croftmark to author my website and the tools combine well with the Apache config from my previous post about converting markup on demand.

Using that config, I can drop a Croftmark file like this (the one you're reading) directly into my web server's root and Apache will serve it as HTML. Neat.