Bullet point 18 of http://pandoc.org/demos.html#examples shows how to change the syntax highlighter used by giving an argument to --highlight-style
. For example:
pandoc code.text -s --highlight-style pygments -o example18a.html
pandoc code.text -s --highlight-style kate -o example18b.html
pandoc code.text -s --highlight-style monochrome -o example18c.html
pandoc code.text -s --highlight-style espresso -o example18d.html
pandoc code.text -s --highlight-style haddock -o example18e.html
pandoc code.text -s --highlight-style tango -o example18f.html
pandoc code.text -s --highlight-style zenburn -o example18g.html
I am wondering if these are the only color schemes available. If not, how can I load a different syntax highlighter? Can I define my own?
The Pandoc README says:
--highlight-style=STYLE|FILE
Specifies the coloring style to be used in highlighted source code. Options are
pygments
(the default),kate
,monochrome
,breezeDark
,espresso
,zenburn
,haddock
, andtango
. For more information on syntax highlighting in pandoc, see Syntax highlighting, below. See also--list-highlight-styles
.Instead of a STYLE name, a JSON file with extension
.theme
may be supplied. This will be parsed as a KDE syntax highlighting theme and (if valid) used as the highlighting style. To see a sample theme that can be modified,pandoc --print-default-data-file default.theme
.
The library skylighting (in older versions highlighting-kate) is used for the highlighting. If you don't like any of the provided color schemes, you can either:
.theme
file as mentioned above,<span>
tags are generated that you can style with your custom CSS, or$highlighting-macros$
part with your custom color definitions, as described in this issue.