Skip to content

Commit

Permalink
Migrate docs to Antora infrastructure
Browse files Browse the repository at this point in the history
* Migrate Structure

* Insert explicit ids for headers

* Remove unnecessary asciidoc attributes

* Fix image::image

* Copy default antora files

* Fix indentation for all pages

* Split files

* Generate a default navigation

* Remove includes

* Fix cross references

* Enable Section Summary TOC for small pages

* Remove src/reference/asciidoc

* Fix antora build files

* Fix Antora Build and Migrate to Asciidoctor Tabs

* Fix Antora Nav Hiearchy

* Add deploy-docs.yml

* PR Feedback

* Fix `modifiedFiles` for `updateCopyrights` task
  • Loading branch information
rwinch authored Dec 5, 2023
1 parent bf2a391 commit 9cc8e49
Show file tree
Hide file tree
Showing 99 changed files with 8,627 additions and 8,664 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy Docs
on:
push:
branches-ignore: [ gh-pages ]
tags: '**'
repository_dispatch:
types: request-build-reference # legacy
schedule:
- cron: '0 10 * * *' # Once per day at 10am UTC
workflow_dispatch:
permissions:
actions: write
jobs:
build:
runs-on: ubuntu-latest
if: github.repository_owner == 'spring-projects'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: docs-build
fetch-depth: 1
- name: Dispatch (partial build)
if: github.ref_type == 'branch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
- name: Dispatch (full build)
if: github.ref_type == 'tag'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)
40 changes: 39 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ plugins {
id 'io.spring.dependency-management' version '1.1.4' apply false
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'org.antora' version '1.0.0'
id 'io.spring.antora.generate-antora-yml' version '0.0.1'
}

