Skip to content

Commit acd60c7

Browse files
committed
Polish "Document how to use org.asciidoctor.jvm.convert Gradle plugin"
See gh-744
1 parent 0952e5f commit acd60c7

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

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

+18-17
Original file line numberDiff line numberDiff line change
@@ -150,43 +150,44 @@ macro.
150150
}
151151
152152
configurations {
153-
asciidoctorExt
153+
asciidoctorExt <2>
154154
}
155155
156156
dependencies {
157-
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor:{project-version}' <2>
158-
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>
159159
}
160160
161-
ext { <4>
161+
ext { <5>
162162
snippetsDir = file('build/generated-snippets')
163163
}
164164
165-
test { <5>
165+
test { <6>
166166
outputs.dir snippetsDir
167167
}
168168
169-
asciidoctor { <6>
170-
inputs.dir snippetsDir <7>
171-
configurations 'asciidoctorExt' <8>
172-
dependsOn test <9>
169+
asciidoctor { <7>
170+
inputs.dir snippetsDir <8>
171+
configurations 'asciidoctorExt' <9>
172+
dependsOn test <10>
173173
}
174174
----
175175
<1> Apply the Asciidoctor plugin.
176-
<2> Add a dependency on `spring-restdocs-asciidoctor` in the `asciidoctorExt`
176+
<2> Declare the `asciidoctorExt` configuration for dependencies that extend Asciidoctor.
177+
<3> Add a dependency on `spring-restdocs-asciidoctor` in the `asciidoctorExt`
177178
configuration. This will automatically configure the `snippets` attribute for use in your
178179
`.adoc` files to point to `build/generated-snippets`. It will also allow you to use the
179180
`operation` block macro.
180-
<3> Add a dependency on `spring-restdocs-mockmvc` in the `testImplementation`
181+
<4> Add a dependency on `spring-restdocs-mockmvc` in the `testImplementation`
181182
configuration. If you want to use `WebTestClient` or REST Assured rather than MockMvc,
182183
add a dependency on `spring-restdocs-webtestclient` or `spring-restdocs-restassured`
183184
respectively instead.
184-
<4> Configure a property to define the output location for generated snippets.
185-
<5> Configure the `test` task to add the snippets directory as an output.
186-
<6> Configure the `asciidoctor` task.
187-
<7> Configure the snippets directory as an input.
188-
<8> Add the configuration for the Asciidoctor external library extensions.
189-
<9> Make the task depend on the test task so that the tests are run before the
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
190191
documentation is created.
191192
====
192193

0 commit comments

Comments
 (0)