Gopher Rabbit Hole

📅 2026-05-27

🏷 Lagrange, Gopher, GmCapsule, Programming

The plan was to fix a crash in Lagrange caused by not properly validating the content of Gopher type 0 selectors. I figured I need to run a Gopher server to test this properly, but the available options didn't strike my fancy. How hard is it anyway to write a Gopher server? Not hard at all, it turns out. A few days later, I had a new server written in C, serving my Gemini capsule content via skyjake.fi port 70.

Then I had a thought: since my Gopher server is taking Gemtext files and rendering them as fancy plain text, maybe I could use a higher-level markup and use that to generate BOTH the .gmi and fancy .txt variants?

A few years ago (...in 2002...) I wrote a document processing macro language inspired by TeX. It has a bunch of user-definable output filters that determine how the output gets generated, so you can use it to produce plain text, RTF, HTML, UNIX manual pages, etc. This would be a perfect (??) solution for my gemlog content: write in one format, generate all sorts of presentation formats. It didn't take much effort to make an output filter for Gemtext.

Of course, GmCapsule also needed a little tweak to support configurable format converters, but that wasn't very difficult to implement.

So, now I had a way to present my gemlog posts in any format, as long as the original source uses my macro language.

Then, for some reason, I felt it was necessary to add PDF output to my macro language. How cool would it be to view my gemlog posts in PDF?! I admit, typesetting is a bit of a guilty pleasure for me and getting reacquainted with this old document processing tool was quite fun. It's nice to have Markdown and HTML, but actual paper-like rendering? That's an exciting and wholly different ball game.

Now, at this point in my tumble down the rabbit hole, I figured it was time to stop wasting my own time and I turned to Claude to implement this "important" new PDF feature for me.

A few days later, having come back to my senses, I remembered to actually test and fix the Lagrange crash that set off this little quest.

I'd like to write more about my new Gopher server as I think it's pretty neat, but in the meantime, I'll briefly say it has helped tidy up the Gopher support in Lagrange nicely. The next patch (1.20.6) will include a number of Gopher-related improvements.

CC-BY-SA 4.0

The original Gemtext version of this page can be accessed with a Gemini client: gemini://skyjake.fi/gemlog/2026/05/gopher-rabbit-hole.gmi