Pandoc: What are the available syntax highlighters?

Since pandoc 2.0.5, you can also use --print-highlight-style to output a theme file and edit it.

To me, the best way to use this option is to

  1. Pick a pleasant available style

  2. Output its theme file

  3. Edit the theme file

  4. Use it!

1. Available Styles

Pick your style, among the one already existing:

breezedark

monochrome

kate

zenburn

espresso

haddock

tango

2. Output its theme file

Once you decided which style was the closest to your needs, you can output its theme file, using (for instance for pygments, the default style):

pandoc --print-highlight-style pygments

so that you can store this style in a file, using, e.g.,

pandoc --print-highlight-style pygments > my_style.theme

With some shells, especially on Windows, using redirected output can lead to encoding problems. If that happens, use this instead:

pandoc -o my_style.theme --print-highlight-style pygments

3. Edit the file

Using the Skylighting JSON Themes guide, edit the file according to your need / taste.

4. Use the file

In the right folder, just use

pandoc my_file.md --highlight-style my_style.theme -o doc.html

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)