Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize docs #506

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 82 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@ buildscript {
}
dependencies {
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
classpath('org.asciidoctor:asciidoctor-gradle-plugin:1.5.1')
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
classpath("io.spring.gradle:spring-io-plugin:0.0.6.RELEASE")
}
}

plugins {
id "org.sonarqube" version "2.1-rc1"
id 'org.asciidoctor.convert' version '1.5.10'
}

repositories {
maven { url 'https://repo.spring.io/plugins-release' }
mavenCentral()
}

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

ext.docResourcesVersion = '0.2.1.RELEASE'
ext.GRADLE_SCRIPT_DIR = "${rootProject.projectDir}/gradle"
ext.JAVA_MODULE_SCRIPT = "${GRADLE_SCRIPT_DIR}/java-module.gradle"
ext.MAVEN_DEPLOYMENT_SCRIPT = "${GRADLE_SCRIPT_DIR}/maven-deployment.gradle"
Expand Down Expand Up @@ -69,6 +76,30 @@ configure(subprojects - coreModules) {
tasks.findByPath("artifactoryPublish")?.enabled = false
}

asciidoctorj {
version = '1.5.5'
}

configurations {
docs
}

dependencies {
docs "io.spring.docresources:spring-doc-resources:${docResourcesVersion}@zip"
}

task prepareAsciidocBuild(type: Sync) {
dependsOn configurations.docs
// copy doc resources
from {
configurations.docs.collect { zipTree(it) }
}
// and doc sources
from "src/docs/asciidoc/"
// to a build directory of your choice
into "$buildDir/asciidoc/assemble"
}

description = "Spring LDAP"

configurations.archives.artifacts.clear()
Expand All @@ -86,24 +117,52 @@ sonarqube {
}
}

task('makePDF', type: org.asciidoctor.gradle.AsciidoctorTask){
dependsOn prepareAsciidocBuild
backends 'pdf'
sourceDir "$buildDir/asciidoc/assemble"
outputDir = new File("$buildDir/docs")
sources {
include 'index.adoc'
}
options doctype: 'book', eruby: 'erubis'
logDocuments = true
attributes 'docinfo': 'shared',
'icons': 'font',
'sectanchors': '',
'source-highlighter' : 'coderay',
'spring-ldap-version' : project.version,
revnumber : project.version
}

asciidoctor {
outputDir = new File("$buildDir/docs")
options = [
eruby: 'erubis',
attributes: [
copycss : '',
icons : 'font',
'source-highlighter': 'prettify',
sectanchors : '',
toc2: '',
idprefix: '',
idseparator: '-',
doctype: 'book',
numbered: '',
'spring-ldap-version' : project.version,
revnumber : project.version
]
]
dependsOn makePDF
backends 'html5'
sourceDir "$buildDir/asciidoc/assemble"
outputDir = new File("$buildDir/docs")
sources {
include 'index.adoc'
}
resources {
from(sourceDir) {
include 'images/*', 'css/**', 'js/**'
}
}
options doctype: 'book', eruby: 'erubis'
logDocuments = true
attributes 'docinfo': 'shared',
// use provided stylesheet
stylesdir: "css/",
stylesheet: 'spring.css',
'linkcss': true,
'icons': 'font',
'sectanchors': '',
// use provided highlighter
'source-highlighter=highlight.js',
'highlightjsdir=js/highlight',
'highlightjs-theme=github',
'spring-ldap-version' : project.version,
revnumber : project.version
}

task api(type: Javadoc) {
Expand Down Expand Up @@ -141,6 +200,11 @@ task docsZip(type: Zip, dependsOn: asciidoctor) {

from (new File(asciidoctor.outputDir, "html5")) {
include "*.html"
include 'images/*', 'css/**', 'js/**'
into "reference"
}
from (new File(asciidoctor.outputDir, "pdf")) {
include "*.pdf"
into "reference"
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
= Spring LDAP Reference
Mattias Hellborg Arthursson; Ulrik Sandberg; Eric Dalquist; Keith Barlow; Rob Winch
:toc: left
:toc-levels: 4
Mattias Hellborg Arthursson; Ulrik Sandberg; Eric Dalquist; Keith Barlow; Rob Winch; Jay Bryant

Spring LDAP makes it easier to build Spring-based applications that use the Lightweight Directory Access Protocol.

Expand Down