The xtpxlib-xdoc component contains the following XProc (1.0) library module:
Module/Pipeline | Description |
---|---|
xtpxlib-xdoc.mod.xpl | Library with support pipelines for xdoc and related conversions. |
xtpxlib-xdoc.mod.xpl
File: xplmod/xtpxlib-xdoc.mod/xtpxlib-xdoc.mod.xpl
Library with support pipelines for xdoc
and related conversions.
Prefix | Namespace URI |
---|---|
xdoc | http://www.xtpxlib.nl/ns/xdoc |
xdoc:markdown-to-docbook
Converts the contents of xdoc:MARKDOWN
elements into DocBook.
This pipeline checks the incoming XML for xdoc:MARKDOWN
elements. The contents of these elements is assumed to contain Markdown. The pipeline tries to convert this into DocBook. The xdoc:MARKDOWN
element is removed/unwrapped.
The following rules apply:
The contents of an xdoc:MARKDOWN
element is stringified (so any child elements are lost).
The resulting text can be indented, using space characters only (no tabs!). The non-empty line with the minimum indent is assumed to be its left margin.
Only simple Markdown is supported. Specifically:
Inline markup for emphasis, bold, code, etc.
Links. A link target starting with a %
is handled as an internal link (the @xml:id
of something in the encompassing DocBook).
Code blocks (using three consecutive back-ticks)
Headers (these are all converted into the same DocBook bridgehead
elements)
Specifically not supported (yet?) are tables.
If you add an header-only="true"
attribute to the xdoc:MARKDOWN
element, only the first paragraph will be output.
Port | Type | Primary? | Description |
---|---|---|---|
source | in | yes | Any XML that might contain xdoc:MARKDOWN elements for conversion. |
result | out | yes | The same XML but with the xdoc:MARKDOWN element's contents converted into DocBook. |