New blog

Gemini, JanetLisp as new builder, simpler HTML, ...

This blog has been running using a 60~ lines long bash script for a while, but while it worked pretty neatly, it was pretty hard for me to extend it.


Because I wrote plain HTML, and while it is a pretty efficient way to have a very simple, but very versatile, builder, it quickly becomes much more complex when there is another target than HTML as output format for the content. Which target am I talking about?

That target is Gemini, a content-focused protocol and format I recently took interest in.

I appreciate the constrained set of grammar rules and possibilities (while I did add a few niceties in the gemini to HTML conversion), so I chose to go with it for pretty much every article here, as I have no need for anything more complex.

What's very cool is the fact that the Gemini syntax removes lots of ambiguity from Markdown. This motivated me to tackle, many times, the project of writing a Gemini parser from scratch.

The first few tries took me around two to three hours each (doing a naive line-by-line parser by hand), and were definitely fun to do, but I found them impractical to use. However, I got my hands on the pretty cool Janet language (even if I still cry a bit for some stdlib inconstitencies, especially around the string module), which ships a very well-built and easy to use PEG module.

I spent some time learning how to build my own grammars and once I felt comfortable with its mechanisms, I built myself a parser / generator for Gemini, providing some niceties (such as extracting a page's title and excerpt) and a few syntaxic extensions (converting a set of --- into a hr node).

I also took the time to revamp the website's appearance to go towards something much simpler and cleaner, taking some inspiration from 100 rabbits (hey there!).

This project ending allows me to have a bit of fresh air in terms of personal project development, and to move forward towards some new things.