plugins {
  id 'org.asciidoctor.jvm.gems' version '3.3.0'
  id 'org.asciidoctor.jvm.revealjs' version '3.3.0'
}

apply plugin: 'java'

version = '1.0.0-SNAPSHOT'

repositories {
    mavenCentral()
    jcenter()
    ruby {
        gems()
    }
}

revealjs {
    version = '3.1.0'

    templateGitHub {
        organisation = 'hakimel'
        repository = 'reveal.js'
        tag = '3.9.1'
    }
}

asciidoctorRevealJs {
    sourceDir file("src/docs/asciidoc")

    baseDirFollowsSourceFile()

    resources {
        from("${sourceDir}/images") {
            include '**'
            into 'images'
        }
    }

    attributes 'build-gradle': file('build.gradle'),
            'endpoint-url': 'http://example.org',
            'source-highlighter': 'coderay',
            'coderay-css': 'style',
            'imagesdir': './images',
            'toc': 'left',
            'icons': 'font',
            'setanchors': '',
            'idprefix': 'slide-',
            'idseparator': '-',
            'docinfo': 'shared',
            'revealjs_theme': 'black',
            'revealjs_transition': 'linear',
            'revealjs_history': 'true',
            'revealjs_slideNumber': 'true'
}

// alias
task asciidoctor(dependsOn: asciidoctorRevealJs)
