AsciiDoc3 cheatsheet v2.0

Titles Headlines ๐Ÿž™ Formatting Text ๐Ÿž™ Images ๐Ÿž™ Paragraphs and Admonitions ๐Ÿž™ Blocks ๐Ÿž™ Lists ๐Ÿž™ Tables ๐Ÿž™ Formulas

empty

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.
The items are divided by the AsciiDoc3 logo. At first in the box is shown the plain code, followed by the HTML output.

AsciiDoc3 Logo

Titles Headlines

== Level 1
Text here!

=== Level 2
More text.

==== Level 3
More and more text.

===== Level 4
This is the end.

empty

Level 1

Text here!

Level 2

More text.

Level 3

More and more text.

Level 4

This is the end.

empty

AsciiDoc3 Logo

Level 1
 ------
Text here! (begin the --- hard against the margin!)

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.

empty

AsciiDoc3 Logo

Formatting Text

[red]#red text# [yellow-background]#on yellow#
[big]#large# [red yellow-background big]*all bold*

red text on yellow large all bold

empty

forced +
line break

forced
line break

empty

normal, _italic_, *bold*, +mono+.

``double quoted'', `single quoted'.

normal, ^super^, ~sub~.

normal, italic, bold, mono.

โ€œdouble quotedโ€, โ€˜single quotedโ€™.

normal, super, sub.

empty

Command: `ls -al`

+mono *bold*+

`passthru *bold*`

Command: ls -al

mono bold

passthru *bold*

empty

Path: '/some/filez.txt', '.b'

Path: /some/filez.txt, .b

empty

Chars: n__i__**b**++m++[red]##r##

Chars: nibmr

empty

// Comment

empty

empty

AsciiDoc3 Logo

(C) (R) (TM) -- ... -> <- => <= &#182;

ยฉ ยฎ โ„ขโ€‰โ€”โ€‰โ€ฆ โ†’ โ† โ‡’ โ‡ ยถ

AsciiDoc3 Logo

''''

(Did you notice? The four '''' produce a horizontal bar.)

AsciiDoc3 Logo

empty

Escaped:
\_italic_, +++_italic_+++,
t\__e__st, +++t__e__st+++,
+++<b>bold</b>+++, $$<b>normal</b>$$
\&#182;
\`not single quoted'
\`\`not double quoted''

Escaped: _italic_, _italic_, t__e__st, t__e__st, bold, <b>normal</b> &#182; `not single quoted' ``not double quoted''

AsciiDoc3 Logo

[underline]#Underline text#, [overline]#overline text# and
[blue line-through]*bold blue and line-through*.

empty

Underline text, overline text and bold blue and line-through.

empty

AsciiDoc3 Logo

Images

To insert images inline use the image macro:

and now the tiger image:tiger.png[alt="Tiger",height=35] comes along.

and now the tiger 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::tiger.png["Tiger image",height=40, align="right"]
Tiger image
Warning Seems not to work correctly due to the HUGO rendering. Will be updated asap โ€ฆ

Please look for some additional options in the userguide, section "images".

empty

AsciiDoc3 Logo

Paragraphs and Admonitions

.Optional Title

Usual
paragraph.
Optional Title

Usual paragraph.

empty

.Optional Title

 Literal paragraph.
  Must be indented.

empty

Optional Title
Literal paragraph.
 Must be indented.

empty

AsciiDoc3 Logo

.Optional Title

[source,python]
print('hello again')

This is normal text.

empty

Optional Title
print('hello again')

This is normal text.

empty

AsciiDoc3 Logo

.Optional Title
NOTE: This is an example
      single-paragraph note.
Note
Optional Title
This is an example single-paragraph note.

empty

.Optional Title
[NOTE]
This is an example
single-paragraph note.
Note
Optional Title
This is an example single-paragraph note.
TIP: Tip.
Tip Tip.
IMPORTANT: Important.
Important Important.
WARNING: Warning.
Warning Warning.
CAUTION: Caution.
Caution Caution.

empty

AsciiDoc3 Logo

Blocks

.Optional Title
 ----                  1
*Listing* Block

Use: code or file listings
 ----                  1
1 Start the four - hard against the left margin!

The space here is to prevent asciidoc3 from interpreting the - as a nested listing block.

empty

Optional Title
*Listing* Block

Use: code or file listings

empty

AsciiDoc3 Logo

.Optional Title
[source,perl]
 ----              1
