Skip to content

A comparative evalution of open source CLI Markdown processors: discount `markdown`, `hoedown`, `multimarkdown` and `pandoc`.

License

Notifications You must be signed in to change notification settings

marc-medley/004.55_Markdown-CLI-Evaluation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A comparative evalution of open source CLI Markdown processors: discount markdown, hoedown, multimarkdown and pandoc.

View the markdown test page at md_evaluation/md_evaluation.md.

Contents

ObjectivesProcessObservationsResources

Objectives

  1. Markdown Syntax. Find, to the extent possible, a common set of markdown syntax including certain extensions.
  2. CLI Settings. Find settings which produce the most similar markdown output.
  3. Extension Support. Evaluate extension support for footnotes, piped tables, fenced code, and LaTeX math.

Process

  1. Install 'multimarkdown' (which installs as markdown), 'hoedown', and 'pandoc' as command line tools.

    • Uninstall 'multimarkdown' (brew uninstall multimarkdown) and install 'discount' (which installs as markdown) to run tests for discount.
  2. Review/Edit source markdown file "md_evaluation.md".

  3. Review "test.sh". Edit options as needed. Run ./test.sh.

  4. Compare output. The a and b versions allow comparison what output changed for some settings change for the same CLI tool. The txt and html allows for comparison of raw output and how the output renders in a browser.

Note: Discount and MultiMarkdown have install conflicting execution binaries named markdown. Thus, Discount markdown and MultiMarkdown markdown are mutually exclusive brew installs. However, Discount markdown can be manually installed somewhere not on $PATH and scripted with /FULL/PATH/TO/markdown.

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 \(, \[ single escape 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 markdown fenced html with ∼∼∼ html does 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 ∼∼∼ markup or (2) write an html codeblock as raw html in the markdown file.

hoedown

  • C Library. MacDown uses hoedown C library when rendering markdown.
  • LaTeX guessing. --math option alone can produce incorrect and unexpected output. The combination of --math and --math-explicit did produce predictable, reliable results in these tests.

multimarkdown

  • C Library

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">.

Resources

CommonMark

Note: CommonMark Spec ⇗ does not mention any support for LaTeX math.

MultiMarkdown

About

A comparative evalution of open source CLI Markdown processors: discount `markdown`, `hoedown`, `multimarkdown` and `pandoc`.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published