Name

p:markdown-to-html — Converts Markdown formatted text to HTML.

Synopsis

The p:markdown-to-html step converts a text document in Markdown to XHTML.

Input portPrimarySequenceContent types
source✔  text 
Output portPrimarySequenceContent types
result✔  html 
Option nameTypeDefault value
parametersmap(xs:QName, item()*)?()
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
  |   <p:input port="source" primary="true" content-types="text"/>
  |   <p:output port="result" primary="true" content-types="html"/>
  |   <p:option name="parameters" as="map(xs:QName, item()*)?"/>
5 |</p:declare-step>
Errors
CodeDescription
Implementation defined features

Description

The p:markdown-to-html step is defined in the XProc 3.1: Standard Step Library. It is also described on XProcRef.org.

The XML Calabash implementation of p:markdown-to-html uses the Flexmark-java implementation of Commonmark.

Extensions

This implementation supports many of the extensions provided by Flexmark-java. Many properties of each extension can be configured by providing a map in the parameters option. The extensions map is identified in the parameters option with the key cx:extensions. The value of that parameter must be a map. Within that map, the key must be the name of the extension. The value must be a map between the option property names and their values.

It’s also possible to configure the step with a Java class. See the section called “Java configuration”.

The following extensions are based on Flexmark-java version 0.64.8.

Extension nameFlexmark-java extension
abbreviationAbbreviationExtension
admonitionAdmonitionExtension
anchorlinkAnchorLinkExtension
asideAsideExtension
attributesAttributesExtension
autolinkAutolinkExtension
definitionDefinitionExtension
emojiEmojiExtension
enumeratedreferenceEnumeratedReferenceExtension
escaped-characterEscapedCharacterExtension
footnotesFootnoteExtension
gfm-issuesGfmIssuesExtension
gfm-strikethroughStrikethroughExtension
gfm-strikethrough-subscriptSubscriptExtension
gfm-strikethrough-strikethrough-subscriptStrikethroughSubscriptExtension
gfm-tasklistTaskListExtension
gfm-usersGfmUsersExtension
gitlabGitLabExtension
insInsExtension
jekyll-front-matterJekyllFrontMatterExtension
macrosMacrosExtension
media-tagsMediaTagsExtension
resizable-imageResizableImageExtension
superscriptSuperscriptExtension
tablesTablesExtension
sim-tocSimTocExtension
tocTocExtension
typographicTypographicExtension
wikilinkWikiLinkExtension
xwiki-macrosMacroExtension
yaml-front-matterYamlFrontMatterExtension
youtube-embeddedYouTubeLinkExtension

abbreviation extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.abbreviation.AbbreviationExtension.

This extension has the following configurable options:

PropertyValue
abbreviations-keeplast | first | fail | locked
use-linksxs:boolean
abbreviations-placementas-is | document-top | group-with-first | group-with-last | document-bottom
abbreviations-sortas-is | sort | sort-unused-last | sort-delete-unused | delete-unused
make-merged-abbreviations-uniquexs:boolean

admonition extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.admonition.AdmonitionExtension.

This extension has the following configurable options:

PropertyValue
content-indentxs:integer
allow-leading-spacexs:boolean
interrupts-paragraphxs:boolean
interrupts-item-paragraphxs:boolean
with-spaces-interrupts-item-paragraphxs:boolean
allow-lazy-continuationxs:boolean
unresolved-qualifierxs:string
qualifier-type-mapmap(xs:string, xs:string)
qualifier-title-mapmap(xs:string, xs:string)
type-svg-mapmap(xs:string, xs:string)

aside extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.aside.AsideExtension.

This extension has the following configurable options:

PropertyValue
extend-to-blank-linexs:boolean
ignore-blank-linexs:boolean
allow-leading-spacexs:boolean
interrupts-paragraphxs:boolean
interrupts-item-paragraphxs:boolean
with-lead-spaces-interrupts-item-paragraphxs:boolean

attributes extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.attributes.AttributesExtension.

This extension has the following configurable options:

PropertyValue
attributes-keeplast | first | fail | locked
assign-text-attributesxs:boolean
fenced-code-info-attributesxs:boolean
fenced-code-add-attributesadd-to-pre-code | add-to-pre | add-to-code
wrap-non-attribute-textxs:boolean
use-empty-implicit-as-span-delimiterxs:boolean
format-attributes-combine-consecutivexs:boolean
format-attributes-sortxs:boolean
format-attributes-spacesas-is | add | remove
format-attribute-equal-spaceas-is | add | remove
format-attribute-value-quotesas-is | no-quotes-single-preferred | no-quotes-double-preferred | single-preferred | double-preferred | single-quotes | double-quotes
format-attribute-idas-is | implicit-preferred | explicit-preferred
format-attribute-classas-is | implicit-preferred | explicit-preferred

