Navigation

User login

To prevent automated spam submissions leave this field empty.

a2x Linux Command Reference Example: a2x command man page

Name

a2x - convert Asciidoc text file to PDF, XHTML, HTML Help, manpage or plain text

Synopsis

a2x [OPTIONS] FILE

Description

A DocBook toolchain wrapper script that translates an AsciiDoc text file FILE to PDF, XHTML (single page or chunked), man page, HTML Help or plain text formats. PDF, XHTML, man page and HTML Help formats are are generated using the asciidoc(1)/xsltproc(1)/DocBook XSL Stylesheets toolchain. Plain text is produced by passing asciidoc(1) generated HTML through lynx(1). The htmlhelp format option generates .hhp, .hhc and .html files suitable for compilation to an HTML Help .chm file.

Options

-a, --attribute=ATTRIBUTE

Set asciidoc(1) attribute value (shortcut for --asciidoc-opts="-a ATTRIBUTE" option). This option may be specified more than once.
--asciidoc-opts=ASCIIDOC_OPTS
Additional asciidoc(1) options. This option may be specified more than once.
--copy
Copy distributed docbook-xsl CSS stylesheet admonition and navigation icons to their respective destinations. Applies to xhtml, chunked, htmlhelp formats. The default behavior is to suppress copying.
-D, --destination-dir=PATH
Output directory. Defaults to source FILE directory.
-d, --doctype=DOCTYPE
DocBook document type: article, manpage or book. Default document type is article unless the format is manpage (in which case it defaults to manpage).
-f, --format=FORMAT
Output format: chunked, htmlhelp, manpage, pdf, text or xhtml.
-h, --help
Print command-line syntax and program options to stdout.
--icons
Use admonition or navigation icon images in output documents. The default behavior is to use text in place of icons.
--icons-dir=PATH
A path (relative to destination HTML files) containing admonition and navigation icons. Defaults to ./images/icons/. Applies to xhtml, chunked, htmlhelp formats.
-n, --dry-run
Don't do anything just print what would have been done.
-s, --skip-asciidoc
Skip asciidoc execution. This is useful for converting DocBook XML files not derived from AsciiDoc sources. Ignored if --format*='text.
--stylesheet=PATH
A path (relative to destination HTML files) specifying the docbook-xsl CSS stylesheet file. Defaults to ./docbook-xsl.css. Applies to xhtml, chunked, htmlhelp formats.
-v, --verbose
Print operational details to stderr. A second -v option applies the verbose option to toolchain commands.
--version
Print program version to stdout.
--xsltproc-opts=XSLTPROC_OPTS
Additional xsltproc(1) options. This option may be specified more than once.
Output Files

Output files are written to the directory specified by the --destination-dir option. If no --destination-dir option is set output files are written to the source FILE directory.

Output files have the same name as the source FILE but with an appropriate file name extension: .html for xhtml; .hhp for htmlhelp; .pdf for pdf; .text for text. By convention manpages have no .man extension (man page section number only). Chunked HTML directory names have a .chunked extension; chunked HTML Help directory names have a .htmlhelp extension.

Same named existing files are overwritten.

Intermediate output files are written to the source FILE directory and are not automatically deleted.

Intermediate DocBook XML files generated by AsciiDoc are only regenerated if out of date with respect to the AsciiDoc source FILE.

In addition to generating HTML files the xhtml, chunked and htmlhelp formats copy the DocBook XSL stylesheet plus admonition and navigation icons distributed with AsciiDoc to their respective destination locations. Existing stylesheets and icons are only copied if they are newer than the destination files or if the destination files are missing.

The xhtml format generates a single XHTML output page. The chunked format writes multiple per-section HTML pages to a chunked directory in the destination directory. The chunked directory has the same name as the source FILE name plus a .chunked extension.

Examples

a2x -f pdf --icons doc/quickstart.txt

Generates doc/quickstart.pdf with admonition icons.
a2x -f chunked -D ../webpages guide.txt
Creates chunked directory ../webpages/guide.chunked containing chunked HTML files. Also copies docbook-xsl.css stylesheet to the ../webpages/guide.chunked directory plus admonition and navigation icons to the ../webpages/guide.chunked/images/icons directory.

Author

Written by Stuart Rackham

by Susan White on Mon, 10/18/2010 - 07:49

Recent Posts

Poll

Are you excited for Avatar 2?
I already dyed my skin blue in anticipation!
44%
I think I'll wait for the reviews
32%
I prefer movies about puppies and kittens!
24%
Total votes: 5962

Random image

The location of French Guiana on a map