From 26cfbe04b2565b133acb8ac7920c428f2c56a9e9 Mon Sep 17 00:00:00 2001 From: simionAndrei Date: Tue, 26 Mar 2019 15:44:09 +0100 Subject: [PATCH] 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.