definition extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.definition.DefinitionExtension.

This extension has the following configurable options:

PropertyValue
colon-markerxs:boolean
marker-spacesxs:integer
tilde-markerxs:boolean
double-blank-line-breaks-listxs:boolean
format-marker-spacesxs:integer
format-marker-typeany | colon | tilde

emoji extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.emoji.EmojiExtension.

This extension has the following configurable options:

PropertyValue
root-image-pathxs:string
use-shortcut-typegithub | emoji-cheat-sheet | any-github-preferred | any-emoji-cheat-sheet-preferred
use-image-typeimage-only | unicode-only | unicode-fallback-to-image
use-unicode-file-namesxs:boolean
attr-image-sizexs:string
attr-image-classxs:string
attr-alignxs:string

enumeratedreference extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.enumerated.reference.EnumeratedReferenceExtension.

This extension has the following configurable options:

PropertyValue
enumerated-references-keeplast | first | fail | locked
enumerated-reference-placementas-is | document-top | group-with-first | group-with-last | document-bottom
enumerated-reference-sortas-is | sort | sort-unused-last | sort-delete-unused | delete-unused

escaped-character extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.escaped.character.EscapedCharacterExtension.

This extension has no configurable options.

footnotes extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.footnotes.FootnoteExtension.

This extension has the following configurable options:

PropertyValue
footnotes-keeplast | first | fail | locked
footnote-ref-prefixxs:string
footnote-ref-suffixxs:string
footnote-back-ref-stringxs:string
footnote-link-ref-classxs:string
footnote-back-link-ref-classxs:string
footnote-placementas-is | document-top | group-with-first | group-with-last | document-bottom
footnote-sortas-is | sort | sort-unused-last | sort-delete-unused | delete-unused

gfm-issues extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.gfm.issues.GfmIssuesExtension.

This extension has the following configurable options:

PropertyValue
git-hub-issues-url-rootxs:string
git-hub-issue-url-prefixxs:string
git-hub-issue-url-suffixxs:string
git-hub-issue-html-prefixxs:string
git-hub-issue-html-suffixxs:string

gfm-strikethrough extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension.

This extension has the following configurable options:

PropertyValue
strikethrough-style-html-openxs:string
strikethrough-style-html-closexs:string

gfm-strikethrough-subscript extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.gfm.strikethrough.SubscriptExtension.

This extension has the following configurable options:

PropertyValue
subscript-style-html-openxs:string
subscript-style-html-closexs:string

gfm-strikethrough-strikethrough-subscript extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughSubscriptExtension.

This extension has the following configurable options:

PropertyValue
strikethrough-style-html-openxs:string
strikethrough-style-html-closexs:string
subscript-style-html-openxs:string
subscript-style-html-closexs:string

gfm-tasklist extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension.

This extension has the following configurable options:

PropertyValue
item-done-markerxs:string
item-not-done-markerxs:string
tight-item-classxs:string
loose-item-classxs:string
paragraph-classxs:string
item-done-classxs:string
item-not-done-classxs:string
format-list-item-caseas-is | lowercase | uppercase
format-list-item-placementas-is | incomplete-first | incomplete-nested-first | complete-to-non-task | complete-nested-to-non-task
format-ordered-task-item-priorityxs:integer
format-default-task-item-priorityxs:integer
format-prioritized-task-itemsxs:boolean
format-task-item-prioritiesmap(xs:string, xs:integer) (String must be a single character.)

gfm-users extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.gfm.users.GfmUsersExtension.

This extension has the following configurable options:

PropertyValue
git-hub-users-url-rootxs:string
git-hub-user-url-prefixxs:string
git-hub-user-url-suffixxs:string
git-hub-user-html-prefixxs:string
git-hub-user-html-suffixxs:string

gitlab extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.gitlab.GitLabExtension.

This extension has the following configurable options:

PropertyValue
ins-parserxs:boolean
del-parserxs:boolean
block-quote-parserxs:boolean
nested-block-quotesxs:boolean
inline-math-parserxs:boolean
render-block-mathxs:boolean
render-block-mermaidxs:boolean
render-video-imagesxs:boolean
render-video-linkxs:boolean
math-languagesxs:string*
mermaid-languagesxs:string*
inline-math-classxs:string
block-math-classxs:string
block-mermaid-classxs:string
video-image-classxs:string
video-image-link-text-formatxs:string

ins extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.ins.InsExtension.

This extension has the following configurable options:

PropertyValue
ins-style-html-openxs:string
ins-style-html-closexs:string

jekyll-front-matter extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.jekyll.front.matter.JekyllFrontMatterExtension.

