Skip to content

Commit 56036d1

Browse files
rwinchodrotbohm
authored andcommitted
GH-285 - Migrate documentation to Antora.
1 parent 607d046 commit 56036d1

25 files changed

+247
-209
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches-ignore: [ gh-pages ]
5+
tags: '**'
6+
repository_dispatch:
7+
types: request-build-reference # legacy
8+
#schedule:
9+
#- cron: '0 10 * * *' # Once per day at 10am UTC
10+
workflow_dispatch:
11+
permissions: read-all
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
if: github.repository_owner == 'spring-projects'
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
with:
20+
ref: docs-build
21+
fetch-depth: 1
22+
- name: Dispatch (partial build)
23+
if: github.ref_type == 'branch'
24+
env:
25+
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
26+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
27+
- name: Dispatch (full build)
28+
if: github.ref_type == 'tag'
29+
env:
30+
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
31+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)

.github/workflows/docs.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ changelog.txt
1414
#IntelliJ Stuff
1515
.idea
1616
*.iml
17+
18+
# Antora
19+
node
20+
node_modules
21+
package.json
22+
package-lock.json

pom.xml

Lines changed: 23 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4242
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
4343
<spring.version>6.0.11</spring.version> <!-- For Javadoc links only -->
44-
<spring-asciidoctor-backends.version>0.0.7</spring-asciidoctor-backends.version>
4544
<spring-boot.version>3.2.0-M2</spring-boot.version>
4645

4746
</properties>
@@ -277,76 +276,34 @@ limitations under the License.
277276
<plugins>
278277

279278
<!--
280-
Asciidoctor
279+
Antora
281280
-->
282281

283282
<plugin>
284-
<groupId>org.asciidoctor</groupId>
285-
<artifactId>asciidoctor-maven-plugin</artifactId>
286-
<version>2.2.2</version>
287-
<dependencies>
288-
<dependency>
289-
<groupId>org.jruby</groupId>
290-
<artifactId>jruby</artifactId>
291-
<version>9.3.7.0</version>
292-
</dependency>
293-
<dependency>
294-
<groupId>org.asciidoctor</groupId>
295-
<artifactId>asciidoctorj</artifactId>
296-
<version>2.5.7</version>
297-
</dependency>
298-
<dependency>
299-
<groupId>org.asciidoctor</groupId>
300-
<artifactId>asciidoctorj-diagram</artifactId>
301-
<version>2.2.3</version>
302-
</dependency>
303-
<dependency>
304-
<groupId>io.spring.asciidoctor.backends</groupId>
305-
<artifactId>spring-asciidoctor-backends</artifactId>
306-
<version>${spring-asciidoctor-backends.version}</version>
307-
</dependency>
308-
</dependencies>
309-
283+
<groupId>io.spring.maven.antora</groupId>
284+
<artifactId>antora-component-version-maven-plugin</artifactId>
285+
<version>0.0.4</version>
310286
<executions>
311-
312287
<execution>
313-
<id>html</id>
314-
<phase>generate-resources</phase>
315288
<goals>
316-
<goal>process-asciidoc</goal>
289+
<goal>antora-component-version</goal>
317290
</goals>
318-
<configuration>
319-
<backend>spring-html</backend>
320-
<sourceDirectory>../src/docs/asciidoc</sourceDirectory>
321-
<sourceDocumentName>index.adoc</sourceDocumentName>
322-
<outputDirectory>${generated-docs.directory}/html</outputDirectory>
323-
<attributes>
324-
<source-highlighter>highlight.js</source-highlighter>
325-
<highlightjsdir>js/highlight</highlightjsdir>
326-
<highlightjs-theme>github</highlightjs-theme>
327-
</attributes>
328-
</configuration>
329291
</execution>
330292
</executions>
331-
293+
</plugin>
294+
<plugin>
295+
<groupId>io.spring.maven.antora</groupId>
296+
<artifactId>antora-maven-plugin</artifactId>
297+
<version>0.0.4</version>
298+
<extensions>true</extensions>
332299
<configuration>
333-
<doctype>book</doctype>
334-
<attributes>
335-
<docinfo>shared</docinfo>
336-
<icons>font</icons>
337-
<sectids>false</sectids>
338-
<imagesdir>images</imagesdir>
339-
<projectName>${project.name}</projectName>
340-
<projectVersion>${project.version}</projectVersion>
341-
<springVersion>${spring.version}</springVersion>
342-
<toclevels>4</toclevels>
343-
<numbered>true</numbered>
344-
</attributes>
345-
<requires>
346-
<require>asciidoctor-diagram</require>
347-
</requires>
300+
<playbook>../src/docs/antora/antora-playbook.yml</playbook>
301+
<options>
302+
<option>--to-dir=target/antora/site</option>
303+
<option>--stacktrace</option>
304+
<option>--fetch</option>
305+
</options>
348306
</configuration>
349-
350307
</plugin>
351308

