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
-
Pick a pleasant available style
-
Output its
theme
file -
Edit the
theme
file -
Use it!
1. Available Styles
Pick your style, among the one already existing:
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