Example Manual

Doc Writer

Introduction

  • This is a user manual for an example project.

  • This project does something.

  • We just haven’t decided what that is yet.

Speaker Notes

Press the s key to access speaker notes.

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

Blank screen

You can press b or . to blank your current screen.

Hit it again to bring it back.

Overview

Press the esc key to get an overview of your slides.

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

Press the down arrow key to see the next sub-slide.

Attributes Part 1

Built-in
asciidoctor-version

1.5.2

safe-mode-name

unsafe

docdir

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

docfile

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

imagesdir

./images

Attributes Part 2

Custom
project-version

1.0.0-SNAPSHOT

sourcedir

/home/travis/build/asciidoctor/asciidoctor-gradle-examples/asciidoc-to-revealjs-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.2'
  id 'com.github.jruby-gradle.base' version '0.1.5'
}

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 {
        revealjsVersion = '2.6.2'
        asciidoctorBackendVersion = 'master'
        downloadDir = new File(buildDir,'download')
        templateDir = new File(downloadDir,'templates')
        revealjsDir   = new File(downloadDir,'reveal.js')
}

repositories {
    jcenter()
}

dependencies {
    gems 'rubygems:slim:2.1.0'
    gems 'rubygems:thread_safe:0.3.4'
}

task download << {
        mkdir downloadDir
        vfs {
                cp "zip:https://github.com/asciidoctor/asciidoctor-reveal.js/archive/${asciidoctorBackendVersion}.zip!asciidoctor-reveal.js-${asciidoctorBackendVersion}",
                                templateDir, recursive:true, overwrite:true
                cp "zip:https://github.com/hakimel/reveal.js/archive/${revealjsVersion}.zip!reveal.js-${revealjsVersion}",
                revealjsDir, recursive:true, overwrite:true
        }
}

download {
        description "Download extra revealjs resources"
        outputs.dir templateDir
        outputs.dir revealjsDir
}

asciidoctor {

    dependsOn jrubyPrepareGems

        sources {
                include 'example-manual.adoc'
        }

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

        backends    'revealjs'

        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',
                                'revealjs_transition':'linear',
                                'revealjs_history':'true',
                                'revealjs_slideNumber':'true'

        options template_dirs : [new File(templateDir,'templates/slim').absolutePath ]

        dependsOn download
}