# *Source* block
# Use: highlight code listings
# (require `source-highlight` or `pygmentize`)
use DBI;
my \$dbh = DBI->connect('...',\$u,\$p)
    or die "connect: \$dbh->errstr";
 ----              1
1 Start the four - hard against the left margin!

The space here is to prevent asciidoc3 from interpreting the - as a nested listing block.

Optional Title
# *Source* block
# Use: highlight code listings
# (require `source-highlight` or `pygmentize`)
use DBI;
my $dbh = DBI->connect('...',$u,$p)
    or die "connect: $dbh->errstr";

AsciiDoc3 Logo

.Optional Title
****
*Sidebar* Block

Use: sidebar notes :)
****
Optional Title

Sidebar Block

Use: sidebar notes :)

AsciiDoc3 Logo

.Optional Title
==========================
*Example* Block

Use: examples :)

Default caption "Example:"
can be changed using

 [caption="Custom: "]

before example block.
==========================

empty

Example 1. Optional Title

Example Block

Use: examples :)

Default caption "Example:" can be changed using

[caption="Custom: "]

before example block.

AsciiDoc3 Logo

.Optional Title
[NOTE]
===============================
*NOTE* Block

Use: multi-paragraph notes.
===============================
Note
Optional Title

NOTE Block

Use: multi-paragraph notes.

AsciiDoc3 Logo

////
*Comment* block

Use: hide comments
////

(this is empty space, because the coment block is not processed)

AsciiDoc3 Logo

++++
*Passthrough* Block
<p>
Use: backend-specific markup like
<table border="1">
<tr><td>1<td>2</tr>
</table>
++++
*Passthrough* Block

Use: backend-specific markup like

12

AsciiDoc3 Logo

 .Optional Title
 ....
 *Literal* Block

 Use: workaround when literal
 paragraph (indented) like
   1. First.
   2. Second.
 incorrectly processed as list.
 ....

empty

.Optional Title
....
*Literal* Block
Use: workaround when literal
paragraph (indented) like
  1. First.
  2. Second.
incorrectly processed as list.
....

AsciiDoc3 Logo

.Optional Title
[quote, cite author, cite source]
____
*Quote* Block

Use: cite somebody. To be or not to be ...
____
Optional Title

Quote Block

Use: cite somebody. To be or not to be โ€ฆ

cite source
โ€” cite author

empty

AsciiDoc3 Logo

Lists

.Bulleted
* bullet
* bullet
  - bullet
  - bullet
* bullet
** bullet
** bullet
*** bullet
*** bullet
**** bullet
**** bullet
***** bullet
***** bullet
**** bullet
*** bullet
** bullet
* bullet
Bulleted
  • bullet

  • bullet

    • bullet

    • bullet

  • bullet

    • bullet

    • bullet

      • bullet

      • bullet

        • bullet

        • bullet

          • bullet

          • bullet

        • bullet

      • bullet

    • bullet

  • bullet

AsciiDoc3 Logo

.Bulleted 2
- bullet
  * bullet
Bulleted 2
  • bullet

    • bullet

AsciiDoc3 Logo

[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
Labeled horizontal
Term 1

Definition 1

Term 2

Definition 2

Term 2.1

Definition 2.1

Term 2.2

Definition 2.2

Term 3

Definition 3

Term 4

Definition 4

Term 4.1

Definition 4.1

Term 4.2

Definition 4.2

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

Tip See more examples in the userguide.

empty

AsciiDoc3 Logo

Tables

.Title
[width="15%"]
|=======
|1 |2 |A
|3 |4 |B
|5 |6 |C
|=======
Table 1. Title

1

2

A

3

4

B

5

6

C

AsciiDoc3 Logo

.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
|======================
Table 2. An example table with title, header and footer
Column 1 Column 2

6

Three items

1

Item 1

2

Item 2

3

Item 3

AsciiDoc3 Logo

AsciiDoc3 source
.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
|================
Table 3. Spans, alignments and styles

1

2

3

4

5

6

7

8

9

10

Tip See more examples here: ./tests/data/newtables(_docbook51).txt

empty

AsciiDoc3 Logo

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.

AsciiDoc3 source

latexmath_source

AsciiDoc3 Output

latexmath

empty

AsciiDoc3 Logo

Annotation

This summary of some features of AsciiDoc3 was inspired by powermans Cheat Sheet. 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-2025 by Berthold Gehrke berthold.gehrke@gmail.com
Given to the Public Domain - if not applicable: MIT license.

To Top ↑