Name

cx:asciidoctor — Convert Asciidoctor documents.

Synopsis

The cx:asciidoctor step converts Asciidoctor documents to DocBook, HTML5, or PDF.

Input portPrimarySequenceContent types
source✔  text/asciidoc text 
Output portPrimarySequenceContent types
result✔  xml html application/pdf 
Option nameTypeValuesDefault value
attributesmap(xs:QName, item()*)? ()
backendxs:string?('docbook', 'html5', 'pdf') ()
parametersmap(xs:QName, item()*)? ()
This is an extension step; to use it, your pipeline must include its declaration. For example, by including the extension library with an import at the top of your pipeline:
<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.

ParameterTypeNotes
backendxs:stringMust be the same as the backend option, if both are specified.
doctypexs:string
standalonexs:boolean
template_dirsxs:string*Must be directory names
template_enginexs:string
template_cachexs:boolean
safexs:stringunsafe”, “safe”, “server”, or “secure
sourcemapxs:boolean
erubyxs:string
compactxs:boolean
parse_header_onlyxs:boolean

Attributes

The attributes listed below are supported. These are passed directly to the Asciidoctor API; please consult the API for more details.

ParameterTypeNotes
allow_uri_readxs:boolean
appendix_captionxs:string
attribute_missingxs:string
attribute_undefinedxs:string
backendxs:string
compat_modexs:stringdefault” or “legacy
data_urixs:boolean
docdatexs:dateTime
doctimexs:dateTime
doctypexs:string
experimentalxs:boolean
hardbreaksxs:boolean
hide_uri_schemexs:boolean
iconfont_cdnxs:anyURI
iconfont_namexs:string
iconfont_remotexs:boolean
iconsxs:string
icons_dirxs:string
ignore_undefinedxs:boolean
imagesdirxs:string
link_attrsxs:boolean
link_cssxs:boolean
localdatexs:dateTime
localtimexs:dateTime
mathxs:string
max_include_depthxs:int
no_footerxs:boolean
section_numbersxs:boolean
sect_num_levelsxs:int
set_anchorsxs:boolean
show_titlexs:boolean
skip_front_matterxs:boolean
source_highlighterxs:string
source_languagexs:string
stylesheet_namexs:string
styles_dirxs:string
titlexs:string
tocxs:stringtrue”, “false”, “top”, “bottom”, “left”, “right”, “preamble”, or “macro
untitled_labelxs: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