Commit 26cfbe04 authored by simionAndrei's avatar simionAndrei Committed by Stephane Nicoll

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
parent d1507497
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<description>Spring Boot Actuator AutoConfigure</description> <description>Spring Boot Actuator AutoConfigure</description>
<properties> <properties>
<main.basedir>${basedir}/../..</main.basedir> <main.basedir>${basedir}/../..</main.basedir>
<refdocs.build.directory>${project.build.directory}/refdocs/</refdocs.build.directory>
</properties> </properties>
<dependencies> <dependencies>
<!-- Compile --> <!-- Compile -->
...@@ -635,6 +636,24 @@ ...@@ -635,6 +636,24 @@
</activation> </activation>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-doc-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://repo.spring.io/release/io/spring/docresources/spring-doc-resources/${spring-doc-resources.version}/spring-doc-resources-${spring-doc-resources.version}.zip</url>
<unpack>true</unpack>
<outputDirectory>${refdocs.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
...@@ -732,7 +751,18 @@ ...@@ -732,7 +751,18 @@
<goal>process-asciidoc</goal> <goal>process-asciidoc</goal>
</goals> </goals>
<configuration> <configuration>
<backend>html</backend> <backend>html5</backend>
<sourceHighlighter>highlight.js</sourceHighlighter>
<doctype>book</doctype>
<attributes>
<highlightjsdir>js/highlight</highlightjsdir>
<highlightjs-theme>atom-one-dark-reasonable</highlightjs-theme>
<linkcss>true</linkcss>
<imagesdir>./images</imagesdir>
<icons>font</icons>
<stylesdir>css/</stylesdir>
<stylesheet>spring.css</stylesheet>
</attributes>
</configuration> </configuration>
</execution> </execution>
<execution> <execution>
...@@ -747,7 +777,8 @@ ...@@ -747,7 +777,8 @@
</execution> </execution>
</executions> </executions>
<configuration> <configuration>
<sourceDocumentName>index.adoc</sourceDocumentName> <sourceDirectory>${refdocs.build.directory}</sourceDirectory>
<outputDirectory>${project.build.directory}/generated-docs/reference/html</outputDirectory>
<attributes> <attributes>
<version-type>${version-type}</version-type> <version-type>${version-type}</version-type>
<version>${project.version}</version> <version>${project.version}</version>
...@@ -762,6 +793,28 @@ ...@@ -762,6 +793,28 @@
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </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>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${refdocs.build.directory}</outputDirectory>
<resources>
<resource>
<directory>src/main/asciidoc</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId> <artifactId>build-helper-maven-plugin</artifactId>
......
...@@ -7,6 +7,7 @@ Andy Wilkinson ...@@ -7,6 +7,7 @@ Andy Wilkinson
:numbered: :numbered:
:icons: font :icons: font
:hide-uri-scheme: :hide-uri-scheme:
:docinfo: shared,private
This API documentation describes Spring Boot Actuators web endpoints. This API documentation describes Spring Boot Actuators web endpoints.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment