Skip to content

Commit fd0b6ca

Browse files
committed
Migrate documentation to asciidoctor
This commit migrates to asciidoctor to ease writing documentation. Issues: SPR-10960
1 parent 50d3f71 commit fd0b6ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+37268
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ activemq-data/
2020
/build
2121
buildSrc/build
2222
/spring-*/build
23+
/src/asciidoc/build
2324
target/
2425

2526
# Eclipse artifacts, including WTP generated manifests

CONTRIBUTING-DOCUMENTATION.adoc

Lines changed: 28 additions & 0 deletions

build.gradle

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
}
55
dependencies {
66
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.4")
7-
classpath("org.springframework.build.gradle:docbook-reference-plugin:0.2.7")
7+
classpath("org.asciidoctor:asciidoctor-gradle-plugin:0.7.0")
88
}
99
}
1010

@@ -874,14 +874,28 @@ project("spring-aspects") {
874874
configure(rootProject) {
875875
description = "Spring Framework"
876876

877-
apply plugin: "docbook-reference"
877+
apply plugin: "asciidoctor"
878878
apply plugin: "groovy"
879+
879880
// apply plugin: "detect-split-packages"
880881
apply from: "${gradleScriptDir}/jdiff.gradle"
881882

882-
reference {
883-
sourceDir = file("src/reference/docbook")
884-
pdfFilename = "spring-framework-reference.pdf"
883+
asciidoctor {
884+
options = [
885+
eruby: 'erubis',
886+
attributes: [
887+
copycss : '',
888+
icons : 'font',
889+
'source-highlighter': 'prettify',
890+
sectanchors : '',
891+
toc2: '',
892+
idprefix: '',
893+
idseparator: '-',
894+
doctype: 'book',
895+
'spring-version' : project.version,
896+
revnumber : project.version
897+
]
898+
]
885899
}
886900

887901
// TODO: DetectSplitPackagesPlugin fails in line 154 due to method not found on java.io.File.
@@ -953,7 +967,7 @@ configure(rootProject) {
953967
}
954968
}
955969

956-
task docsZip(type: Zip) {
970+
task docsZip(type: Zip, dependsOn: 'asciidoctor') {
957971
group = "Distribution"
958972
baseName = "spring-framework"
959973
classifier = "docs"
@@ -968,8 +982,10 @@ configure(rootProject) {
968982
into "javadoc-api"
969983
}
970984

971-
from (reference) {
972-
into "spring-framework-reference"
985+
from (asciidoctor.outputDir) {
986+
exclude "build"
987+
exclude "Guardfile"
988+
into "spring-framework-reference/htmlsingle"
973989
}
974990
}
975991

src/asciidoc/Guardfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require 'asciidoctor'
2+
require 'erb'
3+
require 'fileutils'
4+
5+
FileUtils.mkdir_p('build')
6+
FileUtils.cp_r('images','build')
7+
8+
guard 'shell' do
9+
watch(/^.*\.adoc$/) {|m|
10+
Asciidoctor.render_file(m[0], :to_dir => "build", :safe => Asciidoctor::SafeMode::UNSAFE, :attributes=> {'idprefix' => '', 'idseparator' => '-', 'copycss' => '', 'icons' => 'font', 'source-highlighter' => 'prettify', 'sectanchors' => '', 'doctype' => 'book','toc2' => '', 'spring-version' => '4.0.0.BUILD-SNAPSHOT', 'revnumber' => '4.0.0.BUILD-SNAPSHOT' })
11+
}
12+
end
13+
14+
guard 'livereload' do
15+
watch(%r{build/.+\.(css|js|html)$})
16+
end

0 commit comments

Comments
 (0)