-- Leo's gemini proxy

-- Connecting to mozz.us:1965...

-- Connected

-- Sending request

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

A Simple Markdown Proposal for Gemini


I have put together a new dialect of markdown that I think would be a good compliment for the design principles of Gemini. It allows clients to reflow text to fit their display size, while providing content authors with access to page formatting elements like headers and lists. The goal would be to eventually standardize "text/gemini" documents to use this flavor of markdown instead of plain text.


This project should be considered *alpha* status and is not a formal proposal. I'm not even sure if I want "text/gemini" to use a standard markdown format at all. However, I think it can be helpful from a design perspective to see some real code examples of how this might flesh out.


The full specification is described in this text document. The document itself is also formatted using the proposed markdown style:


=>design_document


---


I wrote a simple parser in Python to demonstrate how easy it is to extract an AST (Abstract Syntax Tree) from the markdown file:


=>extract_ast.py


Here's what the design document looks like after running it through the parser:


=>design_document.json


---


I also put together some examples that demonstrate how the AST can be rendered into different formats to be displayed by the client. Of course, this step is optional and "dumb" terminal clients can always just display the raw markdown file.


Here's a script that renders the AST as an HTML document:


=>render_html.py

=>design_document.html


Here's a script that renders the AST as plain text using VT-100 escape codes for terminal colors.


=>render_vt100.py

=>design_document.txt

-- Response ended

-- Page fetched on Sat Jun 1 22:57:58 2024