Please take note of the annotation at the end of this document. To generate a html-file: asciidoc3 -n -a icons -a latexmath cheatsheet.txt. Do not try a2x3 -f pdf cheatsheet.txt, because the plain source yields just an (html-)example and not valid DocBook. Download a PDF here. This document will be updated from time to time.
Titles Headlines
== Level 1
Text here!
=== Level 2
More text.
==== Level 3
More and more text.
===== Level 4
This is the end.
Level 1
Text here!
Level 2
More text.
Level 3
More and more text.
Level 4
This is the end.
Level 1
------
Text here!
Level 2
~~~~~~~
More text.
Level 3
^^^^^^^
More and more text.
Level 4
+++++++
This is the end.
Level 1
Text here!
Level 2
More text.
Level 3
More and more text.
Level 4
This is the end.
Formatting Text
[red]#red text# [yellow-background]#on yellow#
[big]#large# [red yellow-background big]*all bold*
red text on yellow large all bold
forced +
line break
forced
line break
normal, _italic_, *bold*, +mono+.
``double quoted'', `single quoted'.
normal, ^super^, ~sub~.
normal, italic, bold, mono
.
„double quoted“, ‚single quoted‘.
normal, super, sub.
Command: `ls -al`
+mono *bold*+
`passthru *bold*`
Command: ls -al
mono bold
passthru *bold*
Path: '/some/filez.txt', '.b'
Path: /some/filez.txt, .b
Chars: n__i__**b**++m++[red]##r##
Chars: nibm
r
// Comment
empty
(C) (R) (TM) -- ... -> <- => <= ¶
© ® ™ — … → ← ⇒ ⇐ ¶
''''
(Did you notice? The four '''' produce a horizontal bar.)
Escaped:
\_italic_, +++_italic_+++,
t\__e__st, +++t__e__st+++,
+++<b>bold</b>+++, $$<b>normal</b>$$
\¶
\`not single quoted'
\`\`not double quoted''
Escaped: _italic_, _italic_, t__e__st, t__e__st, bold, <b>normal</b> ¶ `not single quoted' ``not double quoted''
[underline]#Underline text#, [overline]#overline text# and
[blue line-through]*bold blue and line-through*.
Underline text, overline text and bold blue and line-through.
Images
To insert images inline use the image macro:
and now the tiger image:../images/tiger.png[alt="Tiger",height=35] comes along.
and now the tiger comes along. Give the absolute or relative path to the source or use the imagedir attribute. The optional align attribute aligns block macro images horizontally. Allowed values are center, left and right. For example:
image::../images/tiger.png["Tiger image",height=40, align="right"]
Please look for some additional options in the userguide, section "images".
Paragraphs and Admonitions
.Optional Title
Usual
paragraph.
Usual paragraph.
.Optional Title
Literal paragraph.
Must be indented.
Literal paragraph.
Must be indented.
.Optional Title
[source,python]
print('hello again')
This is normal text.
print('hello again')
This is normal text.
.Optional Title
NOTE: This is an example
single-paragraph note.
Optional Title This is an example
single-paragraph note. |
.Optional Title
[NOTE]
This is an example
single-paragraph note.
Optional Title This is an example
single-paragraph note. |
TIP: Tip.
Tip. |
IMPORTANT: Important.
Important. |
WARNING: Warning.
Warning. |
CAUTION: Caution.
Caution. |
Blocks
.Optional Title
----
*Listing* Block
Use: code or file listings
----
Start the four - hard against the left margin! The space here is to prevent asciidoc3 from interpreting the - as a nested listing block. |
*Listing* Block
Use: code or file listings
.Optional Title
[source,perl]
----
# *Source* block
# Use: highlight code listings
# (require `source-highlight` or `pygmentize`)
use DBI;
my \$dbh = DBI->connect('...',\$u,\$p)
or die "connect: \$dbh->errstr";
----
Start the four - hard against the left margin! The space here is to prevent asciidoc3 from interpreting the - as a nested listing block. |
# *Source* block
# Use: highlight code listings
# (require `source-highlight` or `pygmentize`)
use DBI;
my $dbh = DBI->connect('...',$u,$p)
or die "connect: $dbh->errstr";
.Optional Title
****
*Sidebar* Block
Use: sidebar notes :)
****
.Optional Title
==========================
*Example* Block
Use: examples :)
Default caption "Example:"
can be changed using
[caption="Custom: "]
before example block.
==========================
Example Block
Use: examples :)
Default caption "Example:" can be changed using
[caption="Custom: "]
before example block.
.Optional Title
[NOTE]
===============================
*NOTE* Block
Use: multi-paragraph notes.
===============================
Optional Title
NOTE Block Use: multi-paragraph notes. |
////
*Comment* block
Use: hide comments
////
(this is empty space, because the coment block is not processed)
++++
*Passthrough* Block
<p>
Use: backend-specific markup like
<table border="1">
<tr><td>1<td>2</tr>
</table>
++++
Use: backend-specific markup like
1 | 2 |
.Optional Title
....
*Literal* Block
Use: workaround when literal
paragraph (indented) like
1. First.
2. Second.
incorrectly processed as list.
....
.Optional Title
....
*Literal* Block
Use: workaround when literal
paragraph (indented) like
1. First.
2. Second.
incorrectly processed as list.
....
.Optional Title
[quote, cite author, cite source]
____
*Quote* Block
Use: cite somebody. To be or not to be ...
____
Quote Block
Use: cite somebody. To be or not to be …
— cite author
Lists
.Bulleted
* bullet
* bullet
- bullet
- bullet
* bullet
** bullet
** bullet
*** bullet
*** bullet
**** bullet
**** bullet
***** bullet
***** bullet
**** bullet
*** bullet
** bullet
* bullet
-
bullet
-
bullet
-
bullet
-
bullet
-
-
bullet
-
bullet
-
bullet
-
bullet
-
bullet
-
bullet
-
bullet
-
bullet
-
bullet
-
-
bullet
-
-
bullet
-
-
bullet
-
-
bullet
.Bulleted 2
- bullet
* bullet
-
bullet
-
bullet
-
[horizontal]
.Labeled horizontal
Term 1:: Definition 1
Term 2:: Definition 2
[horizontal]
Term 2.1;;
Definition 2.1
Term 2.2;;
Definition 2.2
Term 3::
Definition 3
Term 4:: Definition 4
[horizontal]
Term 4.1::: Definition 4.1
Term 4.2::: Definition 4.2
[horizontal]
Term 4.2.1:::: Definition 4.2.1
Term 4.2.2:::: Definition 4.2.2
Term 4.3::: Definition 4.3
Term 5:: Definition 5
Term 1
|
Definition 1 |
||||||||||
Term 2
|
Definition 2
|
||||||||||
Term 3
|
Definition 3 |
||||||||||
Term 4
|
Definition 4
|
||||||||||
Term 5
|
Definition 5 |
See more examples in the userguide. |
Tables
.Title
[width="15%"]
|=======
|1 |2 |A
|3 |4 |B
|5 |6 |C
|=======
1 |
2 |
A |
3 |
4 |
B |
5 |
6 |
C |
.An example table with title, header and footer
[width="40%",frame="topbot",options="header,footer"]
|======================
|Column 1 |Column 2
|1 |Item 1
|2 |Item 2
|3 |Item 3
|6 |Three items
|======================
Column 1 | Column 2 |
---|---|
6 |
Three items |
1 |
Item 1 |
2 |
Item 2 |
3 |
Item 3 |
1 |
2 |
3 |
4 |
5 |
|
|
|
8 |
|||
9 |
|
.Spans, alignments and styles
[cols="e,m,^,>s",width="25%"]
|================
|1 >s|2 |3 |4
^|5 2.2+^.^|6 .3+<.>m|7
^|8
|9 2+>|10
|================
See more examples here: ./tests/data/newtables(_docbook51).txt |
Formulas
Some example LaTeXMathML formulas, see ./doc/latexmathml.txt for more infos and the source. And take a look to asciimathml.txt and latex-filter.txt to learn about other ways to produce formulae, also in PDFs.
Annotation
This summary of some features of AsciiDoc3 was inspired by the Asciidoc Cheat Sheet from powerman. We added some additional information and a few new tricks …
This is only "the tip of the iceberg" - see the userguide ./doc/userguide.txt or online and browse the directories ./doc/-.- and ./tests/data/-.- for many more examples.
(c) 2020-2023 by Berthold Gehrke berthold.gehrke@gmail.com Given to the Public Domain - if not applicable: MIT license.