description = 'Spring AMQP'
Expand All @@ -38,7 +40,11 @@ ext {
springAsciidoctorBackendsVersion = '0.0.7'

modifiedFiles =
files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
files()
.from {
files(grgit.status().unstaged.modified)
.filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
}

assertjVersion = '3.24.2'
assertkVersion = '0.27.0'
Expand Down Expand Up @@ -74,6 +80,38 @@ ext {
javaProjects = subprojects - project(':spring-amqp-bom')
}



antora {
version = '3.2.0-alpha.2'
playbook = file('src/reference/antora/antora-playbook.yml')
options = ['to-dir' : project.layout.buildDirectory.dir('site').get().toString(), clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true]
dependencies = [
'@antora/atlas-extension': '1.0.0-alpha.1',
'@antora/collector-extension': '1.0.0-alpha.3',
'@asciidoctor/tabs': '1.0.0-beta.3',
'@springio/antora-extensions': '1.4.2',
'@springio/asciidoctor-extensions': '1.0.0-alpha.8',
]
}

tasks.named("generateAntoraYml") {
asciidocAttributes = project.provider( {
return ['project-version' : project.version ]
} )
baseAntoraYmlFile = file('src/reference/antora/antora.yml')
}

tasks.create(name: 'createAntoraPartials', type: Sync) {
from { tasks.filterMetricsDocsContent.outputs }
into layout.buildDirectory.dir('generated-antora-resources/modules/ROOT/partials')
}

tasks.create('generateAntoraResources') {
dependsOn 'createAntoraPartials'
dependsOn 'generateAntoraYml'
}

nohttp {
source.include '**/src/**'
source.exclude '**/*.gif', '**/*.ks'
Expand Down
44 changes: 44 additions & 0 deletions src/reference/antora/antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
antora:
extensions:
- '@springio/antora-extensions/partial-build-extension'
- require: '@springio/antora-extensions/latest-version-extension'
- require: '@springio/antora-extensions/inject-collector-cache-config-extension'
- '@antora/collector-extension'
- '@antora/atlas-extension'
- require: '@springio/antora-extensions/root-component-extension'
root_component_name: 'amqp'
# FIXME: Run antora once using this extension to migrate to the Asciidoc Tabs syntax
# and then remove this extension
- require: '@springio/antora-extensions/tabs-migration-extension'
unwrap_example_block: always
save_result: true
site:
title: Spring AMQP
url: https://docs.spring.io/spring-amqp/reference/
content:
sources:
- url: ./../../..
branches: HEAD
# See https://docs.antora.org/antora/latest/playbook/content-source-start-path/#start-path-key
start_path: src/reference/antora
worktrees: true
asciidoc:
attributes:
page-stackoverflow-url: https://stackoverflow.com/tags/spring-amqp
page-pagination: ''
hide-uri-scheme: '@'
tabs-sync-option: '@'
chomp: 'all'
extensions:
- '@asciidoctor/tabs'
- '@springio/asciidoctor-extensions'
sourcemap: true
urls:
latest_version_segment: ''
runtime:
log:
failure_level: warn
format: pretty
ui:
bundle:
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.9/ui-bundle.zip
17 changes: 17 additions & 0 deletions src/reference/antora/antora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: amqp
version: true
title: Spring AMQP
nav:
- modules/ROOT/nav.adoc
ext:
collector:
run:
command: gradlew -q "-Dorg.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError" :generateAntoraResources
local: true
scan:
dir: build/generated-antora-resources

asciidoc:
attributes:
attribute-missing: 'warn'
chomp: 'all'
File renamed without changes
88 changes: 88 additions & 0 deletions src/reference/antora/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
* xref:index.adoc[]
* xref:whats-new.adoc[]
* xref:introduction/index.adoc[]
** xref:introduction/quick-tour.adoc[]
* xref:reference.adoc[]
** xref:amqp.adoc[]
*** xref:amqp/abstractions.adoc[]
*** xref:amqp/connections.adoc[]
*** xref:amqp/custom-client-props.adoc[]
*** xref:amqp/template.adoc[]
*** xref:amqp/sending-messages.adoc[]
*** xref:amqp/receiving-messages.adoc[]
**** xref:amqp/receiving-messages/polling-consumer.adoc[]
**** xref:amqp/receiving-messages/async-consumer.adoc[]
**** xref:amqp/receiving-messages/de-batching.adoc[]
**** xref:amqp/receiving-messages/consumer-events.adoc[]
**** xref:amqp/receiving-messages/consumerTags.adoc[]
**** xref:amqp/receiving-messages/async-annotation-driven.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/meta.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/enable.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/conversion.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/custom-argument-resolver.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/registration.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/enable-signature.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/rabbit-validation.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/multiple-queues.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/reply.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/reply-content-type.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/method-selection.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/repeatable-rabbit-listener.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/proxy-rabbitlistener-and-generics.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/error-handling.adoc[]
***** xref:amqp/receiving-messages/async-annotation-driven/container-management.adoc[]
**** xref:amqp/receiving-messages/batch.adoc[]
**** xref:amqp/receiving-messages/using-container-factories.adoc[]
**** xref:amqp/receiving-messages/async-returns.adoc[]
**** xref:amqp/receiving-messages/threading.adoc[]
**** xref:amqp/receiving-messages/choose-container.adoc[]
**** xref:amqp/receiving-messages/idle-containers.adoc[]
**** xref:amqp/receiving-messages/micrometer.adoc[]
**** xref:amqp/receiving-messages/micrometer-observation.adoc[]
*** xref:amqp/containers-and-broker-named-queues.adoc[]
*** xref:amqp/message-converters.adoc[]
*** xref:amqp/post-processing.adoc[]
*** xref:amqp/request-reply.adoc[]
*** xref:amqp/broker-configuration.adoc[]
*** xref:amqp/broker-events.adoc[]
*** xref:amqp/delayed-message-exchange.adoc[]
*** xref:amqp/management-rest-api.adoc[]
*** xref:amqp/exception-handling.adoc[]
*** xref:amqp/transactions.adoc[]
*** xref:amqp/containerAttributes.adoc[]
*** xref:amqp/listener-concurrency.adoc[]
*** xref:amqp/exclusive-consumer.adoc[]
*** xref:amqp/listener-queues.adoc[]
*** xref:amqp/resilience-recovering-from-errors-and-broker-failures.adoc[]
*** xref:amqp/multi-rabbit.adoc[]
*** xref:amqp/debugging.adoc[]
** xref:stream.adoc[]
** xref:logging.adoc[]
** xref:sample-apps.adoc[]
** xref:testing.adoc[]
* xref:integration-reference.adoc[]
** xref:si-amqp.adoc[]
* xref:resources.adoc[]
** xref:further-reading.adoc[]
* xref:appendix/micrometer.adoc[]
* xref:appendix/native.adoc[]
* Change History
** xref:appendix/current-release.adoc[]
** xref:appendix/previous-whats-new.adoc[]
*** xref:appendix/previous-whats-new/changes-in-3-0-since-2-4.adoc[]
*** xref:appendix/previous-whats-new/changes-in-2-4-since-2-3.adoc[]
*** xref:appendix/previous-whats-new/message-converter-changes.adoc[]
*** xref:appendix/previous-whats-new/message-converter-changes-1.adoc[]
*** xref:appendix/previous-whats-new/stream-support-changes.adoc[]
*** xref:appendix/previous-whats-new/changes-in-2-3-since-2-2.adoc[]
*** xref:appendix/previous-whats-new/changes-in-2-2-since-2-1.adoc[]
*** xref:appendix/previous-whats-new/changes-in-2-1-since-2-0.adoc[]
*** xref:appendix/previous-whats-new/changes-in-2-0-since-1-7.adoc[]
*** xref:appendix/previous-whats-new/changes-in-1-7-since-1-6.adoc[]
*** xref:appendix/previous-whats-new/earlier-releases.adoc[]
*** xref:appendix/previous-whats-new/changes-in-1-6-since-1-5.adoc[]
*** xref:appendix/previous-whats-new/changes-in-1-5-since-1-4.adoc[]
*** xref:appendix/previous-whats-new/changes-in-1-4-since-1-3.adoc[]
*** xref:appendix/previous-whats-new/changes-in-1-3-since-1-2.adoc[]
*** xref:appendix/previous-whats-new/changes-to-1-2-since-1-1.adoc[]
*** xref:appendix/previous-whats-new/changes-to-1-1-since-1-0.adoc[]
6 changes: 6 additions & 0 deletions src/reference/antora/modules/ROOT/pages/amqp.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[[amqp]]
= Using Spring AMQP
:page-section-summary-toc: 1

This chapter explores the interfaces and classes that are the essential components for developing applications with Spring AMQP.

Loading

0 comments on commit 9cc8e49

Please sign in to comment.