Table of contents
ascii doctor
cli
default file extension
.adoc
generate html
asciidoctor [file]
asciidoctor [file] -o /tmp/output.html
generate adoc from html
pandoc input.html -f html -t asciidoc -o output.adoc
generate word document (from html)
pandoc document.html -o document.docx
generate pdf
asciidoctor-pdf [file]
docker
docker run -v $PWD:/documents asciidoctor/docker-asciidoctor asciidoctor-pdf [file]
syntax
remove auto generated last-update footer
:docdatetime:
:last-update-label:
table of contents (must be directly under document title)
= [title]
:toc:
:toc-title: Contents
positioning the table of contents somewhere else in the document
= document
:toc:
:toc-placement: macro
////
some content
////
== Table of Contents
toc::[]
comment
// this is a comment
block comment
////
this is a comment
this is the continuation of the comment
////
newline
line 1 +
line 2 +
line 3
line 3
page break
<<<
headers
= document title
== section level 1
=== section level 2
==== section level 3
text formatting
*bold*
_italic_
`monospace`
*_bold italic_*
code block
[source,python]
----
print("Hello, AsciiDoc!")
----notes
NOTE: This is a note.
WARNING: Be careful!
TIP: Useful tip.
horizontal line
'''
lists
unordered list
* item 1
* item 2
** subitem
ordered list: 1. 2. 3. etc.
. first
. second
.. subitem
ordered list: a. b. c. etc.
[loweralpha]
. first
. second
ordered list: i. ii. iii. etc.
[lowerroman]
. first
. second
definition lists
question 1?::
answer 1
question 2?::
answer 2
tables
change the prefix for table captions
:table-caption: myprefix
table
[title="caption"]
|===
| id | name
| 0 | foo
| 1 | bar
|===
table right align cells
[title="caption"]
|===
| id | value
>| 0 >| 123
>| 1 >| 4
|===
table center align cells
[title="caption"]
|===
| id | value
^| 0 ^| 123
^| 1 ^| 4
|===
table left align (default)
[title="caption"]
|===
| id | value
<| 0 <| 123
<| 1 <| 4
|===
images
include image
.title for image
image::myimage.png[]
documentation
quick reference
https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/