Skip to content

Commit 6f2004f

Browse files
author
Phillip Webb
committed
Restore multi-page and PDF reference documentation
Generate docbook xml from the asciidoc reference guide and use the docbook-reference-plugin to generate HTML (single and multi-page) and PDF documentation. Issue: SPR-11096
1 parent e54fc7b commit 6f2004f

File tree

3 files changed

+56
-47
lines changed

3 files changed

+56
-47
lines changed

build.gradle

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ buildscript {
55
dependencies {
66
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.5")
77
classpath("org.asciidoctor:asciidoctor-gradle-plugin:0.7.0")
8+
classpath("org.springframework.build.gradle:docbook-reference-plugin:0.2.8")
89
}
910
}
1011

@@ -857,29 +858,36 @@ configure(rootProject) {
857858
description = "Spring Framework"
858859

859860
apply plugin: "asciidoctor"
861+
apply plugin: "docbook-reference"
860862
apply plugin: "groovy"
861863

862864
// apply plugin: "detect-split-packages"
863865
apply from: "${gradleScriptDir}/jdiff.gradle"
864866

865867
asciidoctor {
868+
baseDir = project.file('src/asciidoc')
869+
backend = 'docbook5'
866870
options = [
867-
eruby: 'erubis',
868-
attributes: [
869-
copycss : '',
870-
icons : 'font',
871-
'source-highlighter': 'prettify',
872-
sectanchors : '',
873-
toc2: '',
874-
idprefix: '',
875-
idseparator: '-',
876-
doctype: 'book',
877-
'spring-version' : project.version,
878-
revnumber : project.version
879-
]
871+
eruby: 'erubis',
872+
attributes: [
873+
doctype: 'book',
874+
'spring-version' : project.version,
875+
revnumber : project.version,
876+
docinfo : ""
877+
]
880878
]
881879
}
882880

881+
reference {
882+
sourceDir = asciidoctor.outputDir
883+
pdfFilename = "spring-framework-reference.pdf"
884+
expandPlaceholders = ""
885+
}
886+
887+
afterEvaluate {
888+
tasks.findAll { it.name.startsWith("reference") }.each{ it.dependsOn.add("asciidoctor") }
889+
}
890+
883891
// TODO: DetectSplitPackagesPlugin fails in line 154 due to method not found on java.io.File.
884892
// TODO: Possibly related to user rights or OS differences; passes on local Windows machine.
885893
// detectSplitPackages {
@@ -949,7 +957,7 @@ configure(rootProject) {
949957
}
950958
}
951959

