Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to enable syntax highlighting for ASCIIDoctor

📅 2015-Feb-19 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Syntax highlighting of Python code by ASCIIDoctor
Syntax highlighting of Python code by ASCIIDoctor

Adding source code to ASCIIDoc documents is easy, as described here. ASCIIDoctor can be used to easily convert them to HTML5 documents using the html5 backend (which is the default). However, the source code is not rendered with syntax highlighting.

To enable syntax highlighting:

$ gem install coderay
:source-highlighter: coderay

Tried with: CodeRay 1.1.0, ASCIIDoctor 1.5.2 and Ubuntu 14.04