| Objectives | Process | Observations | Resources |
A comparative evalution of open source CLI Markdown processors: discount markdown, hoedown, multimarkdown and pandoc.
:TODO: add cmark-gfm. add SwiftMark.
Objectives ▴
- Markdown Syntax. Find, to the extent possible, a common set of markdown syntax including certain extensions.
- CLI Settings. Find settings which produce the most similar markdown output.
- Extension Support. Evaluate extension support for footnotes, piped tables, fenced code, and LaTeX.
Process ▴
- Install "discount" (which installs as
markdown),hoedown, andpandocas command line tools. - Edit soure markdown file
md_evaluation.md - Run
test.sh - Compare output. The
aandbversions allow comparison what output changed for some settings change for the same CLI tool. Thetxtandhtmlallows for comparison of raw output and how the output renders in a browser.
Note: Discount
markdownand MultiMarkdownmarkdownhave the same command name. Thus, Discountmarkdownand MultiMarkdownmarkdownare mutually exclusivebrewinstalls. However, Discountmarkdowncan be manually installed somewhere not on$PATHand scripted with/FULL/PATH/TO/markdown.
Note: brew
cmarkandcmark-gfmconflict because both install acmark.hheader.
Observations ▴
The source document md_evaluation.md evolved and evolves to contain details on common syntax and notes on various markdown feature.
Some of the major findings are noted here below.
LaTeX demarkation syntax
$, $$ |
\\(, \\[ |
\(, \[ |
|
|---|---|---|---|
| raw html | ✓ | ||
discount markdown |
✓ | ||
hoedown |
✓ | ✓ | |
multimarkdown |
✓ | ✓ | |
pandoc |
✓ | ✓ | ✓ |
Note: Use of \(, \[ syntax disallows escaping ( and [ for other purposes. hoedown does not have expressly enable/disbale control over dollar sign $ vs. double backslash \\ syntax. pandoc can expressly enable/disable each of the three syntax.
discount markdown
- html fenced code. discount
markdownfenced html with~~~ htmldoes not generate a useable code block. Angle brackets are not converted to html entities. The enclosing<pre><code>tags are not produced. Workaround Options: (1) fence the html with~~~ markupor (2) write an html codeblock as raw html in the markdown file.
hoedown
- C Library. MacDown uses
hoedownC library when rendering markdown. - LaTeX guessing.
--mathoption alone can produce incorrect and unexpected output. The combination of--mathand--math-explicitdid produce predictable, reliable results in these tests.
pandoc
- Options. Pandoc has the largest set of enable/disable options. see PandocMarkdownOptions.md
<pre><code>Pandoc generates<pre class="markdown"><code>instead of<pre><code class="language-markdown">.
MacDown
- Hang. If MacDown Preference
Update preview automatically as you typeis enabled, then editing the md_evaluation.md document may cause MacDown to hang. Likely related to html render, not markdown highlighting. Maybe related to time to render a document which requires a significant amount of JavaScript to run including the remotely loaded MathJax libraries. see issue 807 ⇗. Workaround: disableUpdate preview automatically as you type.
Resources ▴
DaringFireball: markdown ⇗ Implementation: Perl
Discount markdown ⇗ Implementation: C
GitHub/hoedown: hoedown ⇗ Implementation: C
GitHub/fletcher: MultiMarkdown-5
GitHub/fletcher: MultiMarkdown-6
GitHub: pandoc ⇗ Implementation: Haskell
MultiMarkdown markdown Implementation: C
Pandoc User’s Guide ⇗
Github/github: cmark ⇗ aka cmark-cfm
CommonMark: home ⇗