4. AsciiDoc Backends

The asciidoc(1) command translates an AsciiDoc formatted file to the backend format specified by the -b (--backend) command-line option. asciidoc(1) itself has little intrinsic knowledge of backend formats, all translation rules are contained in customizable cascading configuration files. Backend specific attributes are listed in the Backend Attributes section.

AsciiDoc ships with the following predefined backend output formats:

4.1. docbook

AsciiDoc generates the following DocBook document types: article, book and refentry (corresponding to the AsciiDoc article, book and manpage document types).

DocBook documents are not designed to be viewed directly. Most Linux distributions come with conversion tools (collectively called a toolchain) for converting DocBook files to presentation formats such as Postscript, HTML, PDF, EPUB, DVI, PostScript, LaTeX, roff (the native man page format), HTMLHelp, JavaHelp and text.

The AsciiDoc Preamble element generates a DocBook book preface.

4.2. xhtml11

The default asciidoc(1) backend is xhtml11 — XHTML 1.1 markup styled with CSS2. Output files have a .html extension. xhtml11 document generation is influenced by the following optional attributes (the default behavior is to generate XHTML with no section numbers, embedded CSS and no linked admonition icon images):

4.2.1. Stylesheets

AsciiDoc XHTML output is styled using CSS2 stylesheets from the distribution ./stylesheets/ directory.

[Important]Important

All browsers have CSS quirks, but Microsoft’s IE6 has so many omissions and errors that the xhtml11-quirks.css stylesheet and xhtml11-quirks.conf configuration files are included during XHTML backend processing to to implement workarounds for IE6. If you don’t use IE6 then the quirks stylesheet and configuration files can be omitted using the --attribute quirks! command-line option.

Default xhtml11 stylesheets:

./stylesheets/xhtml11.css
The main stylesheet.
./stylesheets/xhtml11-manpage.css
Tweaks for manpage document type generation.
./stylesheets/xhtml11-quirks.css
Stylesheet modifications to work around IE6 browser incompatibilities.

Use the theme attribute to select an alternative set of stylesheets. For example, the command-line option -a theme=foo will use stylesheets foo.css, foo-manpage.css and foo-quirks.css instead of the default stylesheets.

Use the stylesheet attribute to include an additional stylesheet in XHTML documents. For example, the command-line option -a stylesheet=newsletter.css will use stylesheets newsletter.css.

4.3. html4

This backend generates plain (unstyled) HTML 4.01 Transitional markup.