From 99967772ed42872821a1e4305562d2d5080d1fb1 Mon Sep 17 00:00:00 2001 From: Jay Bryant Date: Thu, 4 Aug 2022 15:22:16 -0500 Subject: [PATCH] Use spring-asciidoctor-backends Rather than `spring-doc-resources`, which is to be retired. * Fix some problems with tabs in docs --- gradle/docs.gradle | 32 +++++++-------------- src/reference/asciidoc/amqp.adoc | 3 +- src/reference/asciidoc/message-history.adoc | 6 ++++ 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/gradle/docs.gradle b/gradle/docs.gradle index 94f2aa704b..dcc80d9ed8 100644 --- a/gradle/docs.gradle +++ b/gradle/docs.gradle @@ -1,31 +1,17 @@ ext { - docResourcesVersion = '0.2.5' - blockSwitchVersion = '0.5.0' + backendVersion = '0.0.3' } configurations { - docs - asciidoctorExt + asciidoctorExtensions } dependencies { - docs "io.spring.docresources:spring-doc-resources:${docResourcesVersion}@zip" - asciidoctorExt "io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:$blockSwitchVersion" -} - -task prepareAsciidocBuild(type: Sync) { - dependsOn configurations.docs - from { - configurations.docs.collect { zipTree(it) } - } - duplicatesStrategy = DuplicatesStrategy.INCLUDE - from 'src/reference/asciidoc/' - into "$buildDir/asciidoc" + asciidoctorExtensions "io.spring.asciidoctor.backends:spring-asciidoctor-backends:$backendVersion" } task checkAsciidocLinks { - dependsOn prepareAsciidocBuild - inputs.dir("$buildDir/asciidoc") + inputs.dir("src/reference/asciidoc/") doLast { def errors = new ArrayList<>(); errors.add('*** Anchor reference errors found:') @@ -71,10 +57,9 @@ asciidoctorPdf { } baseDirFollowsSourceFile() - configurations 'asciidoctorExt' asciidoctorj { - sourceDir "$buildDir/asciidoc" + sourceDir "src/reference/asciidoc/" inputs.dir(sourceDir) sources { include 'index-single.adoc' @@ -119,9 +104,12 @@ asciidoctor { jvmArgs '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-opens', 'java.base/java.io=ALL-UNNAMED' } baseDirFollowsSourceFile() - configurations 'asciidoctorExt' - sourceDir "$buildDir/asciidoc" + configurations 'asciidoctorExtensions' + sourceDir "src/reference/asciidoc/" inputs.dir(sourceDir) + outputOptions { + backends "spring-html" + } resources { from(sourceDir) { include 'images/*', 'css/**', 'js/**' diff --git a/src/reference/asciidoc/amqp.adoc b/src/reference/asciidoc/amqp.adoc index ecde6c4b24..ddd53a104a 100644 --- a/src/reference/asciidoc/amqp.adoc +++ b/src/reference/asciidoc/amqp.adoc @@ -127,7 +127,6 @@ public MessageHandler handler() { tx-size="" <25> consumers-per-queue <26> batch-mode="MESSAGES"/> <27> ----- <1> The unique ID for this adapter. Optional. @@ -221,7 +220,7 @@ See the https://docs.spring.io/spring-amqp/reference/html/[Spring AMQP Reference When set to `MESSAGES` (default), the payload is a `List>` where each message has headers mapped from the incoming AMQP `Message` and the payload is the converted `body`. When set to `EXTRACT_PAYLOADS`, the payload is a `List` where the elements are converted from the AMQP `Message` body. `EXTRACT_PAYLOADS_WITH_HEADERS` is similar to `EXTRACT_PAYLOADS` but, in addition, the headers from each message are mapped from the `MessageProperties` into a `List` at the corresponding index; the header name is `AmqpInboundChannelAdapter.CONSOLIDATED_HEADERS`. - +---- ==== [NOTE] diff --git a/src/reference/asciidoc/message-history.adoc b/src/reference/asciidoc/message-history.adoc index 950ec63c55..3b036877b9 100644 --- a/src/reference/asciidoc/message-history.adoc +++ b/src/reference/asciidoc/message-history.adoc @@ -16,12 +16,14 @@ To enable message history, you need only define the `message-history` element (o ==== [source, java, role="primary"] +.Java ---- @Configuration @EnableIntegration @EnableMessageHistory ---- [source, xml, role="secondary"] +.XML ---- ---- @@ -35,6 +37,7 @@ Consider the following configuration example: ==== [source, java, role="primary"] +.Java ---- @MessagingGateway(defaultRequestChannel = "bridgeInChannel") public interface SampleGateway { @@ -50,6 +53,7 @@ HeaderEnricher sampleEnricher() { } ---- [source, xml, role="secondary"] +.XML ---- ----