
- •AsciiDoc User Guide
- •Table of Contents
- •Introduction
- •Getting Started
- •Installing the AsciiDoc tarball distribution
- •Example AsciiDoc Documents
- •AsciiDoc Document Types
- •article
- •book
- •manpage
- •AsciiDoc Backends
- •docbook
- •xhtml11
- •Stylesheets
- •html4
- •linuxdoc
- •Document Structure
- •Block Elements
- •Header
- •Preamble
- •Sections
- •Special Sections
- •Inline Elements
- •Document Processing
- •Text Formatting
- •Quoted Text
- •Inline Passthroughs
- •Superscripts and Subscripts
- •Line Breaks (HTML/XHTML)
- •Rulers (HTML/XHTML)
- •Tabs
- •Replacements
- •Special Words
- •Titles
- •Two line titles
- •One line titles
- •BlockTitles
- •BlockId Element
- •Paragraphs
- •Default Paragraph
- •Literal Paragraph
- •Admonition Paragraphs
- •Admonition Icons and Captions
- •Delimited Blocks
- •Predefined Delimited Blocks
- •Listing Blocks
- •Literal Blocks
- •SidebarBlocks
- •Comment Blocks
- •Passthrough Blocks
- •Quote Blocks
- •Example Blocks
- •Admonition Blocks
- •Lists
- •Bulleted and Numbered Lists
- •Vertical Labeled Lists
- •Horizontal Labeled Lists
- •Question and Answer Lists
- •Glossary Lists
- •Bibliography Lists
- •List Item Continuation
- •List Block
- •Footnotes
- •Indexes
- •Callouts
- •Implementation Notes
- •Macros
- •Inline Macros
- •URLs
- •Internal Cross References
- •anchor
- •xref
- •Linking to Local Documents
- •Images
- •Block Macros
- •Block Identifier
- •Images
- •Comment Lines
- •System Macros
- •Include Macros
- •Conditional Inclusion Macros
- •eval, sys and sys2 System Macros
- •Template System Macro
- •Macro Definitions
- •Tables
- •Example Tables
- •AsciiDoc Table Block Elements
- •Ruler
- •Row and Data Elements
- •Underline
- •Attribute List
- •Markup Attributes
- •Manpage Documents
- •Document Header
- •The NAME Section
- •The SYNOPSIS Section
- •Configuration Files
- •Configuration File Format
- •Markup Template Sections
- •Special Sections
- •Miscellaneous
- •Titles
- •Tags
- •Attributes Section
- •Special Characters
- •Quoted Text
- •Special Words
- •Replacements
- •Configuration File Names and Locations
- •Document Attributes
- •Attribute Entries
- •Attribute Lists
- •Macro Attribute lists
- •AttributeList Element
- •Attribute References
- •Simple Attributes References
- •Conditional Attribute References
- •Conditional attribute examples
- •System Attribute References
- •Intrinsic Attributes
- •Block Element Definitions
- •Styles
- •Paragraphs
- •Delimited Blocks
- •Lists
- •Tables
- •Filters
- •Filter Search Paths
- •Filter Configuration Files
- •Code Filter
- •Converting DocBook to other file formats
- •a2x Toolchain Wrapper
- •Toolchain Components
- •AsciiDoc DocBook XSL Drivers
- •Generating Plain Text Files
- •XML and Character Sets
- •PDF Fonts
- •Help Commands
- •Customizing Help
- •Tips and Tricks
- •Know Your Editor
- •Vim Commands for Formatting AsciiDoc
- •Text Wrap Paragraphs
- •Format Lists
- •Indent Paragraphs
- •Troubleshooting
- •Gotchas
- •Combining Separate Documents
- •Processing Document Sections Separately
- •Processing Document Chunks
- •Badges in HTML Page Footers
- •Pretty Printing AsciiDoc Output
- •Supporting Minor DocBook DTD Variations
- •Shipping Stand-alone AsciiDoc Source
- •Inserting Blank Space
- •Closing Open Sections
- •Validating Output Files
- •Glossary
- •A. Migration Notes
- •Version 6 to version 7
- •B. Packager Notes
- •C. AsciiDoc Safe Mode
- •E. Installing FOP on Linux
- •F. Installing Java on Windows
- •G. Installing Java on Linux

