The extensions can be used by adding a dependency to your Maven or Gradle build:
Add a dependency on the extensions to the asciidoctor
configuration:
asciidoctor 'io.spring.asciidoctor:spring-asciidoctor-extensions:version'
Add a dependency to your existing configuration of the asciidoctor-maven-plugin
:
<plugin> <groupId>org.asciidoctor</groupId> <artifactId>asciidoctor-maven-plugin</artifactId> <dependencies> <dependency> <groupId>io.spring.asciidoctor</groupId> <artifactId>spring-asciidoctor-extensions</artifactId> <version>${project.version}</version> </dependency> </dependencies> </plugin>
Post-processes Asciidoctor’s HTML output to collapse multiple code blocks into one and provides
tabs that can be used to switch between them. Requires one block that has a role="primary"
attribute and one more blocks that have a role="secondary"
attribute. The tabs are named using
the block titles.
For example:
[source,xml,indent=0,role="primary"]
.Maven
----
<dependency>
<groupId>com.example</groupId>
<artifactId>some-library</artifactId>
<version>1.2.3</version>
</dependency>
----
[source,indent=0,role="secondary"]
.Gradle
----
compile 'com.example:some-library:1.2.3
----