DannyBen / madness

Instant Markdown Server
https://madness.dannyb.co
MIT License
125 stars 17 forks source link

Add pandoc as an alternative renderer #179

Closed DannyBen closed 5 months ago

DannyBen commented 5 months ago

Due to the fact that all semi-native Ruby libraries for markdown generation have issues and long-standing bugs, this PR adds pandoc as an alternative rendering engine. The default is still going to be Redcarpet for the time being, since pandoc requires an external installation, which is less convenient.

To use pandoc as the renderer, add this to .madness.yml:

# ./madness.yml
renderer: pandoc

Notable advantages of using pandoc:

  1. Headers that contains diacritics have their ids (for Table of Contents links) generated correctly
  2. Nested lists (3 or more levels deep) are generated correctly

Notable disadvantages of using pandoc:

  1. Requires the command pandoc to be installed (usually it is as simple as installing it with your package manager)
  2. Does not handle some less common text decorations (like ==highlight==).