Document formats

Most of the time, when writing a document, I want a document format with the following properties:

An AST is a programming-friendly representation of a document. ASTs reduce the effort required to write tools such as a program that validates links in a document. Ideally, ASTs contain information to track a document element to the position it occupies in the original document. With this information, if you write a tool such as a spell checker, then you can highlight misspelled works precisely in the original document.

On top of that, some features that I don't always need:

Existing formats

Markdown

Djot

https://djot.net

It is very similar to Markdown, except:

AsciiDoc

https://asciidoc.org

Compared to Markdown:

Typst

https://typst.app

Checks all my boxes, except:

Typst is very new and is not yet very popular.

Typesetter is a desktop application that embeds Typst, so no additional setup is needed. However, Typesetter is only available as a Flatpak.

Verso

https://github.com/leanprover/verso

A Markdown-like closely tied to the Lean programming language.

TODO: other formats

Nota (a document language for the browser)
Argdown (for argumentation)
Podlite
Org Mode (an Emacs-based tool based on a lightweight markup language)
Neorg (similar to Org Mode for Neovim)
Sile (typesetting system)

Creating your own formats

Someone created its own lightweight format using Lua and PEGs.
"Which parsing approach" has information about choosing parsing approaches.

About gemtext

https://geminiprotocol.net/docs/gemtext-specification.gmi

Gemtext is an extremely minimalistic markup language designed for use with the Gemini protocol (an extremely minimalistic protocol similar to HTTP).

The Gemini protocol and gemtext are intentionally designed to limit their power, in my opinion as a comment on the web.

This document is gemtext-native for use in my own minimalistic publishing system.

I also use it as a statement, although the limitations of gemtext can be significant in technical writing. For example, gemtext has no inline links, no inline verbatim code, only three levels of headings, etc.