AsciiDoc User Guide

Stuart Rackham

Revision History
Revision 8.5.318 January 2010SJR

Table of Contents

1. Introduction
2. Getting Started
2.1. Installing AsciiDoc
2.2. Example AsciiDoc Documents
3. AsciiDoc Document Types
3.1. article
3.2. book
3.3. manpage
4. AsciiDoc Backends
4.1. docbook
4.2. xhtml11
4.3. html4
5. Document Structure
5.1. Block Elements
5.2. Header
5.3. Preamble
5.4. Sections
5.5. Inline Elements
6. Document Processing
7. Text Formatting
7.1. Quoted Text
7.2. Superscripts and Subscripts
7.3. Line Breaks
7.4. Page Breaks
7.5. Rulers
7.6. Tabs
7.7. Replacements
7.8. Special Words
8. Titles
8.1. Two line titles
8.2. One line titles
8.3. Floating titles
9. Block Titles
10. BlockId Element
11. AttributeList Element
11.1. Attribute value substitution
11.2. Common attributes
12. Paragraphs
12.1. literal paragraph style
12.2. verse paragraph style
12.3. Admonition Paragraphs
13. Delimited Blocks
13.1. Predefined Delimited Blocks
13.2. Listing Blocks
13.3. Literal Blocks
13.4. Sidebar Blocks
13.5. Comment Blocks
13.6. Passthrough Blocks
13.7. Quote Blocks
13.8. Example Blocks
13.9. Admonition Blocks
13.10. Open Blocks
14. Lists
14.1. Bulleted Lists
14.2. Numbered Lists
14.3. Labeled Lists
14.4. Question and Answer Lists
14.5. Glossary Lists
14.6. Bibliography Lists
14.7. List Item Continuation
15. Footnotes
16. Indexes
17. Callouts
17.1. Implementation Notes
17.2. Including callouts in included code
18. Macros
18.1. Inline Macros
18.2. Block Macros
18.3. System Macros
18.4. Passthrough macros
18.5. Macro Definitions
19. Tables
19.1. Example tables
19.2. Table input data formats
19.3. Table attributes
19.4. Column Specifiers
19.5. Cell Specifiers
19.6. Table styles
19.7. Markup attributes
19.8. Nested tables
19.9. DocBook table limitations
20. Manpage Documents
20.1. Document Header
20.2. The NAME Section
20.3. The SYNOPSIS Section
20.4. refmiscinfo attributes
21. Mathematical Formulas
21.1. LaTeX Math
21.2. ASCIIMathML
21.3. LaTeXMathML
21.4. MathML
22. Configuration Files
22.1. Configuration File Format
22.2. Miscellaneous section
22.3. Titles section
22.4. Tags section
22.5. Attributes section
22.6. Special Characters section
22.7. Quoted Text section
22.8. Special Words section
22.9. Replacements section
22.10. Markup Template Sections
22.11. Configuration File Names and Locations
23. Document Attributes
24. Attribute Entries
24.1. Setting configuration entries
25. Attribute Lists
25.1. Options attribute
25.2. Macro Attribute lists
26. Attribute References
26.1. Simple Attributes References
26.2. Conditional Attribute References
26.3. System Attribute References
27. Intrinsic Attributes
28. Block Element Definitions
28.1. Styles
28.2. Paragraphs
28.3. Delimited Blocks
28.4. Lists
28.5. Tables
29. Filters
29.1. Filter Search Paths
29.2. Filter Configuration Files
29.3. Code Filter
29.4. Source Code Highlighter Filter
29.5. Music Filter
30. Converting DocBook to other file formats
30.1. a2x Toolchain Wrapper
30.2. HTML generation
30.3. PDF generation
30.4. HTML Help generation
30.5. Toolchain components summary
30.6. AsciiDoc dblatex configuration files
30.7. AsciiDoc DocBook XSL Stylesheets drivers
31. Generating Plain Text Files
32. Help Commands
32.1. Customizing Help
33. Tips and Tricks
33.1. Know Your Editor
33.2. Vim Commands for Formatting AsciiDoc
33.3. Troubleshooting
33.4. Gotchas
33.5. Combining separate documents
33.6. Processing document sections separately
33.7. Processing document snippets
33.8. Badges in HTML page footers
33.9. Pretty printing AsciiDoc output
33.10. Supporting minor DocBook DTD variations
33.11. Creating stand-alone HTML documents
33.12. Shipping stand-alone AsciiDoc source
33.13. Inserting blank space
33.14. Closing open sections
33.15. Validating output files
Glossary
A. Migration Notes
A.1. Version 7 to version 8
B. Packager Notes
C. AsciiDoc Safe Mode
D. Using AsciiDoc with non-English Languages
E. Vim Syntax Highlighter
E.1. Limitations
F. Attribute Options
G. Diagnostics
H. Backend Attributes

AsciiDoc is a text document format for writing documentation, articles, manuals, books and UNIX man pages. AsciiDoc files can be translated to HTML and DocBook markups using the asciidoc(1) command. AsciiDoc is highly configurable: both the AsciiDoc source file syntax and the backend output markups (which can be almost any type of SGML/XML markup) can be customized and extended by the user.

1. Introduction

Plain text is the most universal electronic document format, regardless of your computing environment you can always read and write plain text documentation. But for many applications plain text is not the preferred presentation format — HTML and PDF formats are widely used as is the roff man page format. DocBook is a popular documentation markup format which can be translated to HTML, PDF and other presentation formats.

AsciiDoc is a plain text human readable/writable document format that can be translated to DocBook or HTML using the asciidoc(1) command. You can then either use asciidoc(1) generated HTML directly or run asciidoc(1) DocBook output through your favorite DocBook toolchain or use the AsciiDoc a2x(1) toolchain wrapper to produce PDF, EPUB, DVI, LaTeX, PostScript, man page, HTML and text formats.

The AsciiDoc format is a useful presentation format in its own right: AsciiDoc markup is simple, intuitive and as such is easily proofed and edited.

AsciiDoc is light weight: it consists of a single Python script and a bunch of configuration files. Apart from asciidoc(1) and a Python interpreter, no other programs are required to convert AsciiDoc text files to DocBook or HTML. See Example AsciiDoc Documents below.

Text markup conventions tend to be a matter of (often strong) personal preference: if the default syntax is not to your liking you can define your own by editing the text based asciidoc(1) configuration files. You can also create configuration files to translate AsciiDoc documents to almost any SGML/XML markup.

asciidoc(1) comes with a set of configuration files to translate AsciiDoc articles, books and man pages to HTML or DocBook backend formats.