952-
task docsZip(type: Zip, dependsOn: 'asciidoctor') {
960+
task docsZip(type: Zip, dependsOn: 'reference') {
953961
group = "Distribution"
954962
baseName = "spring-framework"
955963
classifier = "docs"
@@ -964,10 +972,8 @@ configure(rootProject) {
964972
into "javadoc-api"
965973
}
966974

967-
from (asciidoctor.outputDir) {
968-
exclude "build"
969-
exclude "Guardfile"
970-
into "spring-framework-reference/htmlsingle"
975+
from (reference) {
976+
into "spring-framework-reference"
971977
}
972978
}
973979

src/asciidoc/index-docinfo.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<productname>Spring Framework</productname>
2+
<releaseinfo>{revnumber}</releaseinfo>
3+
<copyright>
4+
<year>2004-2013</year>
5+
</copyright>
6+
<legalnotice>
7+
<para>Copies of this document may be made for your own use and for distribution to
8+
others, provided that you do not charge any fee for such copies and further provided
9+
that each copy contains this Copyright Notice, whether distributed in print or
10+
electronically.</para>
11+
</legalnotice>

src/asciidoc/index.adoc

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
11
= Spring Framework Reference Documentation
2-
:author: Rod Johnson; Juergen Hoeller; Keith Donald; Colin Sampaleanu; Rob Harrop; +
3-
Thomas Risberg; Alef Arendsen; Darren Davison; Dmitriy Kopylenko; +
4-
Mark Pollack; Thierry Templier; Erwin Vervaet; Portia Tung; Ben Hale; +
5-
Adrian Colyer; John Lewis; Costin Leau; Mark Fisher; Sam Brannen; +
6-
Ramnivas Laddad; Arjen Poutsma; Chris Beams; Tareq Abedrabbo; Andy Clement; +
7-
Dave Syer; Oliver Gierke; Rossen Stoyanchev; Phillip Webb; Rob Winch
8-
:doctype: book
9-
10-
Core support for dependency injection, transaction management, web applications, data
11-
access, messaging, testing and more.
12-
13-
__Copies of this document may be made for your own use and for distribution to others,
14-
provided that you do not charge any fee for such copies and further provided that each
15-
copy contains this Copyright Notice, whether distributed in print or electronically.__
16-
17-
18-
19-
20-
2+
Rod Johnson; Juergen Hoeller; Keith Donald; Colin Sampaleanu; Rob Harrop; Thomas Risberg; Alef Arendsen; Darren Davison; Dmitriy Kopylenko; Mark Pollack; Thierry Templier; Erwin Vervaet; Portia Tung; Ben Hale; Adrian Colyer; John Lewis; Costin Leau; Mark Fisher; Sam Brannen; Ramnivas Laddad; Arjen Poutsma; Chris Beams; Tareq Abedrabbo; Andy Clement; Dave Syer; Oliver Gierke; Rossen Stoyanchev; Phillip Webb; Rob Winch
213

224

235

246

257

268
[[spring-introduction]]
279
= Overview of Spring Framework
10+
11+
[partintro]
12+
--
2813
The Spring Framework is a lightweight solution and a potential one-stop-shop for
2914
building your enterprise-ready applications. However, Spring is modular, allowing you to
3015
use only those parts that you need, without having to bring in the rest. You can use the
@@ -44,6 +29,7 @@ your code base.
4429
This document is a reference guide to Spring Framework features. If you have any
4530
requests, comments, or questions on this document, please post them on the user mailing
4631
list or on the support forums at http://forum.spring.io/[].
32+
--
4733

4834

4935

@@ -71,7 +57,6 @@ Examples of how you, as an application developer, can use the Spring platform ad
7157

7258

7359
[[overview-dependency-injection]]
74-
7560
=== Dependency Injection and Inversion of Control
7661

7762
[[background-ioc]]
@@ -339,7 +324,7 @@ there are some pros and cons between them. In general, pick one place or the oth
339324
your project; do not mix them. This is particularly important since EBR artifacts
340325
necessarily use a different naming convention than Maven Central artifacts.
341326

342-
[[TABLE-ID]]
327+
[[dependency-comparison-of-maven-central-and-ebr-tbl]]
343328
.Comparison of Maven Central and SpringSource EBR Repositories
344329
|===
345330
| Feature| Maven Central| EBR
@@ -1700,6 +1685,8 @@ support (next to the existing AspectJ 1.6 support).
17001685

17011686
[[spring-core]]
17021687
= Core Technologies
1688+
[partintro]
1689+
--
17031690
This part of the reference documentation covers all of those technologies that are
17041691
absolutely integral to the Spring Framework.
17051692

@@ -1730,7 +1717,7 @@ testing will hopefully convince you of this as well.
17301717
* <<aop>>
17311718
* <<aop-api>>
17321719
* <<testing>>
1733-
1720+
--
17341721

17351722

17361723

@@ -11825,7 +11812,7 @@ In addition to standard relational operators SpEL supports the
1182511812
'instanceof' and regular expression based 'matches' operator.
1182611813

1182711814
[source,java]
11828-
[subs="verbatim,quotes"]
11815+
[subs="none"]
1182911816
----
1183011817
// evaluates to false
1183111818
boolean falseValue = parser.parseExpression("'xyz' instanceof T(int)").getValue(Boolean.class);
@@ -21078,6 +21065,8 @@ Consult the following resources for more information about testing:
2107821065

2107921066
[[spring-data-tier]]
2108021067
= Data Access
21068+
[partintro]
21069+
--
2108121070
This part of the reference documentation is concerned with data access and the
2108221071
interaction between the data access layer and the business or service layer.
2108321072

@@ -21090,7 +21079,7 @@ that the Spring Framework integrates with.
2109021079
* <<jdbc>>
2109121080
* <<orm>>
2109221081
* <<oxm>>
21093-
21082+
--
2109421083

2109521084

2109621085

@@ -28189,7 +28178,8 @@ within Web services.
2818928178

2819028179
[[spring-web]]
2819128180
= The Web
28192-
28181+
[partintro]
28182+
--
2819328183
This part of the reference documentation covers the Spring Framework's support for the
2819428184
presentation tier (and specifically web-based presentation tiers).
2819528185

@@ -28204,7 +28194,7 @@ This section concludes with coverage of Spring's MVC <<portlet,portlet framework
2820428194
* <<view>>
2820528195
* <<web-integration>>
2820628196
* <<portlet>>
28207-
28197+
--
2820828198

2820928199

2821028200

@@ -37535,6 +37525,8 @@ Some older portals have been known to corrupt the definition of the
3753537525

3753637526
[[spring-integration]]
3753737527
= Integration
37528+
[partintro]
37529+
--
3753837530
This part of the reference documentation covers the Spring Framework's integration with
3753937531
a number of Java EE (and related) technologies.
3754037532

@@ -37547,7 +37539,7 @@ a number of Java EE (and related) technologies.
3754737539
* <<scheduling>>
3754837540
* <<dynamic-language>>
3754937541
* <<cache>>
37550-
37542+
--
3755137543

3755237544

3755337545

@@ -38511,7 +38503,7 @@ Invoking RESTful services in Java is typically done using a helper class such as
3851138503
Commons `HttpClient`. For common REST operations this approach is too low level as shown
3851238504
below.
3851338505

38514-
[source]
38506+
[source,java]
3851538507
[subs="verbatim,quotes"]
3851638508
----
3851738509
String uri = "http://example.com/hotels/1/bookings";
@@ -38534,7 +38526,7 @@ RestTemplate provides higher level methods that correspond to each of the six ma
3853438526
methods that make invoking many RESTful services a one-liner and enforce REST best
3853538527
practices.
3853638528

38537-
[[TABLE-ID]]
38529+
[[rest-overview-of-resttemplate-methods-tbl]]
3853838530
.Overview of RestTemplate methods
3853938531
[cols="1,3"]
3854038532
|===

0 commit comments

Comments
 (0)