NAME
asciidoctor - converts AsciiDoc source files to HTML, DocBook, and other formatsSYNOPSIS
asciidoctor [OPTION]... FILE...DESCRIPTION
The command converts the AsciiDoc source file(s) FILE to HTML5, DocBook 5, man(ual) page, and other custom output formats.OPTIONS
Security Settings
-B, --base-dir=DIRBase directory containing the document and
resources. Defaults to the directory containing the source file or, if the
source is read from a stream, the working directory. When combined with the
safe mode setting, can be used to chroot the execution of the program.
Set safe mode level: unsafe,
safe, server, or secure. Disables potentially dangerous
macros in source files, such as include::[]. If not set, the safe mode level
defaults to unsafe when Asciidoctor is invoked using this script.
Set safe mode level to safe. Enables
include directives, but prevents access to ancestor paths of source file.
Provided for compatibility with the asciidoc command. If not set, the safe
mode level defaults to unsafe when Asciidoctor is invoked using this
script.
Document Settings
-a, --attribute=ATTRIBUTEDefine, override, or unset a document
attribute. Command-line attributes take precedence over attributes defined in
the source file unless either the name or value ends in @.
ATTRIBUTE is normally formatted as a key-value pair, in the form
NAME=VALUE. Alternate forms are NAME (where the VALUE
defaults to an empty string), NAME! (unsets the NAME attribute),
and NAME=VALUE@ (or NAME@=VALUE) (where VALUE does not
override the NAME attribute if it’s already defined in the
source document). Values containing spaces should be enclosed in quotes.
This option may be specified more than once.
Backend output file format: html5,
docbook5, and manpage are supported out of the box. You can also
use the backend alias names html (aliased to html5) or
docbook (aliased to docbook5). Other values can be passed, but
if Asciidoctor cannot resolve the backend to a converter, it will fail.
Defaults to html5.
Document type: article, book,
manpage, or inline. Sets the root element when using the
docbook backend and the style class on the HTML body element when using
the html backend. The book document type allows multiple level-0
section titles in a single document. The manpage document type enables
parsing of metadata necessary to produce a man page. The inline
document type allows the content of a single paragraph to be formatted and
returned without wrapping it in a containing element. Defaults to
article.
Document Conversion
-D, --destination-dir=DIRDestination output directory. Defaults to the
directory containing the source file or, if the source is read from a stream,
the working directory. If specified, the directory is resolved relative to the
working directory.
Template engine to use for the custom
converter templates. The gem with the same name as the engine will be loaded
automatically. This name is also used to build the full path to the custom
converter templates. If a template engine is not specified, it will be
auto-detected based on the file extension of the custom converter templates
found.
Output an embeddable document, which excludes
the header, the footer, and everything outside the body of the document. This
option is useful for producing documents that can be inserted into an external
template.
Add the specified directory to the load path,
so that -r can load extensions from outside the default Ruby load path.
This option may be specified more than once.
Auto-number section titles. Synonym for
--attribute sectnums.
Write output to file OUT_FILE. Defaults
to the base name of the input file suffixed with backend extension. The
file is resolved relative to the working directory. If the input is read from
standard input or a named pipe (fifo), then the output file defaults to
stdout. If OUT_FILE is -, then the output file is written to
standard output.
Source directory. Currently only used if the
destination directory is also specified. Used to preserve the directory
structure of files converted within this directory in the destination
directory. If specified, the directory is resolved relative to the working
directory.
Require the specified library before executing
the processor, using the standard Ruby require. This option may be specified
more than once.
Output an embeddable document, which excludes
the header, the footer, and everything outside the body of the document. This
option is useful for producing documents that can be inserted into an external
template.
A directory containing custom converter
templates that override one or more templates from the built-in set. (requires
tilt gem)
If there is a subfolder that matches the engine name (if specified), that folder
is appended to the template directory path. Similarly, if there is a subfolder
in the resulting template directory that matches the name of the backend, that
folder is appended to the template directory path.
This option may be specified more than once. Matching templates found in
subsequent directories override ones previously discovered.
Processing Information
--failure-level=LEVELSet the minimum logging level (default: FATAL)
that yields a non-zero exit code (i.e., failure). If this option is not set,
the program exits with a zero exit code even if warnings or errors have been
logged.
Silence application log messages and script
warnings.
Include backtrace information when reporting
errors.
Sets log level to DEBUG so application
messages logged at INFO or DEBUG level are printed to stderr.
Turn on script warnings (applies to executed
code).
Print timings report to stderr (time to read,
parse, and convert).
Program Information
-h, --help [TOPIC]Print a help message. Show the command usage
if TOPIC is not specified or recognized. Dump the Asciidoctor man page
(in troff/groff format) if TOPIC is manpage. Print an AsciiDoc
syntax crib sheet (in AsciiDoc) if TOPIC is syntax.
Print program version number.
-v can also be used if no source files are specified.
ENVIRONMENT
Asciidoctor honors the SOURCE_DATE_EPOCH environment variable. If this variable is assigned an integer value, that value is used as the epoch of all input documents and as the local date and time. See <https://reproducible-builds.org/specs/source-date-epoch/> for more information about this environment variable.EXIT STATUS
0Success.
Failure (syntax or usage error; configuration
error; document processing failure; unexpected error).
BUGS
Refer to the Asciidoctor issue tracker at <https://github.com/asciidoctor/asciidoctor/issues?q=is%3Aopen>.AUTHORS
Asciidoctor is led and maintained by Dan Allen and Sarah White and has received contributions from many individuals in the Asciidoctor community. The project was started in 2012 by Ryan Waldron based on a prototype written by Nick Hengeveld for the Git website. Jason Porter wrote the first implementation of the CLI interface provided by this command.RESOURCES
Project website: <https://asciidoctor.org>COPYING
Copyright (C) 2012-present Dan Allen, Sarah White, Ryan Waldron, and the individual contributors to Asciidoctor. Use of this software is granted under the terms of the MIT License.2022-01-05 | Asciidoctor 2.0.17 |