This extension has no configurable options.

macros extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.macros.MacrosExtension.

This extension has the following configurable options:

PropertyValue
macro-definitions-keeplast | first | fail | locked
macro-definitions-placementas-is | document-top | group-with-first | group-with-last | document-bottom
macro-definitions-sortas-is | sort | sort-unused-last | sort-delete-unused | delete-unused
source-wrap-macro-referencesxs:boolean

media-tags extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.media.tags.MediaTagsExtension.

This extension has no configurable options.

resizable-image extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.resizable.image.ResizableImageExtension.

This extension has no configurable options.

superscript extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.superscript.SuperscriptExtension.

This extension has the following configurable options:

PropertyValue
superscript-style-html-openxs:string
superscript-style-html-closexs:string

tables extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.tables.TablesExtension.

This extension has the following configurable options:

PropertyValue
trim-cell-whitespacexs:boolean
min-separator-dashesxs:integer
max-header-rowsxs:integer
min-header-rowsxs:integer
append-missing-columnsxs:boolean
discard-extra-columnsxs:boolean
column-spansxs:boolean
header-separator-column-matchxs:boolean
class-namexs:string
with-captionxs:boolean
format-table-trim-cell-whitespacexs:boolean
format-table-lead-trail-pipesxs:boolean
format-table-space-around-pipesxs:boolean
format-table-adjust-column-widthxs:boolean
format-table-apply-column-alignmentxs:boolean
format-table-fill-missing-columnsxs:boolean
format-table-fill-missing-min-columnxs:integer
format-table-left-align-markeras-is | add | remove
format-table-min-separator-column-widthxs:integer
format-table-min-separator-dashesxs:integer
format-table-captionas-is | add | remove-empty | remove
format-table-caption-spacesas-is | add | remove
format-table-indent-prefixxs:string

sim-toc extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.toc.SimTocExtension.

This extension has the following configurable options:

PropertyValue
levelsxs:integer
is-text-onlyxs:boolean
is-numberedxs:boolean
list-typehierarchy | flat | flat-reversed | sorted | sorted-reversed
is-htmlxs:boolean
title-levelxs:integer
titlexs:string
ast-include-optionsxs:boolean
blank-line-spacerxs:boolean
div-classxs:string
list-classxs:string
case-sensitive-toc-tagxs:boolean
format-update-on-formatas-is | update | remove

toc extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.toc.TocExtension.

This extension has the following configurable options:

PropertyValue
levelsxs:integer
is-text-onlyxs:boolean
is-numberedxs:boolean
list-typehierarchy | flat | flat-reversed | sorted | sorted-reversed
is-htmlxs:boolean
title-levelxs:integer
titlexs:string
ast-include-optionsxs:boolean
blank-line-spacerxs:boolean
div-classxs:string
list-classxs:string
case-sensitive-toc-tagxs:boolean
format-update-on-formatas-is | update | remove

typographic extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.typographic.TypographicExtension.

This extension has the following configurable options:

PropertyValue
enable-quotesxs:boolean
enable-smartsxs:boolean
angle-quote-closexs:string
angle-quote-openxs:string
angle-quote-unmatchedxs:string
double-quote-closexs:string
double-quote-openxs:string
double-quote-unmatchedxs:string
ellipsisxs:string
ellipsis-spacedxs:string
em-dashxs:string
en-dashxs:string
single-quote-closexs:string
single-quote-openxs:string
single-quote-unmatchedxs:string

xwiki-macros extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.xwiki.macros.MacroExtension.

This extension has the following configurable options:

PropertyValue
enable-inline-macrosxs:boolean
enable-block-macrosxs:boolean
enable-renderingxs:boolean

yaml-front-matter extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.yaml.front.matter.YamlFrontMatterExtension.

This extension has no configurable options.

youtube-embedded extension

Consult documentation for the Flexmark-java extension com.vladsch.flexmark.ext.youtube.embedded.YouTubeLinkExtension.

This extension has no configurable options.

Java configuration

Most extension properties are set with atomic values (strings, integers) or simple data structures composed of those values, such as maps and lists. A few extensions have properties that must be configured with instances of more complex Java classes that can’t coneveniently be mapped from the step parameters.

In those cases, you can provide a Java class to configure the extension. The configurers are identified in the parameters option with the key cx:configurers. The value of that parameter must be a map. Within that map, the key is any arbitrary string, the value must be the fully qualified name of the class to instantiate.

The class must implement the com.xmlcalabash.util.MarkdownConfigurer interface and must have a zero argument constructor. If XML Calabash can successfully instantiate the class with reflection, it will call the configure method, passing the key value from the parameters map as the second argument.