AsciiDoc
Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
GitLab은 Asciidoctor gem을 사용하여 AsciiDoc 콘텐츠를 HTML5로 변환합니다. AsciiDoc은 다음 영역에서 사용할 수 있습니다: //로 시작하는 줄인 줄 주석은 건너뜁니다: [%hardbreaks] 옵션이 있는 단락은 줄바꿈을 유지합니다:
GitLab은 Asciidoctor gem을 사용하여 AsciiDoc 콘텐츠를 HTML5로 변환합니다. 전체 참조는 Asciidoctor 사용자 매뉴얼을 참조하세요.
AsciiDoc은 다음 영역에서 사용할 수 있습니다:
- 위키 페이지
- 저장소 내 AsciiDoc 문서(
.adoc또는.asciidoc)
단락#
A normal paragraph.
Line breaks are not preserved.
//로 시작하는 줄인 줄 주석은 건너뜁니다:
// this is a comment
빈 줄이 단락을 구분합니다.
[%hardbreaks] 옵션이 있는 단락은 줄바꿈을 유지합니다:
[%hardbreaks]
This paragraph carries the `hardbreaks` option.
Notice how line breaks are now preserved.
들여쓰기된(리터럴) 단락은 텍스트 서식을 비활성화하고, 공백과 줄바꿈을 유지하며, 고정 너비 글꼴로 표시됩니다:
This literal paragraph is indented with one space.
As a consequence, *text formatting*, spaces,
and lines breaks will be preserved.
주의 단락은 독자의 주의를 끕니다:
NOTE: This is a brief reference, read the full documentation at https://asciidoctor.org/docs/.TIP: Lists can be indented. Leading whitespace is not significant.
텍스트 서식#
-
제한됨(단어 경계에 적용됨):
*strong importance* (aka bold) _stress emphasis_ (aka italic) `monospaced` (aka typewriter text) "`double`" and '`single`' typographic quotes +passthrough text+ (substitutions disabled) `+literal text+` (monospaced with substitutions disabled) -
비제한됨(어디에나 적용됨):
**C**reate+**R**ead+**U**pdate+**D**elete fan__freakin__tastic ``mono``culture -
대체:
A long time ago in a galaxy far, far away... (C) 1976 Arty Artisan I believe I shall--no, actually I won't. -
매크로:
// where c=specialchars, q=quotes, a=attributes, r=replacements, m=macros, p=post_replacements The European icon:flag[role=blue] is blue & contains pass:[************] arranged in a icon:circle-o[role=yellow]. The pass:c[->] operator is often referred to as the stabby lambda. Since `pass:[++]` has strong priority in AsciiDoc, you can rewrite pass:c,a,r[C++ => C{pp}]. // activate stem support by adding `:stem:` to the document header stem:[sqrt(4) = 2]
링크#
https://example.org/page[A webpage]
link:../path/to/file.txt[A local file]
xref:document.adoc[A sibling document]
mailto:hello@example.org[Email to say hello!]
앵커#
[[idname,reference text]]
// or written using normal block attributes as `[#idname,reftext=reference text]`
A paragraph (or any block) with an anchor (aka ID) and reftext.
See <<idname>> or <<idname,optional text of internal link>>.
xref:document.adoc#idname[Jumps to anchor in another document].
This paragraph has a footnote.footnote:[This is the text of the footnote.]
목록#
순서 없는#
* level 1
** level 2
*** level 3
**** level 4
***** level 5
* back at level 1
+
Attach a block or paragraph to a list item using a list continuation (which you can enclose in an open block).
.Some Authors
[circle]
- Edgar Allen Poe
- Sheri S. Tepper
- Bill Bryson
순서 있는#
. Step 1
. Step 2
.. Step 2a
.. Step 2b
. Step 3
.Remember your Roman numerals?
[upperroman]
. is one
. is two
. is three
체크리스트#
* [x] checked
* [ ] not checked
콜아웃#
// enable callout bubbles by adding `:icons: font` to the document header
[,ruby]
----
puts 'Hello, World!' # <1>
----
<1> Prints `Hello, World!` to the console.
설명#
first term:: description of first term
second term::
description of second term
헤더#
= Document Title
Author Name <author@example.org>
v1.0, 2019-01-01
섹션#
= Document Title (Level 0)
== Level 1
=== Level 2
==== Level 3
===== Level 4
====== Level 5
== Back at Level 1
포함#
AsciiDoc 형식으로 생성된 위키 페이지는 .asciidoc 파일 확장자로 저장됩니다. AsciiDoc 위키 페이지를 작업할 때 파일 이름을 .adoc에서 .asciidoc로 변경하세요.
include::basics.adoc[]
// you can also include other files from you repository
[,language]
----
include::my_code_file.language[]
----
시스템 성능을 보장하고 악성 문서로 인한 문제를 방지하기 위해 GitLab은 모든 문서에서 처리되는 포함 지시자 수의 최대 한계를 적용합니다. 기본적으로 문서는 전이적 의존성을 포함하여 최대 32개의 포함 지시자를 가질 수 있습니다. 처리되는 포함 지시자의 수를 사용자 정의하려면 애플리케이션 설정 API를 사용하여 asciidoc_max_includes 애플리케이션 설정을 변경하세요.
asciidoc_max_includes의 현재 최대 허용값은 64입니다. 값이 너무 높으면 일부 상황에서 성능 문제가 발생할 수 있습니다.
별도 페이지 또는 외부 URL의 포함을 사용하려면 애플리케이션 설정에서 allow-uri-read를 활성화하세요.
// define application setting allow-uri-read to true to allow content to be read from URI
include::https://example.org/installation.adoc[]
속성#
사용자 정의#
// define attributes in the document header
:name: value
:url-gem: https://rubygems.org/gems/asciidoctor
You can download and install Asciidoctor {asciidoctor-version} from {url-gem}.
C{pp} is not required, only Ruby.
Use a leading backslash to output a word enclosed in curly braces, like \{name}.
환경#
GitLab은 다음 환경 속성을 설정합니다:
| 속성 | 설명 |
|---|---|
docname |
소스 문서의 루트 이름(선행 경로 또는 파일 확장자 없음). |
outfilesuffix |
백엔드 출력에 해당하는 파일 확장자(기본값은 .adoc으로 문서 간 교차 참조가 작동하도록 함). |
블록#
--
open - a general-purpose content wrapper; useful for enclosing content to attach to a list item
--
// recognized types include CAUTION, IMPORTANT, NOTE, TIP, and WARNING
// enable admonition icons by setting `:icons: font` in the document header
[NOTE]
====
admonition - a notice for the reader, ranging in severity from a tip to an alert
====
====
example - a demonstration of the concept being documented
====
.Toggle Me
[%collapsible]
====
collapsible - these details are revealed by clicking the title
====
****
sidebar - auxiliary content that can be read independently of the main content
****
....
literal - an exhibit that features program output
....
----
listing - an exhibit that features program input, source code, or the contents of a file
----
[,language]
----
source - a listing that is embellished with (colorized) syntax highlighting
----
\```language
fenced code - a shorthand syntax for the source block
\```
[,attribution,citetitle]
____
quote - a quotation or excerpt; attribution with title of source are optional
____
[verse,attribution,citetitle]
____
verse - a literary excerpt, often a poem; attribution with title of source are optional
____
++++
pass - content passed directly to the output document; often raw HTML
++++
// activate stem support by adding `:stem:` to the document header
[stem]
++++
x = y^2
++++
////
comment - content which is not included in the output document
////
표#
.Table Attributes
[cols=>1h;2d,width=50%,frame=topbot]
|===
| Attribute Name | Values
| options
| header,footer,autowidth
| cols
| colspec[;colspec;...]
| grid
| all \| cols \| rows \| none
| frame
| all \| sides \| topbot \| none
| stripes
| all \| even \| odd \| none
| width
| (0%..100%)
| format
| psv {vbar} csv {vbar} dsv
|===
색상#
HEX, RGB, 또는 HSL 형식으로 작성된 색상을 색상 표시기로 렌더링할 수 있습니다. 지원 형식(명명된 색상은 지원되지 않음):
HEX:`#RGB[A]`또는`#RRGGBB[AA]`RGB:`RGB[A](R, G, B[, A])`HSL:`HSL[A](H, S, L[, A])`
백틱 안에 작성된 색상 뒤에 색상 "칩"이 표시됩니다:
- `#F00`
- `#F00A`
- `#FF0000`
- `#FF0000AA`
- `RGB(0,255,0)`
- `RGB(0%,100%,0%)`
- `RGBA(0,255,0,0.3)`
- `HSL(540,70%,50%)`
- `HSLA(540,70%,50%,0.3)`
방정식 및 수식#
과학, 기술, 공학, 수학(STEM) 표현식을 포함해야 하는 경우, 문서 헤더에서 stem 속성을 latexmath로 설정하세요. 방정식과 수식은 KaTeX를 사용하여 렌더링됩니다:
:stem: latexmath
latexmath:[C = \alpha + \beta Y^{\gamma} + \epsilon]
[stem]
++++
sqrt(4) = 2
++++
A matrix can be written as stem:[[[a,b\],[c,d\]\]((n),(k))].
다이어그램과 순서도#
GitLab에서는 Mermaid 또는 PlantUML을 사용하여 텍스트에서 다이어그램과 순서도를 생성할 수 있습니다.
Mermaid#
자세한 내용은 공식 페이지를 참조하세요. Mermaid를 처음 사용하거나 Mermaid 코드의 문제를 식별하는 데 도움이 필요하면 Mermaid 라이브 편집기가 Mermaid 다이어그램 생성 및 문제 해결에 유용한 도구입니다.
다이어그램이나 순서도를 생성하려면 mermaid 블록에 텍스트를 입력합니다:
[mermaid]
----
graph LR
A[Square Rect] -- Link text --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
----
Kroki#
Kroki는 12개 이상의 다이어그램 라이브러리를 지원합니다. GitLab에서 Kroki를 사용하려면 GitLab 관리자가 먼저 활성화해야 합니다. 자세한 내용은 Kroki 통합 페이지를 참조하세요.
Kroki가 활성화되면 AsciiDoc 및 Markdown 문서에서 다이어그램을 생성할 수 있습니다. 다음은 GraphViz 다이어그램을 사용한 예시입니다:
-
AsciiDoc:
[graphviz] .... digraph G { Hello->World } .... -
Markdown:
```graphviz digraph G { Hello->World } ```
PlantUML#
PlantUML 통합은 GitLab.com에서 활성화되어 있습니다. GitLab Self-Managed 설치에서 PlantUML을 사용하려면 GitLab 관리자가 활성화해야 합니다.
PlantUML이 활성화되면 plantuml 블록에 텍스트를 입력합니다:
[plantuml]
----
Bob -> Alice : hello
----
별도 파일에 저장된 PlantUML 다이어그램을 포함하려면:
[plantuml, format="png", id="myDiagram", width="200px"]
----
include::diagram.puml[]
----
멀티미디어#
image::screenshot.png[block image,800,450]
Press image:reload.svg[reload,16,opts=interactive] to reload the page.
video::movie.mp4[width=640,start=60,end=140,options=autoplay]
GitLab은 AsciiDoc 콘텐츠에서 YouTube 및 Vimeo 동영상 임베딩을 지원하지 않습니다. 표준 AsciiDoc 링크를 사용하세요:
https://www.youtube.com/watch?v=BlaZ65-b7y0[Link text for the video]
줄바꿈#
// thematic break (aka horizontal rule)
---
// page break
<<<
목차#
= Document Title (Level 0)
:toc:
:toclevels: 3
:toc-title: Contents
== Level 1
=== Level 2
==== Level 3
===== Level 4
====== Level 5
== Back at Level 1
:toc-class:, :toc: left, :toc: right 속성은 지원되지 않습니다.
