Skip to content

Commit 8c768e4

Browse files
committed
Use Spring Doc Resources for reference docs
This commit removes the custom static resources for the reference documentation and instead uses the new Spring Doc Resources project https://github.com/spring-io/spring-doc-resources The asciidoctor theme is now shared between Spring projects and integrated in the project build.
1 parent df13e4d commit 8c768e4

File tree

10 files changed

+30
-927
lines changed

10 files changed

+30
-927
lines changed

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ configure(allprojects) { project ->
148148
}
149149

150150
repositories {
151+
mavenLocal()
151152
maven { url "https://repo.spring.io/libs-release" }
152153
}
153154

gradle/docs.gradle

+29-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -79,13 +79,32 @@ dokka {
7979
}
8080
}
8181

82+
configurations {
83+
docs
84+
}
85+
86+
dependencies {
87+
// for documentation resources
88+
docs "io.spring.docresources:spring-doc-resources:0.1.0.RELEASE@zip"
89+
}
90+
91+
task extractDocResources(type: Sync) {
92+
dependsOn configurations.docs
93+
from "src/docs/asciidoc/"
94+
from {
95+
configurations.docs.collect { zipTree(it) }
96+
}
97+
into "$buildDir/asciidoc/build"
98+
}
99+
82100
asciidoctor {
101+
sourceDir "$buildDir/asciidoc/build"
83102
sources {
84103
include '*.adoc'
85104
}
86105
resources {
87106
from(sourceDir) {
88-
include 'images/*', 'stylesheets/*', 'tocbot-3.0.2/*'
107+
include 'images/*', 'css/**', 'js/**'
89108
}
90109
}
91110
logDocuments = true
@@ -98,17 +117,21 @@ asciidoctor {
98117
attributes 'icons': 'font',
99118
'idprefix': '',
100119
'idseparator': '-',
101-
docinfo: '',
120+
docinfo: 'shared',
102121
revnumber: project.version,
103122
sectanchors: '',
104123
sectnums: '',
105-
'source-highlighter': 'coderay@', // TODO switch to 'rouge' once supported by the html5 backend
106-
stylesdir: 'stylesheets/',
107-
stylesheet: 'main.css',
124+
'source-highlighter=highlight.js',
125+
'highlightjsdir=js/highlight',
126+
'highlightjs-theme=atom-one-dark-reasonable',
127+
stylesdir: "css/",
128+
stylesheet: 'spring.css',
108129
'spring-version': project.version
109130

110131
}
111132

133+
asciidoctor.dependsOn extractDocResources
134+
112135
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'dokka']) {
113136
group = "Distribution"
114137
baseName = "spring-framework"

src/docs/asciidoc/Guardfile

-19
This file was deleted.

src/docs/asciidoc/docinfo-footer.html

-46
This file was deleted.

0 commit comments

Comments
 (0)