Embed a CodeRay or Pygments Stylesheet

Asciidoctor can embed the stylesheet for the CodeRay or Pygments syntax highlighters.

Requirements

First, make sure the appropriate library is installed on your system. See Rouge, CodeRay, or Pygments for installation instructions. Next, set the source-highlighter attribute and assign it the value that corresponds to the library you installed.

CodeRay

If the source-highlighter attribute is coderay and the coderay-css attribute is class, the CodeRay stylesheet is:

  • embedded by default

  • copied to the file asciidoctor-coderay.css inside the stylesdir folder within the output directory if linkcss is set

Pygments

If the source-highlighter attribute is pygments and the pygments-css attribute is class, the Pygments stylesheet is:

  • embedded by default

  • copied to the file asciidoctor-pygments.css inside the stylesdir folder within the output directory if linkcss is set