Skip to content

A collection of example projects that demonstrates how to use the Asciidoctor Ant Task

License

Notifications You must be signed in to change notification settings

binout/asciidoctor-ant-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asciidoctor-ant-examples

A collection of example projects that demonstrates how to use the Asciidoctor Ant Task

Installation

    <target name="asciidoctor-def">
        <get src="${maven.central}/org/asciidoctor/asciidoctor-ant/${asciidoctor-version}/asciidoctor-ant-${asciidoctor-version}.jar"
             dest="lib/asciidoctor-ant-${asciidoctor-version}.jar" usetimestamp="true"/>
        <taskdef uri="antlib:org.asciidoctor.ant" resource="org/asciidoctor/ant/antlib.xml" classpath="lib/asciidoctor-ant-${asciidoctor-version}.jar"/>
    </target>

Examples

docbook

    <target name="docbook" depends="asciidoctor-def,clean">
        <asciidoctor:convert sourceDirectory="src/asciidoc" outputDirectory="target"/>
    </target>

html5

    <target name="html5" depends="asciidoctor-def,clean">
        <asciidoctor:convert sourceDirectory="src/asciidoc" outputDirectory="target" backend="html5"/>
    </target>

attribute

    <target name="attribute" depends="asciidoctor-def,clean">
        <asciidoctor:convert sourceDirectory="src/asciidoc" outputDirectory="target" backend="html5">
            <attribute key="title" value="Asciidoc Ant"/>
            <attribute key="toc" value="left"/>
        </asciidoctor:convert>
    </target>

resource

    <target name="resource" depends="asciidoctor-def,clean">
        <asciidoctor:convert sourceDirectory="src/asciidoc" outputDirectory="target">
            <resource dir="src/asciidoc/images" includes="*.jpg"/>
        </asciidoctor:convert>
    </target>

extension

    <target name="twitter" depends="asciidoctor-def,clean">
        <asciidoctor:convert sourceDirectory="${basedir}/src/asciidoc" sourceDocumentName="twitter.adoc" outputDirectory="${basedir}/target" backend="html5">
            <inlineMacroProcessor blockName="twitter" className="com.github.binout.asciidoctor.extensions.TwitterMacro"/>
        </asciidoctor:convert>
    </target>

diagram

    <target name="diagram" depends="asciidoctor-def,clean">
        <asciidoctor:convert sourceDirectory="${basedir}/src/asciidoc" sourceDocumentName="diagram.adoc" outputDirectory="${basedir}/target" backend="html5" gemPaths="${basedir}/gems-provided">
            <require name="asciidoctor-diagram"/>
            <resource dir="${basedir}/src/asciidoc/images" includes="*.png"/>
        </asciidoctor:convert>
    </target>

About

A collection of example projects that demonstrates how to use the Asciidoctor Ant Task

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages