Rouge code highlighter support for Asciidoctor
Branch: master
Clone or download
Latest commit f01387c Nov 11, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
spec Fix subs processing to comply with AD's built-in highlighters Oct 5, 2018
.editorconfig Prepare project structure Sep 18, 2017
.gitignore Prepare project structure Sep 18, 2017
.rubocop.yml CI: Test against multiple versions of asciidoctor gem Jan 23, 2018
.travis.yml CI: Test against asciidoctor 1.5.8 Nov 11, 2018
.yardopts Use Markdown instead of RDoc markup for YARD doc Jan 3, 2018
Gemfile CI: Test against multiple versions of asciidoctor gem Jan 23, 2018
LICENSE License: Bump year Sep 26, 2018
README.adoc Release version 0.4.0 Nov 11, 2018
Rakefile Prepare project structure Sep 18, 2017
asciidoctor-rouge.gemspec Gemspec: Use less strict version requirement for asciidoctor gem Nov 11, 2018


Asciidoctor Rouge

Build Status Test Coverage Codacy Code quality Gem Version Yard Docs

This project provides an Asciidoctor extension for highlighting source listing blocks using Rouge – a pure-ruby code highlighter that is compatible with pygments.

It supports all Asciidoctor features such as callouts, highlighting of specified lines (attribute highlight), passthroughs inside a code and all other substitutions.

This extension is highly customizable and modular.


To install (or update to the latest version):

gem install asciidoctor-rouge

or to install the latest development version:

gem install asciidoctor-rouge --pre


Assign rouge to the source-highlighter attribute in your document’s header or via command-line argument.

asciidoctor -r asciidoctor-rouge -a source-highlighter=rouge Example.adoc


You can further customize the source block output with additional Rouge attributes:


Controls what method is used for applying CSS to the tokens. Can be class (CSS classes) or style (inline styles). When class is used, Rouge styles for the specified theme are included in an HTML header. Default is class.


Sets the name of the Rouge colour theme to use. Look into lib/rouge/themes in the Rouge repository for a list of available themes. Default is github.


Alternative name for the rouge-theme for compatibility with asciidoctor-pdf (see #3).


This project is licensed under MIT License. For the full text of the license, see the LICENSE file.