djr
The fastest Djot parser ever?
Djot is a light markup syntax. It derives most of its features from commonmark, but it fixes a few things that make commonmark's syntax complex and difficult to parse efficiently. It is also much fuller-featured than commonmark, with support for definition lists, footnotes, tables, several new kinds of inline formatting (insert, delete, highlight, superscript, subscript), math, smart punctuation, attributes that can be applied to any element, and generic containers for block-level, inline-level, and raw content.
- From the Djot website
djr
is a pull parser for Djot written in pure Rust. It is built on three
principles:
djr
should be maintainable by veterans and newcomers alike.
Idiomatic Rust is preferred.djr
as fast as possible.These are not necessarily compatible with each other. As an example, the speed requirement made me make the choice of only targeting UTF-8 and handling all the text as pure bytes, inhibiting the legibility. However, I try to find a balance where possible.
NOTE: djr
is not finished and thus unusable at the moment. If you want to
help out, send me a mail through the djr
discussion mailing list
djr-discuss
.
djr
is written as a library you can use for parsing Djot into an iterator of
markup events. You can use this in combination with a writer to produce the
desired output. djr
will ship with builtin writers for e.g. HTML, but you can
build your own as well.
There exists a CLI for djr
, which is hosted on
GitHub. With it, you can convert Djot into
the desired output from the command line.
All patches should be sent to the djr
development mailing list
djr-dev
.