Automatically generated from the Gemini capsule gemini://

Time-stamp: <2021-04-21 18h50 UTC> is now automatically compiled to the web

Using a combination of git hooks, a python script, and some shell glue it is now possible to view an HTML version of over the web⁰.

This is a short post to detail how i implemented it, and lament the things that didn't work.

I'm not in the best time-line (yet)

I would have liked to have been able to set up a gemini-to-http server and proxied it in. The first thing i found was ddevault's Kineto.


It's written in Go, about which i have some reservations, but one of it's modules has a hard version requirement *on Go itself*! Debian does not package a ``new enough'' version, so i can't use this code. To me this is frankly unbelievable, and i'm still not sure i even understand what a version of a ``programming language'' could mean. If this is a question of libraries or something, then perhaps call it such, but the compiler gleefully reports ``Go version 1.15 required'' ...

There's also tslocum's Xenia.

tslocum's Xenia

Unfortunately i couldn't quite work out what this is supposed to be, or how it works, so i ended up doing this the wrong way.

The wrong way

I came across a gemtext-to-html converter and decided that i could reasonably modify it to generate usable HTML output directly. As exists as a repository on the hosting machine, i opted to add the following snippet to `.git/hooks/post-update' to (re)generate the HTML every time i pushed a change to the capsule.

echo Generating HTML site
for g in /var/gemini/*.gmi; do
    html_out="/var/www/$(basename $g .gmi).html" /home/$USER/gemini-capsules/ \
                /home/$USER/gemini-capsules/ \
                "$g" "$html_out";
    chmod 644 "$html_out"

Here is the name of the script. You can find the original version and my modified version using the below links.

hunterb's original version,

my modified version,

A fun story about licensing

Originally hunterb had made the code available, but had forgotten to include a license. Fortunately, there was a listed contact email address. I wrote to hunterb, explaining that i want to make use of the script, change it, share my changes, and allow others to do the same. I asked whether they would be willing to release the code under a license which afforded me these freedoms ...

they said yes!

The code is now available under the terms of the GNU GPL v3!


⁰ though of course, why would you