So I am of a mind to create a Gemini mirror for my Hugo blog, written, historically, in markdown.
The plan is to produce a “raw” not-yet-Gemini output with .RawContent
that constitutes a valid Markdown file, and then pass it through pandoc
with a lua formatter which will approximate it down into a Gemini-compliant form I am happy enough with, render everything it can, and quietly excise everything it can’t render.
The problem with that is shortcodes: .RawContent
doesn’t render them. Which wouldn’t be a problem, as I can do the requisite filtering later for the most part – except for certain builtin shortcodes, like ref
and relref
.
A program that processes the resulting prefab output wouldn’t know where a relref
or ref
shortcode might point to. I’d basically have to reimplement half of Hugo just to get at this information in a non-hardcoded way.
The alternative, using HTML as the intermediate format by supplying specially pared-down templates, would work for everything I actually use, except footnotes: Pandoc can’t parse footnotes from HTML. I use a lot of footnotes, so this is not an option.
Is there a way to pass a string through a shortcode processor inside a template without turning the whole thing into HTML?