Skip to content

Commit 838004e

Browse files
committed
Merge pull request #744 from brneto
* gh-744: Polish "Document how to use org.asciidoctor.jvm.convert Gradle plugin" Document how to use org.asciidoctor.jvm.convert Gradle plugin Closes gh-744
2 parents 96293c0 + acd60c7 commit 838004e

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

docs/src/docs/asciidoc/getting-started.adoc

+26-19
Original file line numberDiff line numberDiff line change
@@ -146,42 +146,49 @@ macro.
146146
.Gradle
147147
----
148148
plugins { <1>
149-
id "org.asciidoctor.convert" version "1.5.9.2"
149+
id "org.asciidoctor.jvm.convert" version "3.3.2"
150+
}
151+
152+
configurations {
153+
asciidoctorExt <2>
150154
}
151155
152156
dependencies {
153-
asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor:{project-version}' <2>
154-
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:{project-version}' <3>
157+
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor:{project-version}' <3>
158+
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:{project-version}' <4>
155159
}
156160
157-
ext { <4>
161+
ext { <5>
158162
snippetsDir = file('build/generated-snippets')
159163
}
160164
161-
test { <5>
165+
test { <6>
162166
outputs.dir snippetsDir
163167
}
164168
165-
asciidoctor { <6>
166-
inputs.dir snippetsDir <7>
167-
dependsOn test <8>
169+
asciidoctor { <7>
170+
inputs.dir snippetsDir <8>
171+
configurations 'asciidoctorExt' <9>
172+
dependsOn test <10>
168173
}
169174
----
170175
<1> Apply the Asciidoctor plugin.
171-
<2> Add a dependency on `spring-restdocs-asciidoctor` in the `asciidoctor` configuration.
172-
This will automatically configure the `snippets` attribute for use in your `.adoc` files
173-
to point to `build/generated-snippets`. It will also allow you to use the `operation`
174-
block macro.
175-
<3> Add a dependency on `spring-restdocs-mockmvc` in the `testImplementation`
176+
<2> Declare the `asciidoctorExt` configuration for dependencies that extend Asciidoctor.
177+
<3> Add a dependency on `spring-restdocs-asciidoctor` in the `asciidoctorExt`
178+
configuration. This will automatically configure the `snippets` attribute for use in your
179+
`.adoc` files to point to `build/generated-snippets`. It will also allow you to use the
180+
`operation` block macro.
181+
<4> Add a dependency on `spring-restdocs-mockmvc` in the `testImplementation`
176182
configuration. If you want to use `WebTestClient` or REST Assured rather than MockMvc,
177183
add a dependency on `spring-restdocs-webtestclient` or `spring-restdocs-restassured`
178184
respectively instead.
179-
<4> Configure a property to define the output location for generated snippets.
180-
<5> Configure the `test` task to add the snippets directory as an output.
181-
<6> Configure the `asciidoctor` task
182-
<7> Configure the snippets directory as an input.
183-
<8> Make the task depend on the test task so that the tests are run before the
184-
documentation is created.
185+
<5> Configure a property to define the output location for generated snippets.
186+
<6> Configure the `test` task to add the snippets directory as an output.
187+
<7> Configure the `asciidoctor` task.
188+
<8> Configure the snippets directory as an input.
189+
<9> Configure the use of the `asciidoctorExt` configuration for extensions.
190+
<10> Make the task depend on the test task so that the tests are run before the
191+
documentation is created.
185192
====
186193

187194
[[getting-started-build-configuration-packaging-the-documentation]]

0 commit comments

Comments
 (0)