์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- Spring Security
- ํ๊ณ
- CSS
- ์ฒซ๊ธ์๋๋ฌธ์
- ๋ฐฑ์๋
- ์ธํ ๋ฆฌ์ ์ด
- ๋ฌธ์์ด๋ค์ง๊ธฐ
- CLI๋ช ๋ น์ด
- ์ ๋ค๋ฆญ์ค
- testing
- ๋ถํธ์บ ํ
- Spring Data JDBC
- ๋ฐ์ผ๋ฆฌ์ฝ๋ฉ
- ๊ฑฐ๋ญ์ ๊ณฑ
- ์๊ณ ๋ฆฌ์ฆ
- spring data jpa
- Publishing
- ๊นํ๋ธ
- ํ์ดํ๋ก๊ทธ๋๋ฐ
- ์๋ฐ
- ์๋ฃ๊ตฌ์กฐ
- java
- ์ปฌ๋ ์ ํ๋ ์์ํฌ
- fibonacci
- ๋ฐฑ์ค์๊ณ ๋ฆฌ์ฆ
- HTML
- ์คํ๋ง
- ๊ทธ๋ฆฌ๋
- ๊ณ์ฐ๊ธฐ๋ง๋ค๊ธฐ
- FilterChain
- Today
- Total
๋์ ๋ชจ์
058 | Asciidocs, Asciidoctor ๋ณธ๋ฌธ
๐ Asciidoc
Asciidoc์ Spring Rest Docs๋ฅผ ํตํด ์์ฑ๋๋ ํ ์คํธ ๊ธฐ๋ฐ ๋ฌธ์๋ก, ๊ธฐ์ ๋ฌธ์ ์์ฑ์ ์ํด ์ค๊ณ๋ ๋งํฌ๋ค์ด ์ธ์ด์ด๋ค.
๐งฉ ๋ชฉ์ฐจ
= ๋ฌธ์ ์ ๋ชฉ
:sectnum:
:toc: left
:toclevels: 1~6
:toc-title: ํ์ดํ
:source-highlighter: prettify
- = ๋ฌธ์ ์ ๋ชฉ: Ascii ๋ฌธ๋ฒ์ผ๋ก ๋ชฉ์ฐจ๋ฅผ ๊ตฌ์ฑํ๋ค.
- :sectnum:: ๊ฐ ์น์ ์ ๋๋ฒ๋ง์ ํ๋ค.
- :toc: left: ๋ฌธ์์ ๋ชฉ์ฐจ๋ฅผ ์ด๋์ ๊ตฌ์ฑํ ๊ฒ์ธ์ง ์ ํ๋ค. left๋ ๋ชฉ์ฐจ๋ฅผ ์ผ์ชฝ์ผ๋ก ํ๋ค.
- :toclevels: 3: ๋ชฉ์ฐจ์ ํ์ํ ๊ฐ ์น์ ์ ์ ๋ชฉ์ level(HTML๊ธฐ์ค h1~h6)์ ์ ํ๋ค. 3์ผ๋ก ์ง์ ํ ์ === ๊น์ง์ ์ ๋ชฉ์ ๋ชฉ์ฐจ์ ํฌํจ์ํจ๋ค.
- :toc-title: ํ์ดํ: ๋ชฉ์ฐจ์ ์ ๋ชฉ์ ์ง์ ํ ์ ์๋ค.
- source-highlighter: prettify: ์์ค์ฝ๋ ํ์ด๋ผ์ดํธ๋ฅผ ์ง์ ํ๋ค.
๐งฉ ๋ฐ์ค ๋ฌธ๋จ
***
๋ฌธ๋จ ์ ๋ชฉ
๋ฌธ๋จ์ ๋ด์ฉ์ด๋ค. Spring MVC ๊ธฐ๋ฐ์ REST API ๊ธฐ๋ฐ ์ ํ๋ฆฌ์ผ์ด์
์ ๊ณต๋ถํ๊ณ ์๋ค.
CAUTION: ๊ฒฝ๊ณ ๋ฌธ๊ตฌ ๊ธฐ์ฌ
***
- ***: ๋จ๋ฝ์ ๊ตฌ๋ถ์ง๋ ์ํ์ ์ ์ถ๊ฐํด์ค๋ค.
- : ๋ฌธ๋จ ์ ๋ชฉ ๋ค์ ํ ์ค ๋์ฐ๊ณ ํ ์นธ ๋ค์ฌ์ฐ๊ธฐ๋ฅผ ํ๋ฉด ๋ฐ์ค ๋ฌธ๋จ์ ์ฌ์ฉํ ์ ์๋ค.
- CAUTION: ๊ฒฝ๊ณ ๋ฌธ๊ตฌ๋ฅผ ์ถ๊ฐํ ์ ์๋ค. NOTE:, TIP:, IMPORTANT:, WARNING: ๋ฑ์ ์ฌ์ฉํ ์ ์๋ค.
๐ Asciidoctor
Spring Rest Docs์์ Asciidoc ํฌ๋งท์ ๋ฌธ์๋ฅผ ํ์ฑํด์ HTML 5, ๋งค๋ด์ผ ํ์ด์ง, PDF ๋ฐ EPUB 3 ๋ฑ์ ํ์ผ๋ก ๋ณํํ ๋ฌธ์๋ฅผ ์์ฑํ๋ ํด์ด๋ค.
๐งฉ ๋ฌธ์ ์ค๋ํ
Spring Rest Docs ํ ์คํธ์ผ์ด์ค๋ฅผ ์ ๋ถ ํต๊ณผํ๋ฉด build/generated-snippets/idenntifier ๋๋ ํ ๋ฆฌ์ .adoc ์ค๋ํ ๋ฌธ์๊ฐ ์์ฑ๋๋ค.
Gradle์์ task > build๋ฅผ ์คํํ๋ฉด Asciidoctor๊ฐ ๊ฐ๊ฐ์ ์คํผ๋ ๋ฌธ์๋ค์ ๋ชจ์ index.adoc โ index.html, ํ๋์ html ํ์ผ๋ก ๋ณํ ํ ํน์ ๋๋ ํ ๋ฆฌ(src/main/resources/static/docs)์ ์ ์ฅํด์ค๋ค.
- index.adoc์ ์คํผ๋ ํฌํจํ๊ธฐ
.snippet1
include::{snippets}/identifier/snippet1.adoc[]
.snippet2
include::{snippets}/identifier/snippet2.adoc[]
- .snippet: ์ค๋ํ ์ ๋ชฉ ํํ
- include::{snippets}/identifier/snippet.adoc[]
- include: Asciidoctor์์ ์ฌ์ฉํ๋ ๋งคํฌ๋ก๋ก, ์ค๋ํ์ ๋ฌธ์์ ํฌํจํ ๋ ์ฌ์ฉํ๋ค.
- ::: ๋งคํฌ๋ก๋ฅผ ์ฌ์ฉํ๋ค.
- {snippets}: ํด๋น ์ค๋ํ์ด ์์ฑ๋๋ ๋ํดํธ ๊ฒฝ๋ก์ด๋ฉฐ build.gradle์ ์ค์ ํ snippersDir ๋ณ์๋ฅผ ์ฐธ์กฐํ๋๋ฐ ์ฌ์ฉํ ์ ์๋ค.
โ Ref.
https://docs.spring.io/spring-restdocs/docs/current/reference/html5/#working-with-asciidoctor
Spring REST Docs
Document RESTful services by combining hand-written documentation with auto-generated snippets produced with Spring MVC Test, WebTestClient, or REST Assured.
docs.spring.io
https://docs.asciidoctor.org/asciidoc/latest/toc/
AsciiDoc - Automatic Table of Contents
A documentation page for AsciiDoc.
docs.asciidoctor.org
'SEB > TIL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
067 | Spring Security - OAuth 2.0 Authentication (0) | 2022.09.28 |
---|---|
061 | ์ธ์ฆ๋ณด์ ๊ธฐ์ด (0) | 2022.09.20 |
057 | API Documentation, Swagger, SpringRest (0) | 2022.09.14 |
052 | Transaction (0) | 2022.09.05 |
046 | Spring Data JDBC (0) | 2022.08.26 |