Grain 0.6.5 Revision Notes

Updated the Asciidoctor component to read custom document processing attributes from the site configuration. Grain renders .adoc and .asciidoctor files with the help of the latest Asciidoctor Ruby gem, the Asciidoctor.convert method is used to convert the files to HTML5:

1
Asciidoctor.convert(source, :safe => 0, :attributes => attributes)

As sometimes it is very convenient to provide custom attributes for the document conversion, in this revision, we added the asciidoc.opts property. The following example demonstrates how it can be used to specify the syntax highlighter for the asciidoctor files:

1
2
3
4
5
 features {
     asciidoc {
         opts = ['source-highlighter': 'coderay']
     }
 }

Grain reads the asciidoc.opts property value, converts it to the Ruby Hash and passes to the convert method:

1
Asciidoctor.convert(source, :safe => 0, :attributes => { "source-highlighter" => "coderay" })

Comments