This is a fork of hoedown that attempts to add some support for rendering to a man page using the light weight nroff man macros vs. the nroff mdoc macros. It is very much a hack in that the manpage renderer is a copy of the html renderer, and modified just enough to render very simple markdown documents. A number of HTML renderer functions have been left in place, with the addition of a line of exit code denoting which function needs to be implemented for code completion of the particular markdown syntax functionality.
Hoedown is a revived fork of Sundown,
the Markdown parser based on the original code of the
Upskirt library
by Natacha Porté.
This branch has the code for version 4, in which Hoedown has been rewritten
and is now targeting CommonMark officially.
Important: this code is in pre-alpha! Don't use it for production yet. The section below doesn't fully reflect the current features, but rather the goals for the final release.
-
Standards compliant
Hoedownfollows the CommonMark spec and is tested against it. It's entirely compliant except for some differences needed mostly to guarantee security. -
Fast and efficient
Hoedownhas been written with speed in mind; it reuses memory, operates without an intermediate AST and renders at the same time, among other things.Hoedownrenders at 145% the speed of CMark (the reference C99 implementation) at the time of writing. We tested many documents: this README, the spec, John's syntax page, etc. -
Portable and zero-dependency
Hoedownis a zero-dependency library composed of some.cfiles and their headers. No dependencies, no bullshit. Only standard C89 that builds everywhere. -
Increased flexibility
Hoedownsupports (unofficial) CommonMark extensions such as tables, math, footnotes, and more! The new version gives even more control, allowing you to enable or disable every single construct, not just extensions, at runtime. -
Customizable renderers
Hoedownis not stuck with HTML, renderers can output anything: TeX code, an AST tree, statistics about the parsed document, binary data, etc. Parsing is completely decoupled from rendering. -
Precise source mapping
Hoedownis more than a parser. It has character-level source mapping, both direct and indirect, which is also present at inline constructs. This allows for a variety of creative uses, see the recipes. -
Safe for production
Hoedownincludes protection against possible attacks like out of memory situations, malformed syntax and extensive nesting. We've worked very hard to makeHoedownnever leak, crash, loop or block under any input.Warning:
Hoedowndoesn't validate HTML found in Markdown documents. Unless you disable HTML parsing entirely, you should always feed the rendered HTML to Lanli or another sanitizer. -
Unicode aware
Hoedownis fully UTF-8 aware, both when parsing the source document and when generating the resulting HTML.
You can see a community-maintained list of Hoedown bindings at
the wiki.
Hoedown is all about security. If you find a (potential) security vulnerability in the
library, or a way to make it crash through malicious input, please report it to us by
emailing the private Hoedown Security
mailing list. The Hoedown security team will review the vulnerability and work with you
to reproduce and resolve it.
To build the library and executable, use CMake:
cmake -D CMAKE_BUILD_TYPE=Release .
cmake --build .
Or just drop the files at src into your project.
Hoedown doesn't have any special building requeriments.