💾 Archived View for taoetc.org › converting_markdown_to_gemtext › index.gmi captured on 2022-07-16 at 15:21:24. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
I received an email from Sandra Snan today, recommending two different programs to convert Markdown to Gemtext, since I've been having problems with multi-line blockquotes with md2gemini. Sandra suggested gemgen and 7off, mentioning the latter was slower but better with links.
Since I'm not really worried about performance I cloned the 7off repo, installed CHICKEN scheme, and gave it a try. It was my first time compiling a scheme program, so it took me a couple minutes to figure out that I had to run chicken-install. Once I did that 7off worked great with my blog posts, except that it doesn't support triple backticks for code blocks, only 4-space indentation.
While scheme looks interesting, I was really looking for a Python solution, since it's easier to integrate with my static site generator. Since I'm already using marko to parse Markdown in order to extract links I decided to write my own GeminiRenderer, and it turned out to be much simpler than I expected. My Gemini renderer is <100 LOC, and most of that is comments and whitespace.
Published on 2021-10-11 18:14:24-07:00 by Beto Dealmeida <roberto@dealmeida.net>.