Table of Contents
AsciiDoc is a text document format for writing short documents, articles, books and UNIX man pages. AsciiDoc files can be translated to HTML (with or without stylesheets), DocBook and LinuxDoc markup 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.
Plain text is the most universal electronic document format, no matter what computing environment you use, you can always read and write plain text documentation. But for many applications plain text is not a viable presentation format. HTML, PDF and roff (roff is used for man pages) are the most widely used Unix presentation formats. DocBook is rapidly becoming the most popular Unix documentation markup format (DocBook is easily translated to HTML, PDF and many other presentation formats).
AsciiDoc is a plain text human readable/writable document format that can be translated directly to DocBook and 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 to produce PDF, HTML, RTF and even HTML Help presentation formats.
The AsciiDoc format is a useful presentation format in it's own right: AsciiDoc files are unencumbered by markup and is easily viewed, 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, HTML and LinuxDoc. See Example AsciiDoc Documents below.
You write an AsciiDoc document the same way you would write a normal text document, there are no markup tags or weird notations. Built-in AsciiDoc formatting rules have been kept to a minimum and are fairly obvious.
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 create other backend formats to translate AsciiDoc documents to almost any SGML/XML markup.
asciidoc(1) comes with a set of configuration files to translate AsciiDoc files to HTML (articles, books, man pages), DocBook (articles, books, man pages) or LinuxDoc (articles).
AsciiDoc is written in Python so you need a Python interpreter (version 2.3 or later) to execute asciidoc(1). Python is installed by the default configurations of most FreeBSD and Linux distributions. You can download Python from the official Python website http://www.python.org.
Extract the distribution tarball (this example assumes the tarball is in you home directory and the ~/bin directory exists):
$ cd ~/bin $ tar -xzf ~/asciidoc-6.0.3.tar.gz
The tarball contains the executable asciidoc.py script, configuration files, examples and documentation.
Test out asciidoc by changing to the AsciiDoc application directory and converting the User Guide document (./doc/asciidoc.txt) to HTML (./doc/asciidoc.html):
$ ./asciidoc.py -b html doc/asciidoc.txt # Plain HTML $ ./asciidoc.py -b css doc/asciidoc.txt # HTML with CSS stylesheets
I use .txt file extensions for AsciiDoc document files.
If you want to avoid having to explicitly specify the location of asciidoc every time you run it you'll need to make sure that asciidoc.py can be found in your search path, you can do this by putting a symbolic link to asciidoc in a directory in your search path. For example (assuming ~/bin is in $PATH):
$ ln -s ~/bin/asciidoc-6.0.3/asciidoc.py ~/bin/asciidoc
You can now execute asciidoc(1) by typing asciidoc.
Examples of AsciiDoc markup are scattered throughout this document but the best way to quickly get a feel for AsciiDoc is to view the AsciiDoc web site and/or distributed examples:
The asciidoc(1) command translates an AsciiDoc formatted file to the backend format specified by the -b command-line option. asciidoc(1) itself little intrinsic knowledge of backend formats, all translation rules are contained in user customizable cascading configuration files.
AsciiDoc ships with the following predefined backend output formats:
AsciiDoc generates DocBook article, book and refentry documents (corresponding to the asciidoc(1) article, book and manpage document types).
As of version 4.2 the -b docbook command-line option switched from outputting DocBook SGML to the newer DocBook XML. You can still produce DocBook SGML using the -b docbook-sgml command-line option.
The DocBook DTD restricts the allowable AsciiDoc syntax:
The asciidoc(1) -b xhtml command-line option produces plain unstyled XHTML 1.0 markup that can be viewed on any modern web browser.
A minor variation of xhtml — the asciidoc(1) -b html command-line option produces HTML 4 markup.
The asciidoc(1) -b css command-line option produces XHTML 1.0 conformant output styled with linked CSS2 stylesheets.
The main.css, article.css and manpage.css stylesheets (located in the ./stylesheets/ directory) style both screen and printed outputs. Edit the stylesheets to customize your document's appearance.
![]() | Note |
|---|---|
Browser CSS support varies from browser to browser. The examples work well on IE6, Firefox 1.0 and up, Mozilla 1.1 and up, Opera 7 and Konqueror 3.01 but have not been tested on other browsers. All browsers have their quirks. When it comes to implementing CSS, of those tested I found Mozilla and Firefox to be the most conformant. | |
The asciidoc(1) -b css-embedded command-line option produces XHTML 1.0 conformant output styled with embedded CSS2 stylesheets. Similar to the css backend but translated files do not rely on external stylesheets.
The LinuxDoc DTD restricts the allowable AsciiDoc syntax:
DocBook documents are not designed to be viewed directly. FreeBSD and most Linux distributions come with conversion tools (collectively called a tool chain) for converting DocBook files to presentation formats such as Postscript, HTML, PDF, DVI, roff (the native man page format), HTMLHelp, JavaHelp and text.
The default xmlto(1) and jw(1) outputs are quite plain (compared to the distributed AsciiDoc HTML and PDF documentation files). The Processing DocBook Files section explains how you can generate nicely styled output using custom DocBook XSL Stylesheets drivers. This is the best route for generating PDF outputs.
![]() | Warning |
|---|---|
I don't recommend using xmlto(1) for producing PDF — the output is not bookmarked and callouts generate LaTeX errors. | |
If you use jw(1) don't forget to specify the docbook-sgml backend, not the docbook backend. This example converts the asciidoc.txt AsciiDoc User Guide to PDF format:
$ asciidoc -b docbook-sgml asciidoc.txt $ jw -b pdf asciidoc.sgml
To convert the asciidoc.1.txt AsciiDoc manpage document to native man page groff(1) man macro package format:
$ asciidoc -d manpage -b docbook asciidoc.1.txt $ xmlto man asciidoc.1.xml
To view the man page file as it would be displayed by the man(1) command:
$ groff -mandoc -Tascii asciidoc.1 | less
To print a high quality man page to a postscript printer:
$ groff -mandoc -Tps asciidoc.1 | lpr
You can also produce HTML from DocBook files:
$ asciidoc -b docbook asciidoc.txt $ xmlto html-nochunks asciidoc.xml # Single HTML file. $ xmlto html -o chunked asciidoc.xml # Chunked HTML file.
LinuxDoc is an SGML documentation markup language originally created by Matt Welsh to write Linux documentation. LinuxDoc does a good job of marking up small and medium sized text based documents. Its strength is its simplicity and ease of use. Nowadays LinuxDoc has been largely superseded by DocBook.
![]() | Note |
|---|---|
LinuxDoc limitations place restrictions on the use of a number of AsciiDoc elements. | |
There are a number of Open Source applications available to convert the LinuxDoc SGML markup to various presentation formats, here are a couple of examples:
Create a single HTML file with a detailed table of contents using the linuxdoc(1) command that comes with the Linuxdoc-Tools package.
$ linuxdoc -B html -s 0 -T 2 mydocument.sgml
Generate a set of linked HTML files using the sgmlfmt(1) from the FreeBSD sgmlformat package:
$ sgmlfmt -f html mydocument.sgml
Create a PDF file using the sgmlfmt(1) from the FreeBSD sgmlformat package:
$ sgmlfmt -f ps mydocument.sgml $ ps2pdf asciidoc.ps
AsciiDoc does not have a text backend (for most applications AsciiDoc source text is fine), however you can convert asciidoc(1) generated HTML and DocBook files to text.
You can use the lynx(1) web browser to convert AsciiDoc generated HTML to text. You'll find an asciidoc2text.sh shell script included in the AsciiDoc distribution examples/asciidoc2text directory which, together with the asciidoc2text.conf configuration file, automates text file generation with a single command. For example:
$ ./examples/asciidoc2text/asciidoc2text.sh test.txt >test.text
You can also use jw(1) and xmlto(1) toolchain commands to convert DocBook to text.
![]() | Warning |
|---|---|
By default both jw(1) and xmlto(1) commands create files with a .txt extension when generating text files. This will overwrite your AsciiDoc *.txt source files (use the -o command-line option to output to an alternative directory). | |
There are three types of AsciiDoc documents: article, book and manpage. All document types share the same AsciiDoc format with some minor variations.
Use the asciidoc(1) -d option to specify the AsciiDoc document type (defaults to article type).
Used for short documents, articles and general documentation. See the article.txt example AsciiDoc article in the distribution ./doc directory.
Books share the same format as articles; in addition there is the option to add level 0 sections to divide a book into multiple parts.
Book documents will normally be used to produce DocBook output since DocBook processors can automatically generate footnotes, table of contents, list of tables, list of figures, list of examples and indexes.
AsciiDoc markup supports all the standard DocBook frontmatter and backmatter special sections (dedication, preface, bibliography, glossary, index, colophon) plus footnotes and index entries.
Example book documents
Used to generate UNIX manual pages. AsciiDoc manpage documents observe special header title and section naming conventions — see the Manpage Documents section for details.
The asciidoc(1) man page (asciidoc.1.txt in the AsciiDoc distribution ./doc directory) is an example of an AsciiDoc man page file.
An AsciiDoc document consists of a series of block elements starting with an optional document Header, followed by an optional Preamble, followed by zero or more document Sections.
Almost any combination of zero or more elements constitutes a valid AsciiDoc document: documents can range from a single sentence to a multi-part book.
Block elements consist of one or more lines of text and may contain other block elements.
The AsciiDoc block structure can be informally summarized [1] as follows:
Document ::= (Header?,Preamble?,Section*)
Header ::= (Title,(AuthorLine,RevisionLine?)?)
AuthorLine ::= (FirstName,(MiddleName?,LastName)?,EmailAddress?)
RevisionLine ::= (Revision?,Date)
Preamble ::= (SectionBody)
Section ::= (Title,SectionBody?,(Section)*)
SectionBody ::= ((BlockTitle?,
(Paragraph|DelimitedBlock|List|Table|BlockMacro))+)
List ::= (BulletedList|NumberedList|LabeledList|CalloutList)
BulletedList ::= (ListItem)+
NumberedList ::= (ListItem)+
CalloutList ::= (ListItem)+
LabeledList ::= (ItemLabel+,ListItem)+
ListItem ::= (ItemText,((List|ListParagraph)?,ItemContinuation?)*)
Table ::= (Ruler,TableHeader?,TableBody,TableFooter?)
TableHeader ::= (TableRow+,TableUnderline)
TableFooter ::= (TableRow+,TableUnderline)
TableBody ::= (TableRow+,TableUnderline)
TableRow ::= (TableData+)
The Header is optional but and starts on first line of the document beginning with a document title. Immediately following the title are optional Author and Revision lines.
The author line contains the author's name optionally followed by the author's email address. The author's name consists of a first name followed by optional middle and last names separated by white space. The email address is last and must be enclosed in angle <> brackets. Author names cannot contain angle <> bracket characters.
The optional document header revision line should immediately follow the author line. The revision line can be one of two formats:
A an alphanumeric document revision number followed by a date:
The document heading is separated from the remainder of the document by one or more blank lines.
Here's an example AsciiDoc document header:
Writing Documentation using AsciiDoc ==================================== Stuart Rackham <srackham@methods.co.nz> v2.0, February 2003
You can override or set header parameters by passing revision, data, email, author, authorinitials, firstname and lastname attributes using the asciidoc(1) -a command-line option. For example:
$ asciidoc -b docbook -a date=2004/07/27 article.txt
Attributes can also be added to the header for substitution in the header template with Attribute Entry elements.
The Preamble is an optional untitled section body between the document Header and the first Section title. The Preamble should only be included in article documents.
AsciiDoc supports five section levels which corresponding to document levels 0 to 4 (although only book documents are allowed to contain level 0 sections). Section levels are delineated by the section title underlines.
A section consists of a section title followed by an optional section body.
Sections are translated using configuration file markup templates. To determine which configuration file section to use AsciiDoc first searches for section titles in the [specialsections] configuration entries, if not found it looks for the name [sect<level>].
You can the -n command-line option to auto-number HTML outputs (DocBook line numbering is handled automatically by the DocBook toolchain commands).
In addition to nested sections documents generally have frontmatter and backmatter sections with special semantic significance, for example: preface, bibliography, table of contents, index.
AsciiDoc configuration files can have a [specialsections] section which specifies special section titles and the corresponding backend markup.
[specialsections] entries are formatted like:
<pattern>=<name>
<pattern> is a Python regular expression and <name> is the name of a configuration file markup template section. If the <pattern> matches an AsciiDoc document section title then the backend output is marked up using the <name> markup template. The {title} attribute value is set to the value of the matched regular expression group named title, if there is no title group {title} is set to the the whole of the section title.
The special section names in the default [specialsections] section are:
Preface (book documents only) Abstract (article documents only) Dedication (book documents only) Glossary Bibliography|References Colophon (book documents only) Index Appendix [A-Z][:.] <title>
Inline document elements occur within block elements; inline elements can begin and end anywhere within a line but cannot span multiple lines.
Inline elements are used to markup character formatting and various types of text substitution. Inline elements and inline element syntax is defined in the asciidoc(1) configuration files.
Here is a list of AsciiDoc inline elements in the (default) order in which they are processed:
The AsciiDoc source document is read and processed as follows:
When a block element is encountered asciidoc(1) determines the type of block by checking in the following order (first to last): BlockTitles, (section) Titles, BlockMacros, Lists, DelimitedBlocks, Tables, AttributeEntrys, AttributeLists, Paragraphs.
The default paragraph definition [paradef-default] is last element to be checked.
Knowing the parsing order will help you devise unambiguous macro, list and block syntax rules.
Inline substitutions within block elements are performed in the following default order:
The substitutions and substitution order performed on Title, Paragraph and DelimitedBlock elements is determined by configuration file parameters.
Words and phrases can be formatted by enclosing the text with predefined quoting characters:
Quoting characters can be changed and new quoting markup syntax defined by editing asciidoc(1) configuration files. See the Configuration Files section for details.
Quoted text properties
Put carets on either side of the text to be superscripted, put tildes on either side of text to be subscripted. For example, the following line:
e^{amp}#960;i^+1 = 0. H~2~O and x^10^. Some ^super text^
and ~some sub text~
Is rendered like:
eπi+1 = 0. H2O and x10. Some super text and some sub text
If you want to display caret (^) or tilde (~) characters you need to ensure only one per line otherwise they'll be misinterpreted as superscripting and subscripting.
Superscripts and subscripts are implemented as Replacements substitutions.
A plus character preceded by at least one space character at the end of a line forces a line break. It generates an HTML line break (<br/>) tag. Line breaks are ignored when outputting to DocBook since it has no line break element.
A line of three or more apostrophe characters will generate an HTML ruler (<hr/>) tag. Ignored when generating non-HTML output formats.
By default tab characters input files will translated to 8 spaces. Tab expansion is set with the tabsize entry in the configuration file [miscellaneous] section and can be overridden in the include block macro by setting a tabsize attribute in the macro's attribute list. For example:
include::addendum.txt[tabsize=2]
The tab size can also be set using the -a command-line option, for example -a tabsize=4
The following replacements are defined in the default AsciiDoc configuration:
(C) copyright, (TM) trademark, (R) registered trademark, -- em dash, ... ellipsis.
Is rendered as:
© copyright, ™ trademark, ® registered trademark, — em dash, … ellipsis.
The Configuration Files section explains how to configure your own replacements.
Words defined in [specialwords] configuration file sections are automatically marked up without having to be explicitly notated.
The Configuration Files section explains how to add and replace special words.
Document and section titles consist of one or two lines.
A two line title consists of a title line, starting hard against the left margin, and an underline. Section underlines consist a repeated character pairs spanning the width of the preceding title (give or take up to three characters):
The default title underlines for each of the document levels are:
Level 0 (top level): ====================== Level 1: ---------------------- Level 2: ~~~~~~~~~~~~~~~~~~~~~~ Level 3: ^^^^^^^^^^^^^^^^^^^^^^ Level 4 (bottom level): ++++++++++++++++++++++
Examples:
Level One Section Title -----------------------
Level 2 Subsection Title ~~~~~~~~~~~~~~~~~~~~~~~~
One line titles consist of a line starting with one or more equals characters (the exact number specified the section level) followed by a space followed by the section title. Here are some examples:
= Document Title == Section level 1 title (top level section) === Section level 2 title ==== Section level 3 title ===== Section level 4 title
The syntax can be changed by editing the configuration file [titles] section sect0…sect4 entries.
A BlockTitle element is a single line beginning with a period followed by a title. The title is applied to the next Paragraph, DelimitedBlock, List, Table or BlockMacro.For example:
.Notes - Note 1. - Note 2.
is rendered as:
Notes
A BlockId is a single line block element containing a unique identifier enclosed in double square brackets. It is used to assign an identifier to the ensuing block element for use by referring links. For example:
[[chapter-titles]] Chapter titles can be ...
The preceding example identifies the following paragraph so it can be linked from other location, for example with <<chapter-titles,chapter titles>>.
BlockId elements can be applied to Title, Paragraph, List, DelimitedBlock and BlockMacro elements. The BlockId element is really just an AttributeList with a special syntax which sets the {id} attribute for substitution in the subsequent block's markup template.
Paragraphs are terminated by a blank line, the end of file, or the start of a DelimitedBlock.
Paragraph types are defined in configuration file [paradef*] sections. AsciiDoc ships with the following predefined paragraph types:
A Default paragraph ([paradef-default]) consists of one or more non-blank lines of text. The first line must start hard against the left margin (no intervening white space). The processing expectation of the default paragraph type is that of a normal paragraph of text.
An Literal paragraph ([paradef-literal]) consists of one or more lines of text, where the first line is indented by one or more or space or tab characters. Literal paragraphs are rendered verbatim in a monospaced font usually without any distinguishing background or border. There is no text formatting or substitutions within Literal paragraphs apart from Special Characters and Callouts. For example:
Consul necessitatibus per id, consetetur, eu pro everti postulant homero verear ea mea, qui. Movet blandit mea at, interesset at has, eu nec.
Tip, Note, Important, Warning and Caution paragraph definitions support the corresponding DocBook admonishment elements, just write a normal paragraph but place NOTE:, TIP:, IMPORTANT:, WARNING: or CAUTION: as the first word of the paragraph. For example:
NOTE: This is an example note.
Renders:
![]() | Note |
|---|---|
This is an example note. | |
![]() | Tip |
|---|---|
If your admonition is more than a single paragraph use one of the admonition variants of the ExampleBlock. | |
Paragraph translation is controlled by [paradef*] configuration file section entries. Users can define new types of paragraphs and modify the behavior of existing types by editing AsciiDoc configuration files.
Here is the shipped Default paragraph definition:
[paradef-default] delimiter=(?P<text>\S.*) template=paragraph
The Default paragraph definition has a couple of special properties:
Available paragraph definition entries:
Paragraph processing proceeds as follows:
List types
List behavior
Bulleted list items start with a dash followed by a space or tab character. Bulleted list syntaxes are:
- List item. * List item.
Numbered list items start with an optional number or letter followed by a period followed by a space or tab character. List numbering is optional. Numbered list syntaxes are:
. Integer numbered list item. 1. Integer numbered list item with optional numbering. .. Lowercase letter numbered list item. a. Lowercase letter numbered list item with optional numbering.
Here are some examples:
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
* Fusce euismod commodo velit.
* Qui in magna commodo, est labitur dolorum an. Est ne magna primis
adolescens. Sit munere ponderum dignissim et. Minim luptatum et
vel.
* Vivamus fringilla mi eu lacus.
* Donec eget arcu bibendum nunc consequat lobortis.
- Nulla porttitor vulputate libero.
. Fusce euismod commodo velit.
. Vivamus fringilla mi eu lacus.
.. Fusce euismod commodo velit.
.. Vivamus fringilla mi eu lacus.
. Donec eget arcu bibendum nunc consequat lobortis.
- Praesent eget purus quis magna eleifend eleifend.
1. Fusce euismod commodo velit.
a. Fusce euismod commodo velit.
b. Vivamus fringilla mi eu lacus.
c. Donec eget arcu bibendum nunc consequat lobortis.
2. Vivamus fringilla mi eu lacus.
3. Donec eget arcu bibendum nunc consequat lobortis.
4. Nam fermentum mattis ante.
Which render as:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Nulla porttitor vulputate libero.
Vivamus fringilla mi eu lacus.
Praesent eget purus quis magna eleifend eleifend.
Fusce euismod commodo velit.
Labeled list items consist of one or more text labels followed the text of the list item.
An item label begins a line with an alphanumeric character hard against the left margin and ends with a double colon :: or semi-colon ;;.
The list item text consists of one or more lines of text starting on the line immediately following the label and can be followed by nested List or ListParagraph elements. Item text can be optionally indented.
Here are some examples:
Lorem::
Fusce euismod commodo velit.
Fusce euismod commodo velit.
Ipsum::
Vivamus fringilla mi eu lacus.
* Vivamus fringilla mi eu lacus.
* Donec eget arcu bibendum nunc consequat lobortis.
Dolor::
Donec eget arcu bibendum nunc consequat lobortis.
'Suspendisse';;
A massa id sem aliquam auctor.
'Morbi';;
Pretium nulla vel lorem.
'In';;
Dictum mauris in urna.
Which render as:
Fusce euismod commodo velit.
Fusce euismod commodo velit.
Vivamus fringilla mi eu lacus.
Donec eget arcu bibendum nunc consequat lobortis.
Horizontal labeled lists differ from vertical labeled lists in that the label and the list item sit side-by-side as opposed to the item under the label. Item text must begin on the same line as the label. For example:
![]() | Tip |
|---|---|
Used vertical labeled lists in preference to horizontal labeled lists — current PDF rendering tools do not make a good job of determining the relative column widths. | |
Here are some examples:
*Lorem*:: Fusce euismod commodo velit. Qui in magna commodo, est labitur dolorum an. Est ne magna primis adolescens. Fusce euismod commodo velit. *Ipsum*:: Vivamus fringilla mi eu lacus. * Vivamus fringilla mi eu lacus. * Donec eget arcu bibendum nunc consequat lobortis. *Dolor*:: Donec eget arcu bibendum nunc consequat lobortis. Sit munere ponderum dignissim et. Minim luptatum et vel. 'Suspendisse';; A massa id sem aliquam auctor. 'Morbi';; Pretium nulla vel lorem. 'In';; Dictum mauris in urna.
Which render as:
Lorem |
Fusce euismod commodo velit. Qui in magna commodo, est labitur dolorum an. Est ne magna primis adolescens. Fusce euismod commodo velit. | ||||||
Ipsum |
Vivamus fringilla mi eu lacus.
| ||||||
Dolor |
Donec eget arcu bibendum nunc consequat lobortis. Sit munere ponderum dignissim et. Minim luptatum et vel.
|
AsciiDoc comes pre-configured with a labeled list (?? label delimiter) for generating question and answer (Q&A) lists. Example:
Question one??
Answer one.
Question two??
Answer two.
AsciiDoc comes pre-configured with a labeled list (:- label delimiter) for generating glossary lists. Example:
A glossary term:-
The corresponding definition.
A second glossary term:-
The corresponding definition.
For working examples see the article.txt and book.txt documents in the AsciiDoc ./doc distribution directory.
![]() | Note |
|---|---|
Glossary lists must be located in a glossary section to generate valid DocBook output. | |
AsciiDoc comes with a predefined itemized list (+ item bullet) for generating bibliography entries. Example:
+ [[[taoup]]] Eric Steven Raymond. 'The Art of Unix Programming'. Addison-Wesley. ISBN 0-13-142901-9. + [[[walsh-muellner]]] Norman Walsh & Leonard Muellner. 'DocBook - The Definitive Guide'. O'Reilly & Associates. 1999. ISBN 1-56592-580-7.
The [[[<reference>]]] syntax is a bibliography entry anchor, it generates an anchor named <reference> and additionally displays [<reference>] at the anchor position. For example [[[taoup]]] generates an anchor named taoup that displays [taoup] at the anchor position. Cite the reference from elsewhere your document using <<taoup>>, this displays a hyperlink ([taoup]) to the corresponding bibliography entry anchor.
For working examples see the article.txt and book.txt documents in the AsciiDoc ./doc distribution directory.
![]() | Note |
|---|---|
Bibliography lists must be located in a bibliography section to generate valid DocBook output. | |
To include subsequent block elements in list items (in addition to implicitly included nested lists and Literal paragraphs) place a separator line containing a single plus character between the list item and the ensuing element. Multiple block elements (excluding section Titles and BlockTitles) may be included in a list item using this technique. For example:
Here's an example of list item continuation:
1. List item one. + List item one continued with a second paragraph followed by an Indented block. + ................. $ ls *.sh $ mv *.sh ~/tmp ................. + List item one continued with a third paragraph. 2. List item two. List item two literal paragraph (no continuation required). - Nested list (item one). Nested list literal paragraph (no continuation required). + Nested list appended list item one paragraph - Nested list item two.
Renders:
List item one.
List item one continued with a second paragraph followed by a Listing block.
$ ls *.sh $ mv *.sh ~/tmp
List item one continued with a third paragraph.
List item two.
List item two literal paragraph (no continuation required).
Nested list (item one).
Nested list literal paragraph (no continuation required).
Nested list appended list item one paragraph
A List Continuation block is a special delimited block which is functionally equivalent to List Item Continuation except that list items contained within the block do not require explicit + list item continuation lines:
The List Continuation Block is an experimental feature and is useful for lists with long multi-element list items. The alternative List Item Continuation is arguably uglier but is more obvious when reading AsciiDoc source — if you don't have strong feelings either way use explicit list continuation.
Example:
.List Block -- 1. List item one. List item one continued with a second paragraph followed by an Indented block. ................. $ ls *.sh $ mv *.sh ~/tmp ................. List item one continued with a third paragraph. 2. List item two. This paragraph is part of list item 2. --
List behavior and syntax is determined by [listdef*] configuration file sections. The user can change existing list behavior and add new list types by editing configuration files.
List definition sections are characterized by the following entries:
The tag entries map the AsciiDoc list structure to backend HTML/SGML/XML markup; see the shipped AsciiDoc .conf configuration files for examples.
Delimited blocks are blocks of text enveloped by leading and trailing delimiter lines (normally a series of three or more repeated characters). The behavior of Delimited Blocks is specified by entries in configuration file [blockdef*] sections.
AsciiDoc ships with a number of predefined DelimitedBlocks (see the asciidoc.conf configuration file in the asciidoc(1) program directory):
Predefined delimited block underlines:
CommentBlock: ////////////////////////// BackendBlock: ++++++++++++++++++++++++++ ListingBlock: -------------------------- LiteralBlock: .......................... SidebarBlock: ************************** QuoteBlock: __________________________
ListingBlocks are rendered verbatim in a monospaced font, they retain line and whitespace formatting and often distinguished by a background or border. There is no text formatting or substitutions within Listing blocks apart from Special Characters and Callouts. Listing blocks are often used for code and file listings.
Here's an example:
-------------------------------------- #include <stdio.h>
int main() {
printf("Hello World!\n");
exit(0);
}
--------------------------------------
Which will be rendered like:
#include <stdio.h>
int main() {
printf("Hello World!\n");
exit(0);
}
LiteralBlocks behave just like LiteralParagraphs except you don't have to indent the contents.
LiteralBlocks can be used to resolve list ambiguity. If the following list was indented it would be processed as an ordered list (not an indented paragraph):
.................... 1. Item 1 2. Item 2 ....................
Renders:
1. Item 1 2. Item 2
A sidebar is a short piece of text presented outside the narrative flow of the main text. The sidebar is normally presented inside a bordered box to set it apart from the main text.
The sidebar body is treated like a normal section body.
Here's an example:
.An Example Sidebar ************************************************ Any AsciiDoc SectionBody element (apart from SidebarBlocks) can be placed inside a sidebar. ************************************************
Which will be rendered like:
Sidebar elements are not supported by the LinuxDoc format and sidebar text appears as part of the main document flow.
CommentBlocks are not processed; they are useful for annotations and for excluding new or outdated content that you don't want displayed. Here's and example:
////////////////////////////////////////// CommentBlock contents are not processed by asciidoc(1). //////////////////////////////////////////
See also Comment Lines.
BackendBlocks are for backend specific markup, text is only subject to attribute and macro substitution. BackendBlock content will generally be backend specific. Here's an example:
++++++++++++++++++++++++++++++++++++++ <table border="1"><tr> <td>Cell 1</td> <td>Cell 2</td> </tr></table> ++++++++++++++++++++++++++++++++++++++
QuoteBlocks are used for quoted passages of text. attribution and citetitle named attributes specify the author and source of the quote (they are equivalent to positional attribute list entries 1 and 2 respectively). Both attributes are optional and the block body is treated like a SectionBody. For example:
[Bertrand Russell, The World of Mathematics (1956)] ____________________________________________________________________ A good notation has subtlety and suggestiveness which at times makes it almost seem like a live teacher. ____________________________________________________________________
Which is rendered as:
A good notation has subtlety and suggestiveness which at times makes it almost seem like a live teacher. | ||
| -- Bertrand Russell The World of Mathematics (1956) | ||
In this example unquoted positional attributes have been used, the following quoted positional and named attributes are equivalent (if the attribute list contained commas then quoting would have been mandatory):
["Bertrand Russell","The World of Mathematics (1956)"] [attribution="Bertrand Russell",citetitle="The World of Mathematics (1956)"]
ExampleBlocks encapsulate the DocBook Example element and are used, well, for examples. DocBook processors automatically number examples and generate a list of examples backmatter section.
Example blocks are delimited by lines of equals characters and you can put any block elements apart from Titles, BlockTitles and Sidebars) inside an example block. AsciiDoc example blocks allow variant delimited blocks.
As a point of interest, AsciiDoc automatically wraps the following titled (preceded by a TitleBlock) AsciiDoc elements in a DocBook example element: LiteralParagraph, LiteralBlock, ListingBlock.
Variant blocks provide a mechanism for varying the behavior of a delimited block. If the block's definition has been assigned the variants option and it's attribute list includes attribute {1} then it will be used as a prefix for the block's markup template name — the name of the markup template is a lowercased {1}block.
The ExampleBlock is configured as variant block and can be used to generate admonition blocks (admonitions requiring more than just a simple admonition paragraph) by prefixing an AttributeList and setting the first attribute entry to NOTE, TIP, WARNING, IMPORTANT or CAUTION.
The following example uses the markup template configuration file section named [noteblock]:
[NOTE] .An example note block ===================================================================== Qui in magna commodo, est labitur dolorum an. Est ne magna primis adolescens. . Fusce euismod commodo velit. . Vivamus fringilla mi eu lacus. .. Fusce euismod commodo velit. .. Vivamus fringilla mi eu lacus. . Donec eget arcu bibendum nunc consequat lobortis. =====================================================================
Renders:
![]() | An example note block |
|---|---|
Qui in magna commodo, est labitur dolorum an. Est ne magna primis adolescens.
| |
As an example, here is the default configuration file ListingBlock definition:
[blockdef-listing]
delimiter=^-{3,}$
template=listingblock
presubs=specialcharacters,callouts
Allowed values are section, skip and variants.
DelimitedBlock processing proceeds as follows:
![]() | Tip |
|---|---|
Attribute expansion is performed on the block filter command before it is executed, this is useful for passing arguments to the filter. | |
The shipped AsciiDoc configuration includes the footnote:[<text>] inline macro for generating footnotes. The footnote text can span multiple lines. Example footnote:
footnote:[An example footnote.]
Which renders [2].
Footnotes are primarily useful when generating DocBook output — DocBook conversion programs render footnote outside the primary text flow.
The shipped AsciiDoc configuration includes the inline macros for generating index entries.
Here are some index entry examples taken from the example article.txt and book.txt documents in the AsciiDoc ./doc distribution directory.
And now for something completely different: +monkeys+, lions and tigers (Bengal and Siberian) using the alternative syntax index entries. ++Big cats,Lions++ ++Big cats,Tigers,Bengal Tiger++ ++Big cats,Tigers,Siberian Tiger++ Note that multi-entry terms generate separate index entries.
![]() | Note |
|---|---|
Index entries only really make sense if you are generating DocBook markup — DocBook conversion programs automatically generate an index at the point an Index section appears in source document (see the book.txt example document in the distribution ./doc directory). | |
Callouts are a mechanism for annotating verbatim text (source code, computer output and user input for example). Callout markers are placed inside the annotated text while the actual annotations are presented in a callout list after the annotated text. Here's an example:
.MS-DOS directory listing ..................................................... 10/17/97 9:04 <DIR> bin 10/16/97 14:11 <DIR> DOS <1> 10/16/97 14:40 <DIR> Program Files 10/16/97 14:46 <DIR> TEMP 10/17/97 9:04 <DIR> tmp 10/16/97 14:37 <DIR> WINNT 10/16/97 14:25 119 AUTOEXEC.BAT <2> 2/13/94 6:21 54,619 COMMAND.COM <2> 10/16/97 14:25 115 CONFIG.SYS <2> 11/16/97 17:17 61,865,984 pagefile.sys 2/13/94 6:21 9,349 WINA20.386 <3> ..................................................... <1> This directory holds MS-DOS. <2> System startup code for DOS. <3> Some sort of Windows 3.1 hack.
Which renders:
Example 1. MS-DOS directory listing
10/17/97 9:04 <DIR> bin 10/16/97 14:11 <DIR> DOS10/16/97 14:40 <DIR> Program Files 10/16/97 14:46 <DIR> TEMP 10/17/97 9:04 <DIR> tmp 10/16/97 14:37 <DIR> WINNT 10/16/97 14:25 119 AUTOEXEC.BAT
2/13/94 6:21 54,619 COMMAND.COM
10/16/97 14:25 115 CONFIG.SYS
11/16/97 17:17 61,865,984 pagefile.sys 2/13/94 6:21 9,349 WINA20.386
![]()
Explanation:
Callout marks are generated by the callout inline macro while callout lists are generated using the callout list definition. The callout macro and callout list are special in that they work together. The callout inline macro is not enabled by the normal macros substitutions option, instead it has it's own callouts substitution option.
The following attributes are available during inline callout macro substitution:
The {coids} attribute can be used during callout list item substitution — it is a space delimited list of callout IDs that refer to the explanatory list item.
Macros are a mechanism for substituting parameterized text into output documents.
Macros have a name, a single target argument and an attribute list. The default syntax is <name>:<target>[<attributelist>] for inline macros and <name>::<target>[<attributelist>] for block macros. Here are some examples:
http://www.methods.co.nz/asciidoc/index.html[Asciidoc home page] include::chapt1.txt[tabsize=2] mailto:srackham@methods.co.nz[]
Macro behavior
Inline Macros occur in an inline element context. Predefined Inline macros include URL, image and link macros.
Standard http, https, ftp, file and mailto URLs are rendered using predefined inline macros.
The default AsciiDoc inline macro syntax is very similar to a URL: all you need to do is append an attribute list containing an optional caption immediately following the URL. If no text is inside the list the URL itself supplies the displayed text.
Here are some examples:
http://www.methods.co.nz/asciidoc/[The AsciiDoc home page] mailto:joe.bloggs@foobar.com[email Joe Bloggs] mailto:joe.bloggs@foobar.com[]
Which are rendered:
![]() | Tip |
|---|---|
If the <target> has space characters they should be replaced by %20. For example large%20image.png. | |
Two AsciiDoc inline macros are provided for creating hypertext links within an AsciiDoc document. You can use either the standard macro syntax or the (preferred) alternative.
Used to specify hypertext link targets:
[[<id>,<xreflabel>]] anchor:<id>[<xreflabel>]
The <id> is a unique identifier that must begin with a letter. The optional <xreflabel> is the text to be displayed by xref macros with no captions that refer to this anchor. The <xreflabel> is only really useful when generating DocBook output. Example:
[[X1]]
You may have noticed that the syntax of this inline element is the same as that of the BlockId block element, this is no coincidence since they do roughly the same job.
Creates a hypertext link to a document anchor.
<<<id>,<caption>>> xref:<id>[<caption>]
The <id> refers to an existing anchor <id>. The optional <caption> is the link's displayed text. If <caption> is not specified then the <id>, enclosed in square brackets, is displayed. Example:
<<X15,attribute lists>>
Hypertext links to files on the local filesystem are specified using the link inline macro.
link:<target>[<caption>]
The link macro generates relative URLs. The link macro <target> is the target file name (relative to the file system location of the referring document). The optional <caption> is the link's displayed text. If <caption> is not specified then <target> is displayed. Example:
link:downloads/foo.zip[download foo.zip]
You can use the <filename>#<id> syntax to refer to an anchor within a target document but this usually only makes sense when targeting HTML documents.
Images can serve as hyperlinks using the image macro.
Inline images are inserted into the output document using the image macro. The inline syntax is:
image:<target>[<attributes>]
The contents of the image file <target> is displayed. To display the image it's file format must be supported by the target backend application. HTML and DocBook applications normally support PNG or JPG files.
Image elements are not supported by the LinuxDoc format and the alternative text in macro attribute 1 (if specified) is displayed instead.
<target> file name paths are relative to the location of the referring document.
Image macro attributes
The optional first positional attribute list entry specifies the alternative text which is displayed if the output application is unable to process the image file. For example:
image:images/logo.png[Company Logo]
The optional width and height named attributes scale the image size and can be used in any combination. The following example scales the previous example to a height of 32 pixels:
image:images/logo.png["Company Logo",height=32]
The optional link named attribute is used to link the image to an external document. The following example links a screenshot thumbnail to a full size version:
image:screen-thumbnail.png[height=32,link="screen.png"]
A Block macro reference must be contained in a single line separated either side by a blank line or a block delimiter.
Block macros behave just like Inline macros, with the following differences:
Formal images are inserted into the output document using the image macro. The syntax is:
image::<target>[<attributes>]
In all respects, apart from context, the use of the block image macro is exactly the same as it's inline counterpart.
The image can be titled by preceding the image macro with a BlockTitle. DocBook processors can normally be configured to include titled images in an automatically generated List of Figures.
For example:
.Main circuit board image::images/layout.png[J14P main circuit board]
Single lines starting with two forward slashes hard up against the left margin are treated as comments and are stripped from the output. Comment lines have been implemented as a block macro and are only valid in a block context — they are not treated as comments inside paragraphs or delimited blocks. For example:
// This is a comment.
See also Comment Blocks.
System macros are block macros that perform a predefined task which is hardwired into the asciidoc(1) program.
These system macros include the contents of a named file in the source document; it's as if the included file were part of the parent document.
There are two include macros: include which allows nested include macros and include1 which does not allow nested includes.
Example 2. Include macro examples
include::chapter1.txt[tabsize=4] +++++++++++++++++++++++ include1::table6.html[] +++++++++++++++++++++++
Include macro behavior
Lines of text in the source document can be selectively included or excluded from processing based on the the existence (or not) of a document attribute. There are two forms of conditional inclusion macro usage, the first includes document text between the ifdef and endif macros if a document attribute is defined:
ifdef::<attribute>[] : endif::<attribute>[]
The second for includes document text between the ifndef and endif macros if the attribute is not defined:
ifndef::<attribute>[] : endif::<attribute>[]
<attribute> is an attribute name which is optional in the trailing endif macro.
Take a look at the *.conf configuration files in the asciidoc(1) program directory for examples.
These system macros exhibit the same behavior as their same named system attribute references. The difference is that they are expanded globally, not just in an inline attribute context.
The following example displays a directory listing as a literal block:
-------------------- sys::[ls -ltr *.txt] --------------------
Each entry in the configuration [macros] section is a macro definition which can take one of the following forms:
<pattern> is a Python regular expression and <name> is the name of a markup template. If <name> is omitted then it is the value of the named regular expression match group named name.
Here's what happens during macro substitution
Tables are the most complex AsciiDoc elements and this section is quite long. [3]
![]() | Note |
|---|---|
AsciiDoc generates nice HTML tables, but the current crop of commonly deployed DocBook stylesheets render tables with varying degrees of success. Use tables only when really necessary. | |
The following annotated examples are all you'll need to start creating your own tables.
The only non-obvious thing you'll need to remember are the column stop characters:
Simple table:
`---`--- 1 2 3 4 5 6 --------
Output:
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |
Table with title, header and footer:
.An example table [grid="all"] '---------.-------------- Column 1 Column 2 ------------------------- 1 Item 1 2 Item 2 3 Item 3 ------------------------- 6 Three items -------------------------
Output:
Four columns totaling 15% of the pagewidth, CSV data:
[frame="all"] ````~15 1,2,3,4 a,b,c,d A,B,C,D ~~~~~~~~
Output:
| 1 | 2 | 3 | 4 |
| a | b | c | d |
| 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 Name | Contact Name | Customer Address | Phone |
|---|---|---|---|---|
| AROUT | Around the Horn | Thomas Hardy | 120 Hanover Sq. London | (171) 555-7788 |
| BERGS | Berglunds snabbkop | Christina Berglund | Berguvsvagen 8 Lulea | 0921-12 34 65 |
| BLAUS | Blauer See Delikatessen | Hanna Moos | Forsterstr. 57 Mannheim | 0621-08460 |
| BLONP | Blondel pere et fils | Frederique Citeaux | 24, place Kleber Strasbourg | 88.60.15.31 |
| BOLID | Bolido Comidas preparadas | Martin Sommer | C/ Araquil, 67 Madrid | (91) 555 22 82 |
| BONAP | Bon app' | Laurence Lebihan | 12, rue des Bouchers Marseille | 91.24.45.40 |
| BOTTM | Bottom-Dollar Markets | Elizabeth Lincoln | 23 Tsawassen Blvd. Tsawassen | (604) 555-4729 |
| BSBEV | B's Beverages | Victoria Ashworth | Fauntleroy Circus London | (171) 555-1212 |
| CACTU | Cactus Comidas para llevar | Patricio Simpson | Cerrito 333 Buenos Aires | (1) 135-5555 |
This sub-section details the AsciiDoc source file table format.
Table ::= (Ruler,Header?,Body,Footer?) Header ::= (Row+,Underline) Footer ::= (Row+,Underline) Body ::= (Row+,Underline) Row ::= (Data+)
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.
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:
The ruler format can be summarized as:
ruler ::= ((colstop,(colwidth,fillchar+)?)+, fillchar+, tablewidth?
Column stop characters specify the start and alignment of each column:
The following optional table attributes can be specified in a table's AttributeList:
You can also use an AttributeList to override the following table definition and ruler parameters: format, subs, tablewidth.
A table Underline consists of a line of three or more fillchar characters which are end delimiters for table header, footer and body sections.
The following attributes are automatically available inside table tag and markup templates.
The colwidth value is calculated as (N is the ruler column width number and M is the sum of the ruler column widths):
( N / M ) * pagewidth
If the ruler tablewidth was specified the column width is multiplied again by this value.
There is one exception: character rulers that have no pagewidth specified. In this case the colwidth value is calculated as (where N is the column character width measured on the table ruler):
( N / textwidth ) * pagewidth
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.
The format of the row is determined by the table definition format value:
The DSV (Delimiter Separated Values) format is a common UNIX tabular text file format.
Read on if you want to modify existing table behavior or create your own table definitions.
A table definition consists of two configuration file sections:
The easiest way to get a feel for how it all fits together is to take a look at the distributed AsciiDoc table definitions in the asciidoc.conf and backend configuration files.
Backend independent [tabledef-*] section entries are:
Backend specific [tabledef-*] section entries are:
The following attributes are available to the table markup template:
In addition tables are affected by the following [miscellaneous] configuration file entries:
Table definition behavior
Sooner or later, if you program for a UNIX environment, you're going to have to write a man page.
By observing a couple of additional conventions you can compose AsciiDoc files that will translate to a DocBook refentry (man page) document. The resulting DocBook file can then be translated to the native roff man page format (or other formats).
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need to include the sections and entries that differ from the default configuration. | |
![]() | Tip |
|---|---|
The best way to learn about configuration files is to read the default configuration files in the asciidoc(1) program directory along with generated backend output and the backend markup spec. You view configuration file processing by turning on the asciidoc(1) -v command-line option. | |
Markup template sections supply backend markup for translating AsciiDoc elements. Since the text is normally backend dependent you'll find these sections in the backend specific configuration files. A markup template section body can contain:
The document content placeholder is a single | character and is replaced by text from the source document. Use the {brvbar} attribute reference if you need a literal | character.
AsciiDoc reserves the following predefined, or Special, section names for specific purposes:
Each line of text in a Special section is a section entry. Section entries can take the following forms:
Section entry behavior
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need to include the sections and entries that differ from the default configuration. | |
![]() | Tip |
|---|---|
The best way to learn about configuration files is to read the default configuration files in the asciidoc(1) program directory along with generated backend output and the backend markup spec. You view configuration file processing by turning on the asciidoc(1) -v command-line option. | |
Markup template sections supply backend markup for translating AsciiDoc elements. Since the text is normally backend dependent you'll find these sections in the backend specific configuration files. A markup template section body can contain:
The document content placeholder is a single | character and is replaced by text from the source document. Use the {brvbar} attribute reference if you need a literal | character.
AsciiDoc reserves the following predefined, or Special, section names for specific purposes:
Each line of text in a Special section is a section entry. Section entries can take the following forms:
Section entry behavior
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need to include the sections and entries that differ from the default configuration. | |
![]() | Tip |
|---|---|
The best way to learn about configuration files is to read the default configuration files in the asciidoc(1) program directory along with generated backend output and the backend markup spec. You view configuration file processing by turning on the asciidoc(1) -v command-line option. | |
Markup template sections supply backend markup for translating AsciiDoc elements. Since the text is normally backend dependent you'll find these sections in the backend specific configuration files. A markup template section body can contain:
The document content placeholder is a single | character and is replaced by text from the source document. Use the {brvbar} attribute reference if you need a literal | character.
AsciiDoc reserves the following predefined, or Special, section names for specific purposes:
Each line of text in a Special section is a section entry. Section entries can take the following forms:
Section entry behavior
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need to include the sections and entries that differ from the default configuration. | |
![]() | Tip |
|---|---|
The best way to learn about configuration files is to read the default configuration files in the asciidoc(1) program directory along with generated backend output and the backend markup spec. You view configuration file processing by turning on the asciidoc(1) -v command-line option. | |
Markup template sections supply backend markup for translating AsciiDoc elements. Since the text is normally backend dependent you'll find these sections in the backend specific configuration files. A markup template section body can contain:
The document content placeholder is a single | character and is replaced by text from the source document. Use the {brvbar} attribute reference if you need a literal | character.
AsciiDoc reserves the following predefined, or Special, section names for specific purposes:
Each line of text in a Special section is a section entry. Section entries can take the following forms:
Section entry behavior
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need to include the sections and entries that differ from the default configuration. | |
![]() | Tip |
|---|---|
The best way to learn about configuration files is to read the default configuration files in the asciidoc(1) program directory along with generated backend output and the backend markup spec. You view configuration file processing by turning on the asciidoc(1) -v command-line option. | |
Markup template sections supply backend markup for translating AsciiDoc elements. Since the text is normally backend dependent you'll find these sections in the backend specific configuration files. A markup template section body can contain:
The document content placeholder is a single | character and is replaced by text from the source document. Use the {brvbar} attribute reference if you need a literal | character.
AsciiDoc reserves the following predefined, or Special, section names for specific purposes:
Each line of text in a Special section is a section entry. Section entries can take the following forms:
Section entry behavior
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need to include the sections and entries that differ from the default configuration. | |
![]() | Tip |
|---|---|
The best way to learn about configuration files is to read the default configuration files in the asciidoc(1) program directory along with generated backend output and the backend markup spec. You view configuration file processing by turning on the asciidoc(1) -v command-line option. | |
Markup template sections supply backend markup for translating AsciiDoc elements. Since the text is normally backend dependent you'll find these sections in the backend specific configuration files. A markup template section body can contain:
The document content placeholder is a single | character and is replaced by text from the source document. Use the {brvbar} attribute reference if you need a literal | character.
AsciiDoc reserves the following predefined, or Special, section names for specific purposes:
Each line of text in a Special section is a section entry. Section entries can take the following forms:
Section entry behavior
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need to include the sections and entries that differ from the default configuration. | |
![]() | Tip |
|---|---|
The best way to learn about configuration files is to read the default configuration files in the asciidoc(1) program directory along with generated backend output and the backend markup spec. You view configuration file processing by turning on the asciidoc(1) -v command-line option. | |
Markup template sections supply backend markup for translating AsciiDoc elements. Since the text is normally backend dependent you'll find these sections in the backend specific configuration files. A markup template section body can contain:
The document content placeholder is a single | character and is replaced by text from the source document. Use the {brvbar} attribute reference if you need a literal | character.
AsciiDoc reserves the following predefined, or Special, section names for specific purposes:
Each line of text in a Special section is a section entry. Section entries can take the following forms:
Section entry behavior
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need to include the sections and entries that differ from the default configuration. | |
![]() | Tip |
|---|---|
The best way to learn about configuration files is to read the default configuration files in the asciidoc(1) program directory along with generated backend output and the backend markup spec. You view configuration file processing by turning on the asciidoc(1) -v command-line option. | |
Markup template sections supply backend markup for translating AsciiDoc elements. Since the text is normally backend dependent you'll find these sections in the backend specific configuration files. A markup template section body can contain:
The document content placeholder is a single | character and is replaced by text from the source document. Use the {brvbar} attribute reference if you need a literal | character.
AsciiDoc reserves the following predefined, or Special, section names for specific purposes:
Each line of text in a Special section is a section entry. Section entries can take the following forms:
Section entry behavior
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need to include the sections and entries that differ from the default configuration. | |
![]() | Tip |
|---|---|
The best way to learn about configuration files is to read the default configuration files in the asciidoc(1) program directory along with generated backend output and the backend markup spec. You view configuration file processing by turning on the asciidoc(1) -v command-line option. | |
Markup template sections supply backend markup for translating AsciiDoc elements. Since the text is normally backend dependent you'll find these sections in the backend specific configuration files. A markup template section body can contain:
The document content placeholder is a single | character and is replaced by text from the source document. Use the {brvbar} attribute reference if you need a literal | character.
AsciiDoc reserves the following predefined, or Special, section names for specific purposes:
Each line of text in a Special section is a section entry. Section entries can take the following forms:
Section entry behavior
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need to include the sections and entries that differ from the default configuration. | |
![]() | Tip |
|---|---|
The best way to learn about configuration files is to read the default configuration files in the asciidoc(1) program directory along with generated backend output and the backend markup spec. You view configuration file processing by turning on the asciidoc(1) -v command-line option. | |
Markup template sections supply backend markup for translating AsciiDoc elements. Since the text is normally backend dependent you'll find these sections in the backend specific configuration files. A markup template section body can contain:
The document content placeholder is a single | character and is replaced by text from the source document. Use the {brvbar} attribute reference if you need a literal | character.
AsciiDoc reserves the following predefined, or Special, section names for specific purposes:
Each line of text in a Special section is a section entry. Section entries can take the following forms:
Section entry behavior
For example, the asciidoc.1.txt file in the AsciiDoc distribution ./doc directory was used to generate both asciidoc.1.css-embedded.html HTML file and (via the xmlto(1) command) the asciidoc.1 roff formatted asciidoc(1) man page.
To find out more about man pages view the man(7) manpage (man 7 man command).
The document Header is mandatory. The title line contains the man page name followed immediately by the manual section number in brackets, for example ASCIIDOC(1). The title name should not contain white space and the manual section number is a single digit optionally followed by a single character.
The first manpage section is mandatory and must be called NAME and contain a single paragraph (usually a single line) consisting of a list of one or more comma separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side. For example:
printf, fprintf, sprintf - print formatted output
AsciiDoc source file syntax and output file markup is largely controlled by a set of cascading, text based, configuration files. At runtime The AsciiDoc default configuration files are combined with optional document and user specific configuration files.
Configuration files contain named sections. Each section begins with a section name in square brackets []. The section body consists of the lines of text between adjacent section headings.
![]() | Tip |
|---|---|
When creating custom configuration files you only need t | |