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:
- Install the CodeRay gem:
$ gem install coderay
- Set CodeRay as the syntax highlighter, by adding this attribute at the top of your ASCIIDoc document:
Tried with: CodeRay 1.1.0, ASCIIDoctor 1.5.2 and Ubuntu 14.04