Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandoc: What are the available syntax highlighters?

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?

like image 848
user1002119 Avatar asked Jun 16 '15 23:06

user1002119


People also ask

What is syntax highlighting style?

Syntax highlighting is a feature of text editors that are used for programming, scripting, or markup languages, such as HTML. The feature displays text, especially source code, in different colours and fonts according to the category of terms.

Can Pandoc convert HTML to markdown?

Pandoc can convert between numerous markup and word processing formats, including, but not limited to, various flavors of Markdown, HTML, LaTeX and Word docx.


1 Answers

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 

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 
like image 75
Clément Avatar answered Nov 12 '22 02:11

Clément