Example Manual

Doc Writer
doc.writer@example.org
version 1.0.0-SNAPSHOT, 2014-09-09

Introduction

  • This is a user manual for an example project.
  • This project does something.
  • We just haven’t decided what that is yet.

Source Code

Java code from project
public boolean contains(String haystack, String needle) {
    return haystack.contains(needle);
}

This page was built by the following command:

$ ./gradlew asciidoctor

Including documents from subdir

include::subdir/_b.adoc[]

content from src/docs/asciidoc/subdir/_b.adoc.

include::_c.adoc[]

content from src/docs/asciidoc/subdir/_c.adoc.

Images

sunset

Attributes

Built-in
asciidoctor-version

1.5.4

safe-mode-name

unsafe

docdir

/home/travis/build/rwinch/asciidoctor-gradle-examples/asciidoc-to-deckjs-example/src/docs/asciidoc

docfile

/home/travis/build/rwinch/asciidoctor-gradle-examples/asciidoc-to-deckjs-example/src/docs/asciidoc/example-manual.adoc

imagesdir

./images

Custom
project-version

1.0.0-SNAPSHOT

sourcedir

/home/travis/build/rwinch/asciidoctor-gradle-examples/asciidoc-to-deckjs-example/src/main/java

endpoint-url

http://example.org

build.gradle

buildscript {
  dependencies {
        classpath 'org.ysb33r.gradle:vfs-gradle-plugin:1.0-beta1'
        classpath 'commons-httpclient:commons-httpclient:3.1'
  }
}

plugins {
  id 'org.asciidoctor.convert' version '1.5.3'
  id 'com.github.jruby-gradle.base' version '1.2.1'
}

apply plugin: 'com.github.jruby-gradle.base'
apply plugin: 'org.ysb33r.vfs'
apply plugin: 'java'
apply plugin: 'org.asciidoctor.convert'

version = '1.0.0-SNAPSHOT'

ext {
        deckjsVersion = 'master'
        asciidoctorBackendVersion = 'master'
        downloadDir = new File(buildDir,'download')
        templateDir = new File(downloadDir,'templates')
        deckjsDir   = new File(downloadDir,'deck.js')
}

repositories {
    jcenter()
}

dependencies {
    gems 'rubygems:haml:4.0.6'
}

task download << {
        mkdir downloadDir
        vfs {
                cp "zip:https://github.com/asciidoctor/asciidoctor-deck.js/archive/${asciidoctorBackendVersion}.zip!asciidoctor-deck.js-${asciidoctorBackendVersion}/templates",
                                templateDir, recursive:true, overwrite:true
                cp "zip:https://github.com/imakewebthings/deck.js/archive/${deckjsVersion}.zip!deck.js-${deckjsVersion}",
                                deckjsDir, recursive:true, overwrite:true
        }
}

download {
        description "Download extra deckjs resources"
        outputs.dir templateDir
        outputs.dir deckjsDir
}

asciidoctorj {
    version = '1.5.4'
}

asciidoctor {
    dependsOn jrubyPrepare

        sources {
                include 'example-manual.adoc'
        }

        resources {
                from (sourceDir) {
                        include 'images/**'
                }
                from (downloadDir) {
                        include 'deck.js/**'
                }
        }

        backends    'html5'

        attributes        'build-gradle': file('build.gradle'),
                                'sourcedir': project.sourceSets.main.java.srcDirs[0],
                                'endpoint-url': 'http://example.org',
                                'source-highlighter' : 'coderay',
                                'imagesdir':'./images',
                                'toc':'left',
                                'icons': 'font',
                                'setanchors':'true',
                                'idprefix':'',
                                'idseparator':'-',
                                'docinfo1':'true'

        options template_dirs : [new File(templateDir,'haml').absolutePath ]

        dependsOn download
}