Saturday, January 10, 2015

How to use AsciiDoctor Gradle plugin

To use AsciiDoctor Gradle plugin,

add the following configuration to build.gradle:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.0'
    }
}

apply plugin: 'org.asciidoctor.gradle.asciidoctor'

and put your AsciiDoctor files into the src/asciidoc directory.

Run the 'asciidoctor' task.

Then you can find your output files in the build/asciidoc directory.

It seems that the plugin doesn't support an 'include' directive with a remote file yet.

To use an 'include' directive with a remote file,

you should add the following configuration to build.gradle.

asciidoctor {
    options = [
        attributes: [
            'allow-uri-read': ''
        ]
    ]
}

References:
http://asciidoctor.org/docs/asciidoctor-gradle-plugin/
https://github.com/asciidoctor/asciidoctor-gradle-plugin
https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/146
http://asciidoctor.org/docs/user-manual/#include-content-from-a-uri
http://asciidoctor.org/docs/user-manual/#running-asciidoctor-securely

No comments:

Post a Comment