Modernizing the documentation

I made this project match the other Spring projects for documentation by pulling in spring-doc-resources and using those resources to create the dynamic ToC and our new styles.

Accounting for Glenn Renfro's feedback

Glenn caught a couple problems. I have fixed them. Thanks, Glenn. :)
This commit is contained in:
Jay Bryant
2019-04-10 16:33:08 -05:00
committed by Glenn Renfro
parent 56469bb92f
commit 0c53ba812a
44 changed files with 98 additions and 4016 deletions

View File

@@ -13,8 +13,17 @@
<description>Spring Cloud Task Docs</description>
<properties>
<main.basedir>${basedir}/..</main.basedir>
<asciidoctor.maven.plugin.version>1.5.6</asciidoctor.maven.plugin.version>
<asciidoctorj.pdf.version>1.5.0-alpha.16</asciidoctorj.pdf.version>
</properties>
<dependencies>
<dependency>
<groupId>io.spring.docresources</groupId>
<artifactId>spring-doc-resources</artifactId>
<version>0.1.1.RELEASE</version>
<type>zip</type>
<optional>true</optional>
</dependency>
</dependencies>
<profiles>
<profile>
@@ -22,227 +31,102 @@
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.0</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-doc-resources</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<includeGroupIds>io.spring.docresources</includeGroupIds>
<includeArtifactIds>spring-doc-resources</includeArtifactIds>
<includeTypes>zip</includeTypes>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${project.build.directory}/refdocs/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-asciidoc-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>transform</goal>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/refdocs/</outputDirectory>
<resources>
<resource>
<directory>src/main/asciidoc</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
<configuration>
<transformationSets>
<transformationSet>
<dir>${project.build.directory}/external-resources
</dir>
<stylesheet>src/main/xslt/dependencyVersions.xsl
</stylesheet>
<fileMappers>
<fileMapper
implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
<targetExtension>.adoc</targetExtension>
</fileMapper>
</fileMappers>
<outputDir>
${project.build.directory}/generated-resources
</outputDir>
</transformationSet>
</transformationSets>
</configuration>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>1.5.2</version>
<version>${asciidoctor.maven.plugin.version}</version>
<dependencies>
<dependency>
<!-- Needed to resolve URI includes -->
<!-- See https://github.com/asciidoctor/asciidoctor.js/issues/153 -->
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>9.0.0.0</version>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-pdf</artifactId>
<version>${asciidoctorj.pdf.version}</version>
</dependency>
</dependencies>
<configuration>
<sourceDirectory>${project.build.directory}/refdocs/</sourceDirectory>
<sourceDocumentName>index.adoc</sourceDocumentName>
</configuration>
<executions>
<execution>
<id>generate-docbook</id>
<id>generate-html</id>
<phase>generate-resources</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<sourceDocumentName>index.adoc</sourceDocumentName>
<backend>docbook5</backend>
<doctype>book</doctype>
<backend>html5</backend>
<sourceHighlighter>highlight.js</sourceHighlighter>
<attributes>
<docinfo>true</docinfo>
<spring-boot-version>${project.version}
</spring-boot-version>
<spring-boot-docs-version>${project.version}
</spring-boot-docs-version>
<spring-boot-repo>${spring-boot-repo}
</spring-boot-repo>
<spring-docs-version>${spring.version}
</spring-docs-version>
<spring-security-docs-version>
${spring-security.version}
</spring-security-docs-version>
<allow-uri-read>true</allow-uri-read>
<github-tag>${github-tag}</github-tag>
<toc>left</toc>
<toc-levels>4</toc-levels>
<sectanchors>true</sectanchors>
<sectnums/>
<docinfo>shared</docinfo>
<stylesdir>css/</stylesdir>
<stylesheet>spring.css</stylesheet>
<linkcss>true</linkcss>
<icons>font</icons>
<highlightjsdir>js/highlight</highlightjsdir>
<highlightjs-theme>atom-one-dark-reasonable</highlightjs-theme>
</attributes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.15</version>
<configuration>
<sourceDirectory>${basedir}/target/generated-docs
</sourceDirectory>
<includes>index.xml</includes>
<xincludeSupported>true</xincludeSupported>
<chunkedOutput>false</chunkedOutput>
<foCustomization>${basedir}/src/main/docbook/xsl/pdf.xsl
</foCustomization>
<useExtensions>1</useExtensions>
<highlightSource>1</highlightSource>
<highlightXslthlConfig>
${basedir}/src/main/docbook/xsl/xslthl-config.xml
</highlightXslthlConfig>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.xslthl</groupId>
<artifactId>xslthl</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>net.sf.docbook</groupId>
<artifactId>docbook-xml</artifactId>
<version>5.0-all</version>
<classifier>resources</classifier>
<type>zip</type>
<scope>runtime</scope>
</dependency>
</dependencies>
<executions>
<execution>
<id>html-single</id>
<id>generate-pdf</id>
<phase>generate-resources</phase>
<goals>
<goal>generate-html</goal>
<goal>process-asciidoc</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<htmlCustomization>
${basedir}/src/main/docbook/xsl/html-singlepage.xsl
</htmlCustomization>
<targetDirectory>
${basedir}/target/docbook/htmlsingle
</targetDirectory>
<postProcess>
<copy
todir="${basedir}/target/contents/reference/htmlsingle">
<fileset
dir="${basedir}/target/docbook/htmlsingle">
<include name="**/*.html"/>
</fileset>
</copy>
<copy
todir="${basedir}/target/contents/reference/htmlsingle">
<fileset dir="${basedir}/src/main/docbook">
<include name="**/*.css"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
</fileset>
</copy>
</postProcess>
</configuration>
</execution>
<execution>
<id>html</id>
<goals>
<goal>generate-html</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<htmlCustomization>
${basedir}/src/main/docbook/xsl/html-multipage.xsl
</htmlCustomization>
<targetDirectory>${basedir}/target/docbook/html
</targetDirectory>
<chunkedOutput>true</chunkedOutput>
<postProcess>
<copy
todir="${basedir}/target/contents/reference/html">
<fileset dir="${basedir}/target/docbook/html">
<include name="**/*.html"/>
</fileset>
</copy>
<copy
todir="${basedir}/target/contents/reference/html">
<fileset dir="${basedir}/src/main/docbook">
<include name="**/*.css"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
</fileset>
</copy>
</postProcess>
</configuration>
</execution>
<execution>
<id>pdf</id>
<goals>
<goal>generate-pdf</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<foCustomization>
${basedir}/src/main/docbook/xsl/pdf.xsl
</foCustomization>
<targetDirectory>${basedir}/target/docbook/pdf
</targetDirectory>
<postProcess>
<copy
todir="${basedir}/target/contents/reference">
<fileset dir="${basedir}/target/docbook">
<include name="**/*.pdf"/>
</fileset>
</copy>
<move
file="${basedir}/target/contents/reference/pdf/index.pdf"
tofile="${basedir}/target/contents/reference/pdf/spring-cloud-task-reference.pdf"/>
</postProcess>
</configuration>
</execution>
<execution>
<id>epub</id>
<goals>
<goal>generate-epub3</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<epubCustomization>
${basedir}/src/main/docbook/xsl/epub.xsl
</epubCustomization>
<targetDirectory>${basedir}/target/docbook/epub
</targetDirectory>
<postProcess>
<copy
todir="${basedir}/target/contents/reference/epub">
<fileset dir="${basedir}/target/docbook">
<include name="**/*.epub"/>
</fileset>
</copy>
<move
file="${basedir}/target/contents/reference/epub/index.epub"
tofile="${basedir}/target/contents/reference/epub/spring-cloud-task-reference.epub"/>
</postProcess>
<backend>pdf</backend>
<sourceHighlighter>coderay</sourceHighlighter>
<attributes>
<icons>font</icons>
<pagenums/>
<sectnums/>
<toc/>
</attributes>
</configuration>
</execution>
</executions>
@@ -282,10 +166,9 @@
</goals>
<configuration>
<target>
<zip
destfile="${project.build.directory}/${project.artifactId}-${project.version}.zip">
<fileset
dir="${project.build.directory}/contents"/>
<zip destfile="${project.build.directory}/${project.artifactId}-${project.version}.zip">
<zipfileset dir="${project.build.directory}/generated-docs" prefix="reference"/>
<zipfileset dir="../target/site/apidocs" prefix="apidocs"/>
</zip>
</target>
</configuration>
@@ -340,26 +223,6 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>docs-assembly</id>
<phase>package</phase>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/assemble.xml
</descriptor>
</descriptors>
<attach>false</attach>
</configuration>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>