-- Leo's gemini proxy

-- Connecting to warmedal.se:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; lang=en

I Wrote a General Gemtext Parser


https://notabug.org/tinyrabbit/gemtextparser


You can clone it and install with pip locally (I haven't published it to PyPI).


It's not a big deal, really. Despite the opinions aired in my last post gemtext is, as I mentioned, not hard to parse.


This module provides a general parser and validator. Where gmi2html reads a file line by line and determines how to translate what it gets to HTML, gemtextparser reads a file and determines what each line semantically is. What you do with those lines is up to you.


Oh, yeah, you can run it as a CLI program that validates given files as well. There's not many errors you can make when writing gemtext, but it catches two: unclosed preformatted block and empty lines (plain text and preformatted lines can be empty, of course).


-- CC0 ew0k, 2021-07-25

-- Response ended

-- Page fetched on Sat May 4 05:46:21 2024