No commit activity in last 3 years
No release in over 3 years
Rouge code highlighter support for Asciidoctor
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 1.16
~> 12.0
~> 3.6
~> 0.49.0
~> 0.14
~> 0.9

Runtime

< 2.1, >= 1.5.6
< 4, >= 2.2
 Project Readme

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.

NOTICE: Asciidoctor already supports for Rouge since version 2.0.0, so this extension is not needed anymore.

Installation

To install (or update to the latest version):

gem install asciidoctor-rouge

or to install the latest development version:

gem install asciidoctor-rouge --pre

Usage

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

Attributes

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

rouge-css

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.

rouge-theme

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.

rouge-style

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

License

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