diff --git a/docs/src/docs/asciidoc/getting-started.adoc b/docs/src/docs/asciidoc/getting-started.adoc index 614036d6..1f4602b4 100644 --- a/docs/src/docs/asciidoc/getting-started.adoc +++ b/docs/src/docs/asciidoc/getting-started.adoc @@ -211,9 +211,6 @@ The `snippets` attribute specified in the <> can be used to reference the snippets output directory, for example: [source,adoc,indent=0] -.... -[source,bash] ---- \include::{snippets}/index/curl-request.adoc[] ---- -.... diff --git a/docs/src/docs/asciidoc/index.adoc b/docs/src/docs/asciidoc/index.adoc index f5f245c9..784fed0f 100644 --- a/docs/src/docs/asciidoc/index.adoc +++ b/docs/src/docs/asciidoc/index.adoc @@ -20,4 +20,5 @@ include::introduction.adoc[] include::getting-started.adoc[] include::documenting-your-api.adoc[] include::customizing-responses.adoc[] -include::configuration.adoc[] \ No newline at end of file +include::configuration.adoc[] +include::working-with-asciidoctor.adoc[] \ No newline at end of file diff --git a/docs/src/docs/asciidoc/working-with-asciidoctor.adoc b/docs/src/docs/asciidoc/working-with-asciidoctor.adoc new file mode 100644 index 00000000..33824f45 --- /dev/null +++ b/docs/src/docs/asciidoc/working-with-asciidoctor.adoc @@ -0,0 +1,75 @@ +[[working-with-asciidoctor]] +== Working with Asciidoctor + +This section describes any aspects of working with Asciidoctor that are particularly +relevant to Spring REST Docs. + + + +[[working-with-asciidoctor-resources]] +=== Resources + + * http://asciidoctor.org/docs/asciidoc-syntax-quick-reference[Syntax quick reference] + * http://asciidoctor.org/docs/user-manual[User manual] + + + +[[working-with-asciidoctor-including-snippets]] +=== Including snippets + +The http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#include-files[include +macro] is used to include generated snippets in your documentation. The `snippets` +attribute specified in the <> +can be used to reference the snippets output directory, for example: + +[source,adoc,indent=0] +---- +\include::{snippets}/index/curl-request.adoc[] +---- + + + +[[working-with-asciidoctor-customizing-tables]] +=== Customizing tables + +Many of the snippets contain a table in its default configuration. The appearance of the +table can be customized by providing some additional configuration when the snippet is +included. + + + +[[working-with-asciidoctor-customizing-tables-formatting-columns]] +==== Formatting columns + +Asciidoctor has rich support for http://asciidoctor.org/docs/user-manual/#cols-format +[formatting a table's columns]. For example, the widths of a table's columns can be +specified using the `cols` attribute: + +[source,adoc,indent=0] +---- +[cols=1,3] <1> +\include::{snippets}index/links.adoc[] +---- +<1> The table's width will be split across its two columns with the second column being +three times as wide as the first. + + + +[[working-with-asciidoctor-customizing-tables-title]] +==== Configuring the title + +The title of a table can be specified using a line prefixed by a `.`: + +[source,adoc,indent=0] +---- +.Links <1> +\include::{snippets}index/links.adoc[] +---- +<1> The table's title will be `Links`. + + + +==== Further reading + +Refer to the http://asciidoctor.org/docs/user-manual/#tables[Tables section of +the Asciidoctor user manual] for more information about customizing tables. \ No newline at end of file