352309
<!--
@@ -415,6 +372,12 @@ limitations under the License.
415372

416373
</plugins>
417374
</pluginManagement>
375+
<resources>
376+
<resource>
377+
<directory>src/docs/antora/resources</directory>
378+
<filtering>true</filtering>
379+
</resource>
380+
</resources>
418381
</build>
419382
</profile>
420383

spring-modulith-distribution/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
<groupId>org.apache.maven.plugins</groupId>
3737
<artifactId>maven-assembly-plugin</artifactId>
3838
</plugin>
39-
<plugin>
40-
<groupId>org.asciidoctor</groupId>
41-
<artifactId>asciidoctor-maven-plugin</artifactId>
42-
</plugin>
4339
</plugins>
4440
</build>
4541

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches-ignore: [ gh-pages ]
5+
tags: '**'
6+
repository_dispatch:
7+
types: request-build-reference # legacy
8+
#schedule:
9+
#- cron: '0 10 * * *' # Once per day at 10am UTC
10+
workflow_dispatch:
11+
permissions:
12+
actions: write
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
# FIXME: enable when pushed to spring-projects
17+
# if: github.repository_owner == 'spring-projects'
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
ref: docs-build
23+
fetch-depth: 1
24+
- name: Dispatch (partial build)
25+
if: github.ref_type == 'branch'
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
29+
- name: Dispatch (full build)
30+
if: github.ref_type == 'tag'
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)

src/docs/antora/antora-playbook.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
antora:
2+
extensions:
3+
- '@springio/antora-extensions/partial-build-extension'
4+
- require: '@springio/antora-extensions/latest-version-extension'
5+
- require: '@springio/antora-extensions/inject-collector-cache-config-extension'
6+
- '@antora/collector-extension'
7+
- '@antora/atlas-extension'
8+
- require: '@springio/antora-extensions/root-component-extension'
9+
root_component_name: 'modulith'
10+
site:
11+
title: Spring Modulith
12+
url: https://docs.spring.io/spring-modulith/reference/
13+
content:
14+
sources:
15+
- url: ./../../..
16+
branches: HEAD
17+
start_path: src/docs/antora
18+
worktrees: true
19+
asciidoc:
20+
attributes:
21+
page-pagination: ''
22+
hide-uri-scheme: '@'
23+
tabs-sync-option: '@'
24+
chomp: 'all'
25+
extensions:
26+
- '@asciidoctor/tabs'
27+
- '@springio/asciidoctor-extensions'
28+
sourcemap: true
29+
urls:
30+
latest_version_segment: ''
31+
runtime:
32+
log:
33+
failure_level: warn
34+
format: pretty
35+
ui:
36+
bundle:
37+
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip

src/docs/antora/antora.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: modulith
2+
version: true
3+
title: Spring Modulith
4+
nav:
5+
- modules/ROOT/nav.adoc
6+
ext:
7+
collector:
8+
run:
9+
command: mvnw -N antora-component-version:antora-component-version resources:resources -am -Pdocumentation
10+
local: true
11+
scan:
12+
dir: target/classes/antora-resources/
13+
14+
asciidoc:
15+
attributes:
16+
attribute-missing: 'warn'
17+
chomp: 'all'

0 commit comments

Comments
 (0)