forked from cheat/cheatsheets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
asciidoctor
128 lines (105 loc) · 2.24 KB
/
asciidoctor
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# headers
= h1 header
== h2 header
# blocks
[quote, Somebody, Who is somebody]
____
Quote something
____
//
NOTE: Some note
//
[WARNING]
====
Some warning
====
# lists
.Un-ordered list with a title
* list item
** sub-list item
- hypen as sub-sub-list item
+
that continues at the next line
- {blank}
+
----
complex content of an item
----
[%reversed,start=4]
.Ordered list; reversed, started at 4
. ordered list item
.. ordered list sub-item
. another list item
# separating adjacent lists (surrounded by blank lines)
//-
# checklist
- [*] checked
- [x] also checked
- [ ] not checked
Description list item:: definition
[horizontal]
Description list item #2:: definition
# links
Automatic link http://example.com or
http://example.com[link with title and attributes,role=external,window=_blank]
link:../README.adoc[Relative link to open the README file]
# cross reference links
[[an-anchor]]inline anchor, [#other-anchor]#applied to a phrase#
Reference to <<an-anchor>> or to <<other-anchor,the other anchor>>
# image
image:image.png[Alt text, title="Inline image"]
.Block image title
[caption="Figure 1: ",link=http://example.com/image.png]
image::image.jpg[Alt text, 300, 200]
# code
....
literal block
....
:variable: 123
.Source code title
[source,asciidoc,subs="+quotes,attributes+",options="nowrap"]
----
:toc: right # <1>
// with var substitution (attributes+)
:variable: definition, the value is {variable}
// with the markup substitution (+quotes)
// no wrapping long lines (nowrap)
----
<1> Asciidoctor sytax for the table of content
# include source code, stripping indentation
[source,asciidoc,indent=0]
----
include::doc/document.adoc[lines=5..10]
----
# formatting
*bold*, **un**constrained
_italic_, __un__constrained
`monospace`, ``un``constrained
`[underline]#Underline text#`
`[overline]#overline text#`
`[line-through]#strikethrough#`
`[blue line-through]*bold blue and line-through*.`
# comment
// text in the comment
# horizontal rules (hr)
'''
Non-breaking space {nbsp}
Break at the end of +
line
# tables
.Table title
[caption="Table 2: "]
|===
| Name | Description
//
| Asciidoctor
| Awesome way to write documentation
//
2+| This cell spans 2 columns
//
.2+| This cell spans 2 rows
//
| Line at the side of the spanned rows
| Another line
//
|===