AsciiDoc User Guide
A B C D
A table with a numeric ruler and externally sourced CSV data:
[frame="all", grid="all"]
.15`20`25`20`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ID,Customer Name,Contact Name,Customer Address,Phone
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include::customers.csv[]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Renders:
ID |
Customer |
Contact Name |
Customer |
Phone |
|
Name |
|
Address |
|
|
|
|
|
|
AROUT |
Around the |
Thomas Hardy |
120 Hanover |
(171) |
|
Horn |
|
Sq. London |
555-7788 |
|
|
|
|
|
BERGS |
Berglunds |
Christina |
Berguvsvagen |
0921-12 34 65 |
|
snabbkop |
Berglund |
8 Lulea |
|
|
|
|
|
|
BLAUS |
Blauer See |
Hanna Moos |
Forsterstr. 57 |
0621-08460 |
|
Delikatessen |
|
Mannheim |
|
|
|
|
|
|
BLONP |
Blondel pere |
Frederique |
24, place |
88.60.15.31 |
|
et fils |
Citeaux |
Kleber |
|
|
|
|
Strasbourg |
|
|
|
|
|
|
BOLID |
Bolido |
Martin Sommer |
C/ Araquil, 67 |
(91) 555 22 82 |
|
Comidas |
|
Madrid |
|
|
preparadas |
|
|
|
|
|
|
|
|
BONAP |
Bon app' |
Laurence Lebihan |
12, rue des |
91.24.45.40 |
|
|
|
Bouchers |
|
|
|
|
Marseille |
|
|
|
|
|
|
BOTTM |
Bottom-Dollar |
Elizabeth Lincoln |
23 Tsawassen |
(604) |
|
Markets |
|
Blvd. |
555-4729 |
|
|
|
Tsawassen |
|
|
|
|
|
|
BSBEV |
B's Beverages |
Victoria Ashworth |
Fauntleroy |
(171) |
|
|
|
Circus |
555-1212 |
|
|
|
London |
|
|
|
|
|
|
CACTU |
Cactus |
Patricio Simpson |
Cerrito 333 |
(1) 135-5555 |
|
Comidas para |
|
Buenos Aires |
|
|
llevar |
|
|
|
|
|
|
|
|
AsciiDoc Table Block Elements
This sub-section details the AsciiDoc table format.
Table |
::= (Ruler,Header?,Body,Footer?) |
|
Header |
::= (Row+,Underline) |
|
Footer |
::= (Row+,Underline) |
|
Body |
::= |
(Row+,Underline) |
Row |
::= |
(Data+) |
42

AsciiDoc User Guide
A table is terminated when the table underline is followed by a blank line or an end of file. Table underlines which separate table headers, bodies and footers should not be followed by a blank line.
Ruler
The first line of the table is called the Ruler. The Ruler specifies which configuration file table definition to use, column widths, column alignments and the overall table width.
There are two ruler formats:
Character ruler
The column widths are determined by the number of table fill characters between column stop characters.
Numeric ruler
The column widths are specified numerically. If a column width is omitted the previous width is used. In the degenerate case of no widths being specified columns are allocated equal widths.
The ruler format can be summarized as:
ruler ::= ((colstop,(colwidth,fillchar+)?)+, fillchar+, tablewidth?
•The ruler starts with a column stop character (designating the start of the first column).
•Column stop characters specify the start and alignment of each column:
•Backtick (`) — align left.
•Single quote (') — align right.
•Period (.) — align center.
•In the case of fixed format tables the ruler column widths specify source row data column boundaries.
•The optional tablewidth is a number representing the size of the output table relative to the pagewidth. If tablewidth is less than one then it is interpreted as a fraction of the page width; if it is greater than one then it is interpreted as a percentage of the page width. If tablewidth is not specified then the table occupies the full pagewidth (numeric rulers) or the relative width of the ruler compared to the textwidth (character rulers).
Row and Data Elements
Each table row consists of a line of text containing the same number of Data items as there are columns in the table,
Lines ending in a backslash character are continued on the next line.
Each Data item is an AsciiDoc substitutable string. The substitutions performed are specified by the subs table definition entry. Data cannot contain AsciiDoc block elements.
43

AsciiDoc User Guide
The format of the row is determined by the table definition format value:
fixed
Row data items are assigned by chopping the row up at ruler column width boundaries.
csv
Data items are assigned the parsed CSV (Comma Separated Values) data.
dsv
The DSV (Delimiter Separated Values) format is a common UNIX tabular text file format.
•The separator character is a colon (although this can be set to any letter using the separator table attribute).
•Common C-style backslash escapes are supported.
•Blank lines are skipped.
Underline
A table Underline consists of a line of three or more fillchar characters which are end delimiters for table header, footer and body sections.
Attribute List
The following optional table attributes can be specified in an AttributeList preceding the table:
separator
The default DSV format colon separator can be changed using the separator attribute. For example:
[separator="|"].
frame
Defines the table border and can take the following values: topbot (top and bottom), all (all sides), none and sides (left and right sides). The default value is topbot.
grid
Defines which ruler lines are drawn between table rows and columns. The grid attribute value can be any of the following values: none, cols, rows and all. The default value is none. For example
[frame="all", grid="none"].
format, tablewidth
See Markup Attributes below.
You can also use an AttributeList to override the following table definition and ruler parameters: format, subs, tablewidth.
Markup Attributes
The following attributes are automatically available inside table tag and markup templates.
44