Fork Me On GitLab
AsciiDoc3
Text based document generation using Python 3

»Home  »User Guide  »Blog  »Quickstart  »Download  »Install  »PyPI  »Docker  »Windows  »Cheatsheet  »Release Notes  »Contact / Donate  »Imprint / Impressum / Datenschutz / Privacy

AsciiDoc3 Logo

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.

AsciiDoc3 Logo

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.

AsciiDoc3 Logo

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.

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

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: nibmr

// Comment

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*.

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:../images/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::../images/tiger.png["Tiger image",height=40, align="right"]
Tiger image

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.

.Optional Title

 Literal paragraph.
  Must be indented.
Optional Title
Literal paragraph.
 Must be indented.

AsciiDoc3 Logo

.Optional Title

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

This is normal text.
Optional Title

This is normal text.

empty

AsciiDoc3 Logo

.Optional Title
NOTE: This is an example
      single-paragraph note.
Anmerkung
Optional Title
This is an example single-paragraph note.
.Optional Title
[NOTE]
This is an example
single-paragraph note.
Anmerkung
Optional Title
This is an example single-paragraph note.
TIP: Tip.
Tipp Tip.
IMPORTANT: Important.
Wichtig Important.
WARNING: Warning.
Warnung Warning.
CAUTION: Caution.
Achtung 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.
Optional Title
*Listing* Block

Use: code or file listings

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

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.
==========================
Beispiel 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.
===============================
Anmerkung
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.
 ....
.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

Tipp See more examples in the userguide.

empty

AsciiDoc3 Logo

Tables

.Title
[width="15%"]
|=======
|1 |2 |A
|3 |4 |B
|5 |6 |C
|=======
Tabelle 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
|======================
Tabelle 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

Tabelle 3. Spans, alignments and styles

1

2

3

4

5

6

7

8

9

10

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
|================
Tipp 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.

latexmath

AsciiDoc3 source

latexmath_source

empty

AsciiDoc3 Logo

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.