Appendix H. Backend Attributes

This table contains a list of optional attributes that influence the generated outputs.

Name Backends Description

badges

xhtml11

Link badges (XHTML 1.1, CSS and Get Firefox!) in document footers. By default badges are omitted (badges is undefined).

[Note]

The path names of images, icons and scripts are relative path names to the output document not the source document.

data-uri

xhtml11

Embed images using the data: uri scheme.

disable-javascript

xhtml11

If the disable-javascript attribute is defined the asciidoc.js JavaScript is not embedded or linked to the output document. By default AsciiDoc automatically embeds or links the asciidoc.js JavaScript to the xhtml11 output document. The script dynamically generates table of contents and footnotes.

docinfo

All backends

If the docinfo attribute is defined the document information file will be included in the the header of the output file.

encoding

html4, xhtml11, docbook

Set the input and output document character set encoding. For example the --attribute encoding=ISO-8859-1 command-line option will set the character set encoding to ISO-8859-1.

  • The default encoding is UTF-8.
  • This attribute specifies the character set in the output document.
  • The encoding name must correspond to a Python codec name or alias.
  • The encoding attribute can be set using an AttributeEntry inside the document header. For example:

    :encoding: ISO-8859-1

icons

xhtml11

Link admonition paragraph and admonition block icon images and badge images. By default icons is undefined and text is used in place of icon images.

iconsdir

html4, xhtml11, docbook

The name of the directory containing linked admonition and navigation icons. Defaults to ./images/icons.

imagesdir

html4, xhtml11, docbook

If this attribute is defined it is prepended to the target image file name paths in inline and block image macros.

linkcss

xhtml11

Link CSS stylesheets and JavaScripts (see the stylesdir and scriptsdir attributes below). By default linkcss is undefined in which case stylesheets and scripts are automatically embedded in the output document.

max-width

xhtml11

Set the document maximum display width (sets the body element CSS max-width property). max-width definition must precede the document header.

numbered

html4, xhtml11, docbook (XSL Stylesheets)

Adds section numbers to section titles. The docbook backend ignores numbered attribute entries after the document header.

plaintext

All backends

If this global attribute is defined all inline substitutions are suppressed and block indents are retained. This option is useful when dealing with large amounts of imported plain text.

quirks

xhtml11

Include the xhtml11-quirks.css stylesheet to work around IE6 browser incompatibilities.

revremark

docbook

A short summary of changes in this document revision. Must be defined prior to the first document section. The document also needs to be dated to output this attribute.

scriptsdir

xhtml11

The name of the directory containing linked JavaScripts. Defaults to . (the same directory as the linking document).

sgml

docbook

The --backend=docbook command-line option produces DocBook XML. You can produce the older DocBook SGML format using the --attribute sgml command-line option.

stylesdir

xhtml11

The name of the directory containing linked stylesheets. Defaults to . (the same directory as the linking document).

stylesheet

xhtml11

The file name of an optional additional CSS stylesheet. If you are embedding the stylesheet specify the actual file location; if you are linking CSS specify the file name relative to the directory specified by the stylesdir attribute.

theme

xhtml11

Use alternative stylesheets (see Stylesheets).

toc

xhtml11, docbook (XSL Stylesheets)

Adds a table of contents to the start of an article or book document. The toc attribute can be specified using the --attribute toc command-line option or a :toc: attribute entry in the document header. The toc attribute is defined by default when the docbook backend is used. To disable table of contents generation undefine the toc attribute by putting a :toc!: attribute entry in the document header or from the command-line with an --attribute toc! option.

xhtml11 backend

  • JavaScript needs to be enabled in your browser.
  • The following example generates a numbered table of contents using a JavaScript embedded in the mydoc.html output document (to link the script to the output document use the linkcss and scriptsdir attributes):

    $ asciidoc -a toc -a numbered mydoc.txt

toc-title

xhtml11

Sets the table of contents title (defaults to Table of Contents).

toclevels

xhtml11

Sets the number of title levels (1..4) reported in the table of contents (see the toc attribute above). Defaults to 2 and must be used with the toc attribute. Example usage:

$ asciidoc -a toc -a toclevels=3 doc/asciidoc.txt