Skip to content

Commit

Permalink
Modernize the look and feel and remove Docbook
Browse files Browse the repository at this point in the history
* Upgrade to latest `sciidoctor-gradle-plugin` and `asciidoctorj-pdf`
* Remove `Authors:` and move `version` before Copyright in the `index.adoc`
  • Loading branch information
Jay Bryant authored and artembilan committed Jan 25, 2019
1 parent c7f6148 commit 454e30e
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 762 deletions.
90 changes: 59 additions & 31 deletions build.gradle
Expand Up @@ -4,8 +4,8 @@ buildscript {
maven { url 'https://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'io.spring.gradle:docbook-reference-plugin:0.3.1'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.8'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.9.2'
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
classpath 'me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
Expand All @@ -22,8 +22,6 @@ apply plugin: 'base'
apply plugin: 'project-report'
apply plugin: 'idea'

def docsDir = 'src/reference/asciidoc'

ext {
isTravisBuild = System.getenv().get("TRAVIS") == 'true'
linkHomepage = 'https://projects.spring.io/spring-amqp'
Expand All @@ -32,6 +30,7 @@ ext {
linkScmUrl = 'https://github.com/spring-projects/spring-amqp'
linkScmConnection = 'git://github.com/spring-projects/spring-amqp.git'
linkScmDevConnection = 'git@github.com:spring-projects/spring-amqp.git'
docResourcesVersion = '0.1.0.RELEASE'
}

allprojects {
Expand Down Expand Up @@ -329,40 +328,64 @@ project('spring-rabbit-test') {

}

configurations {
docs
}

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

task prepareAsciidocBuild(type: Sync) {
dependsOn configurations.docs
from {
configurations.docs.collect { zipTree(it) }
}
from 'src/reference/asciidoc/'
into "$buildDir/asciidoc"
}

apply plugin: 'org.asciidoctor.convert'

asciidoctor {
sourceDir = file("$docsDir")
task reference(type: org.asciidoctor.gradle.AsciidoctorTask) {
backends = ['pdf']
sourceDir "$buildDir/asciidoc"
sources {
include 'index.adoc'
}
backends = ['html5', 'docbook']
logDocuments = true
options = [
doctype: 'book',
]
attributes = [
docinfo: '',
toc2: '',
'compat-mode': '',
imagesdir: '',
stylesdir: "stylesheets/",
stylesheet: 'golo.css',
'spring-amqp-version': "$version",
'source-highlighter': 'highlightjs'
]
}
options doctype: 'book', eruby: 'erubis'
attributes 'source-highlighter': 'coderay',
'icons': 'font',
"project-version=$project.version"
}

apply plugin: DocbookReferencePlugin
reference.dependsOn asciidoctor

reference {
sourceFileName = 'index.xml'
sourceDir = file("$buildDir/asciidoc/docbook")
pdfFilename = 'spring-amqp-reference.pdf'
expandPlaceholders = ''
asciidoctor {
sourceDir "$buildDir/asciidoc"
sources {
include 'index.adoc'
}
resources {
from(sourceDir) {
include 'images/*', 'css/**', 'js/**'
}
}
logDocuments = true
backends = ['html5']
options doctype: 'book', eruby: 'erubis'
attributes 'docinfo': 'shared',
stylesdir: "css/",
stylesheet: 'spring.css',
'linkcss': true,
'icons': 'font',
'source-highlighter=highlight.js',
'highlightjsdir=js/highlight',
'highlightjs-theme=atom-one-dark-reasonable',
"project-version=$project.version"
}

reference.dependsOn asciidoctor
asciidoctor.dependsOn prepareAsciidocBuild

sonarqube {
properties {
Expand Down Expand Up @@ -426,7 +449,7 @@ task schemaZip(type: Zip) {
}
}

task docsZip(type: Zip) {
task docsZip(type: Zip, dependsOn: [reference]) {
group = 'Distribution'
classifier = 'docs'
description = "Builds -${classifier} archive containing api and reference " +
Expand All @@ -440,7 +463,12 @@ task docsZip(type: Zip) {
into 'api'
}

from (reference) {
from ('build/asciidoc/html5') {
into 'reference'
}

from ('build/asciidoc/pdf') {
include 'index.pdf'
into 'reference'
}
}
Expand Down
52 changes: 0 additions & 52 deletions src/reference/asciidoc/index-docinfo.xml

This file was deleted.

14 changes: 12 additions & 2 deletions src/reference/asciidoc/index.adoc
@@ -1,8 +1,18 @@
[[spring-amqp-reference]]

= Spring AMQP
:toc: left
:toclevels: 4
:numbered:
:icons: font
:hide-uri-scheme:
Mark Pollack; Mark Fisher; Oleg Zhurakousky; Dave Syer; Gary Russell; Gunnar Hillert; Artem Bilan; Stéphane Nicoll; Arnaud Cogoluègnes; Jay Bryant

*{project-version}*

(C) 2010 - 2019 by Pivotal Software, Inc.

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.

:toc:

== Preface

Expand Down

0 comments on commit 454e30e

Please sign in to comment.