Use spring-asciidoctor-backends for documentation generation
Resolves #3865
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
c506a49988
commit
f89aa20861
2
pom.xml
2
pom.xml
@@ -144,7 +144,7 @@
|
||||
<maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
|
||||
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
|
||||
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
|
||||
<spring-javaformat-maven-plugin.version>0.0.32</spring-javaformat-maven-plugin.version>
|
||||
<spring-javaformat-maven-plugin.version>0.0.34</spring-javaformat-maven-plugin.version>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -10,15 +10,6 @@
|
||||
<name>Spring Batch Docs</name>
|
||||
<description>Spring Batch documentation</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.spring.docresources</groupId>
|
||||
<artifactId>spring-doc-resources</artifactId>
|
||||
<version>${spring-doc-resources.version}</version>
|
||||
<type>zip</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
@@ -30,36 +21,10 @@
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>${maven-resources-plugin.version}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>${maven-dependency-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-resources</id>
|
||||
<phase>pre-site</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>io.spring.docresources</includeGroupIds>
|
||||
<includeArtifactIds>spring-doc-resources</includeArtifactIds>
|
||||
<includeTypes>zip</includeTypes>
|
||||
<excludeTransitive>true</excludeTransitive>
|
||||
<outputDirectory>${project.build.directory}/asciidoc</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId>
|
||||
<version>${asciidoctor-maven-plugin.version}</version>
|
||||
<version>2.1.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
@@ -71,6 +36,11 @@
|
||||
<artifactId>asciidoctorj-epub3</artifactId>
|
||||
<version>${asciidoctorj-epub.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.spring.asciidoctor.backends</groupId>
|
||||
<artifactId>spring-asciidoctor-backends</artifactId>
|
||||
<version>0.0.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<sourceDirectory>${project.basedir}/src/main/asciidoc</sourceDirectory>
|
||||
@@ -84,13 +54,13 @@
|
||||
<goal>process-asciidoc</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<backend>html5</backend>
|
||||
<backend>spring-html</backend>
|
||||
<doctype>book</doctype>
|
||||
<attributes>
|
||||
<docinfodir>${project.build.directory}/asciidoc</docinfodir>
|
||||
<docinfo>shared</docinfo>
|
||||
<stylesdir>css/</stylesdir>
|
||||
<stylesheet>spring.css</stylesheet>
|
||||
<stylesheet>site.css</stylesheet>
|
||||
<linkcss>true</linkcss>
|
||||
<icons>font</icons>
|
||||
<sectanchors />
|
||||
@@ -215,13 +185,13 @@
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-releases</id>
|
||||
<name>Spring Releases</name>
|
||||
<url>https://repo.spring.io/libs-release</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<id>spring-release</id>
|
||||
<name>Spring Releases</name>
|
||||
<url>https://repo.spring.io/release</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<includes>
|
||||
<include>css/*.*</include>
|
||||
<include>images/*.*</include>
|
||||
<include>img/*.*</include>
|
||||
<include>js/**/*.*</include>
|
||||
<include>*.html</include>
|
||||
</includes>
|
||||
@@ -77,13 +78,13 @@
|
||||
<outputDirectory>docs/reference/pdf</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>target/classes/license.txt</source>
|
||||
<source>src/dist/license.txt</source>
|
||||
</file>
|
||||
<file>
|
||||
<source>target/classes/notice.txt</source>
|
||||
<source>src/dist/notice.txt</source>
|
||||
</file>
|
||||
<file>
|
||||
<source>target/classes/readme.txt</source>
|
||||
<source>src/dist/readme.txt</source>
|
||||
</file>
|
||||
</files>
|
||||
</assembly>
|
||||
</assembly>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<includes>
|
||||
<include>css/*.*</include>
|
||||
<include>images/*.*</include>
|
||||
<include>img/*.*</include>
|
||||
<include>js/**/*.*</include>
|
||||
<include>*.html</include>
|
||||
</includes>
|
||||
|
||||
@@ -52,7 +52,6 @@ $(document).ready(function(){
|
||||
$javaContentAll.addClass("js-toc-ignore");
|
||||
$xmlContentAll.removeClass("js-toc-ignore");
|
||||
window.dispatchEvent(new Event("tocRefresh"));
|
||||
tocbot.refresh();
|
||||
window.localStorage.setItem('docToggle', 'xml');
|
||||
}
|
||||
|
||||
@@ -62,7 +61,6 @@ $(document).ready(function(){
|
||||
$xmlContentAll.addClass("js-toc-ignore");
|
||||
$javaContentAll.removeClass("js-toc-ignore");
|
||||
window.dispatchEvent(new Event("tocRefresh"));
|
||||
tocbot.refresh();
|
||||
window.localStorage.setItem('docToggle', 'java');
|
||||
}
|
||||
|
||||
@@ -72,7 +70,6 @@ $(document).ready(function(){
|
||||
$javaContentAll.removeClass("js-toc-ignore");
|
||||
$xmlContentAll.removeClass("js-toc-ignore");
|
||||
window.dispatchEvent(new Event("tocRefresh"));
|
||||
tocbot.refresh();
|
||||
window.localStorage.setItem('docToggle', 'both');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
// Make Java the default
|
||||
setJava();
|
||||
|
||||
// Initial cookie handler. This part remembers the reader's choice and sets the toggle
|
||||
// accordingly.
|
||||
var docToggleCookieString = Cookies.get("docToggle");
|
||||
if (docToggleCookieString != null) {
|
||||
if (docToggleCookieString === "xml") {
|
||||
$("#xmlButton").prop("checked", true);
|
||||
setXml();
|
||||
} else if (docToggleCookieString === "java") {
|
||||
$("#javaButton").prop("checked", true);
|
||||
setJava();
|
||||
} else if (docToggleCookieString === "both") {
|
||||
$("#bothButton").prop("checked", true);
|
||||
setBoth();
|
||||
}
|
||||
}
|
||||
|
||||
// Click handlers
|
||||
$("#xmlButton").on("click", function() {
|
||||
setXml();
|
||||
});
|
||||
$("#javaButton").on("click", function() {
|
||||
setJava();
|
||||
});
|
||||
$("#bothButton").on("click", function() {
|
||||
setBoth();
|
||||
});
|
||||
|
||||
// Functions to do the work of handling the reader's choice, whether through a click
|
||||
// or through a cookie. 3652 days is 10 years, give or take a leap day.
|
||||
function setXml() {
|
||||
$("*.xmlContent").show();
|
||||
$("*.javaContent").hide();
|
||||
$("*.javaContent > *").addClass("js-toc-ignore");
|
||||
$("*.xmlContent > *").removeClass("js-toc-ignore");
|
||||
window.dispatchEvent(new Event("tocRefresh"));
|
||||
Cookies.set('docToggle', 'xml', { expires: 3652 });
|
||||
};
|
||||
|
||||
function setJava() {
|
||||
$("*.javaContent").show();
|
||||
$("*.xmlContent").hide();
|
||||
$("*.xmlContent > *").addClass("js-toc-ignore");
|
||||
$("*.javaContent > *").removeClass("js-toc-ignore");
|
||||
window.dispatchEvent(new Event("tocRefresh"));
|
||||
Cookies.set('docToggle', 'java', { expires: 3652 });
|
||||
};
|
||||
|
||||
function setBoth() {
|
||||
$("*.javaContent").show();
|
||||
$("*.xmlContent").show();
|
||||
$("*.javaContent > *").removeClass("js-toc-ignore");
|
||||
$("*.xmlContent > *").removeClass("js-toc-ignore");
|
||||
window.dispatchEvent(new Event("tocRefresh"));
|
||||
Cookies.set('docToggle', 'both', { expires: 3652 });
|
||||
};
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user