Name
cx:asciidoctor — Convert Asciidoctor documents.
Synopsis
The cx:asciidoctor
step converts Asciidoctor documents to DocBook,
HTML5, or PDF.
Input port | Primary | Sequence | Content types |
---|---|---|---|
source | ✔ | text/asciidoc text |
Output port | Primary | Sequence | Content types |
---|---|---|---|
result | ✔ | xml html application/pdf |
Option name | Type | Values | Default value |
---|---|---|---|
attributes | map(xs:QName, item()*)? | () | |
backend | xs:string? | ('docbook', 'html5', 'pdf') | () |
parameters | map(xs:QName, item()*)? | () |
<p:import href="https://xmlcalabash.com/ext/library/asciidoctor.xpl"/>
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
| <p:input port="source" content-types="text/asciidoc text"/>
| <p:output port="result" content-types="xml html application/pdf"/>
| <p:option name="backend" as="xs:string?" values="('docbook', 'html5', 'pdf')"/>
5 | <p:option name="parameters" as="map(xs:QName, item()*)?"/>
| <p:option name="attributes" as="map(xs:QName, item()*)?"/>
|</p:declare-step>
Description
Asciidoctor is the modern toolchain for processing Asciidoc markup. Asciidoc is a sophisticated lightweight markup language that can be used to represent complex structures. One of its original goals was to capture DocBook in a markdown-like style. Asciidoc predates Markdown.
The Java API that XML Calabash uses, AsciidoctorJ, offers both options and attributes. In fact, the attributes are part of the options API. It all seems a bit confused to me.
For the step, I’ve implemented options in the parameters
option and
attributes in the attributes
option.
Parameters
The parameters listed below are supported. These are passed directly to the Asciidoctor API; please consult the API for more details.
Parameter | Type | Notes |
---|---|---|
backend | xs:string | Must be the same as the backend option, if both are specified. |
doctype | xs:string | |
standalone | xs:boolean | |
template_dirs | xs:string* | Must be directory names |
template_engine | xs:string | |
template_cache | xs:boolean | |
safe | xs:string | “unsafe ”, “safe ”,
“server ”, or “secure ” |
sourcemap | xs:boolean | |
eruby | xs:string | |
compact | xs:boolean | |
parse_header_only | xs:boolean |
Attributes
The attributes listed below are supported. These are passed directly to the Asciidoctor API; please consult the API for more details.
Parameter | Type | Notes |
---|---|---|
allow_uri_read | xs:boolean | |
appendix_caption | xs:string | |
attribute_missing | xs:string | |
attribute_undefined | xs:string | |
backend | xs:string | |
compat_mode | xs:string | “default ” or “legacy ” |
data_uri | xs:boolean | |
docdate | xs:dateTime | |
doctime | xs:dateTime | |
doctype | xs:string | |
experimental | xs:boolean | |
hardbreaks | xs:boolean | |
hide_uri_scheme | xs:boolean | |
iconfont_cdn | xs:anyURI | |
iconfont_name | xs:string | |
iconfont_remote | xs:boolean | |
icons | xs:string | |
icons_dir | xs:string | |
ignore_undefined | xs:boolean | |
imagesdir | xs:string | |
link_attrs | xs:boolean | |
link_css | xs:boolean | |
localdate | xs:dateTime | |
localtime | xs:dateTime | |
math | xs:string | |
max_include_depth | xs:int | |
no_footer | xs:boolean | |
section_numbers | xs:boolean | |
sect_num_levels | xs:int | |
set_anchors | xs:boolean | |
show_title | xs:boolean | |
skip_front_matter | xs:boolean | |
source_highlighter | xs:string | |
source_language | xs:string | |
stylesheet_name | xs:string | |
styles_dir | xs:string | |
title | xs:string | |
toc | xs:string | “true ”, “false ”,
“top ”, “bottom ”, “left ”,
“right ”, “preamble ”, or
“macro ” |
untitled_label | xs:string |
Dependencies
This step is included in the XML Calabash application. If you are getting XML Calabash from Maven, you will also need to include the extension dependency:
com.xmlcalabash:asciidoctor:3.0.0-alpha24
The following third-party dependencies will also be included transitively:
org.asciidoctor:asciidoctorj:3.0.0
org.asciidoctor:asciidoctorj-pdf:2.3.19