From 26cfbe04b2565b133acb8ac7920c428f2c56a9e9 Mon Sep 17 00:00:00 2001 From: simionAndrei Date: Tue, 26 Mar 2019 15:44:09 +0100 Subject: [PATCH 1/3] Add Spring-specific styling to Actuator's API documentation This commit replaces the default Asciidoctor styling with Spring specific styling. First, we need to unzip the contents of the Spring Asciidoctor documentation resources provided by the `io.spring.docsresources:spring-docs-resources` distribution zip. This is done in a `/target/refdocs` folder. We then copy all files from `src/main/asciidoc` to the same location, and then launch the generation process. See gh-16326 --- .../pom.xml | 57 ++++++++++++++++++- .../src/main/asciidoc/index.adoc | 1 + 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml b/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml index 163e0dab35..78cbc9f3d4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml @@ -14,6 +14,7 @@ Spring Boot Actuator AutoConfigure ${basedir}/../.. + ${project.build.directory}/refdocs/ @@ -635,6 +636,24 @@ + + com.googlecode.maven-download-plugin + download-maven-plugin + + + unpack-doc-resources + generate-resources + + wget + + + https://repo.spring.io/release/io/spring/docresources/spring-doc-resources/${spring-doc-resources.version}/spring-doc-resources-${spring-doc-resources.version}.zip + true + ${refdocs.build.directory} + + + + org.apache.maven.plugins maven-antrun-plugin @@ -732,7 +751,18 @@ process-asciidoc - html + html5 + highlight.js + book + + js/highlight + atom-one-dark-reasonable + true + ./images + font + css/ + spring.css + @@ -747,7 +777,8 @@ - index.adoc + ${refdocs.build.directory} + ${project.build.directory}/generated-docs/reference/html ${version-type} ${project.version} @@ -762,6 +793,28 @@ + + org.apache.maven.plugins + maven-resources-plugin + + + copy-asciidoc-resources + generate-resources + + copy-resources + + + ${refdocs.build.directory} + + + src/main/asciidoc + false + + + + + + org.codehaus.mojo build-helper-maven-plugin diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/index.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/index.adoc index 00ff14c487..13d48c4e0a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/index.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/index.adoc @@ -7,6 +7,7 @@ Andy Wilkinson :numbered: :icons: font :hide-uri-scheme: +:docinfo: shared,private This API documentation describes Spring Boot Actuators web endpoints. From 604b0891d095d8405ce874de48ca779cef17764b Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 29 Mar 2019 15:35:05 +0100 Subject: [PATCH 2/3] Use asciidoctor 1.5.8 This commit uses asciidoctor 1.5.8 for the time being. Once a new version of the plugin is released, this override will be unnecessary. --- spring-boot-project/spring-boot-parent/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spring-boot-project/spring-boot-parent/pom.xml b/spring-boot-project/spring-boot-parent/pom.xml index 743eb0e3ea..660e637b93 100644 --- a/spring-boot-project/spring-boot-parent/pom.xml +++ b/spring-boot-project/spring-boot-parent/pom.xml @@ -294,6 +294,13 @@ org.asciidoctor asciidoctor-maven-plugin 1.5.7.1 + + + org.asciidoctor + asciidoctorj + 1.5.8 + + org.apache.maven.plugins From 1bc47b7e749333b4fd90e0ea3ccf442072b9f2e4 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 29 Mar 2019 15:36:35 +0100 Subject: [PATCH 3/3] Polish "Add Spring-specific styling to Actuator's API documentation" Closes gh-16326 --- .../spring-boot-actuator-autoconfigure/pom.xml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml b/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml index 78cbc9f3d4..4cbb6d6033 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml @@ -724,16 +724,7 @@ - - - - - + @@ -752,6 +743,7 @@ html5 + ${project.build.directory}/generated-docs/reference/html highlight.js book @@ -773,12 +765,12 @@ pdf + ${project.build.directory}/generated-docs/reference/pdf ${refdocs.build.directory} - ${project.build.directory}/generated-docs/reference/html ${version-type} ${project.version}