Mmark is a powerful markdown processor written in Go, geared towards writing IETF documents. It is, however, also suited for writing complete books and other technical documentation, like the Learning Go book (mmark source, and I-D text output.
It provides an advanced markdown dialect that processes file(s) to produce internet-drafts in XML RFC 7991 format. Mmark can produce xml2rfc (aforementioned RFC 7991), RFC 7749 (xml2rfc version 2) and HTML5 output.
Example RFCs in Mmark format can be found in the Github repository.
If you like Go and parsing text, drop me (email@example.com) a line if you want to be part of the Mmarkdown Github org, and help develop Mmark!
Mmark’s syntax and the extra features compared to plain Markdown are detailed in syntax.md.
Mmark adds the following syntax elements to gomarkdown/markdown:
- (Extended) title block.
- Special sections.
- Including other files with the option to specify line ranges, regular
expressions and/or prefix each line with a string. By default only files on the same level, or
below are allowed to be included (see the
- Document divisions.
- Captions for code, tables and quotes
- Figures and Subfigures - bundle (sub)figures into a larger figure.
- Block Level Attributes that allow to specify attributes, classes and IDs for elements.
- Indices to mark an item (and/or a subitem) to be referenced in the document index.
- Citations and adding XML References
- In document cross references, short form of referencing a section in the document.
- Super- and Subscript.
- Callouts in code and text.
- BCP14 (RFC 2119) keyword detection.
% go get && go build % ./mmark -version 2.0.0
To output XML2RFC v3 xml just give it a markdown file and:
% ./mmark rfc/3514.md
Making a draft in text form (v3 output)
% ./mmark rfc/3514.md > x.xml % xml2rfc --v3 --text x.xml
Making a draft in text form (v2 output)
% ./mmark -2 rfc/3514.md > x.xml % xml2rfc --text x.xml
Outputting HTML5 is done with the
-html switch. Outputting RFC 7749 is done with
The rfc/ directory contains a couple of example RFCs that can be build via the v2 or v3 tool chain. The build the text files, just run:
cd rfc make txt
For v2 (i.e. the current (2018) way of making RFC), just run:
cd rfc make TWO="yes" txt
Official RFCs are in rfc/orig (so you can compare the text output from mmark).