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 port | Primary | Sequence | Content types |
---|---|---|---|
source | ✔ | text |
Output port | Primary | Sequence | Content types |
---|---|---|---|
result | ✔ | html |
Option name | Type | Default value |
---|---|---|
parameters | map(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
Code | Description |
---|
Implementation defined features
- The flavor(s) of Markdown supported and the parameters allowed are implementation-defined.
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 name | Flexmark-java extension |
---|---|
abbreviation | AbbreviationExtension |
admonition | AdmonitionExtension |
anchorlink | AnchorLinkExtension |
aside | AsideExtension |
attributes | AttributesExtension |
autolink | AutolinkExtension |
definition | DefinitionExtension |
emoji | EmojiExtension |
enumeratedreference | EnumeratedReferenceExtension |
escaped-character | EscapedCharacterExtension |
footnotes | FootnoteExtension |
gfm-issues | GfmIssuesExtension |
gfm-strikethrough | StrikethroughExtension |
gfm-strikethrough-subscript | SubscriptExtension |
gfm-strikethrough-strikethrough-subscript | StrikethroughSubscriptExtension |
gfm-tasklist | TaskListExtension |
gfm-users | GfmUsersExtension |
gitlab | GitLabExtension |
ins | InsExtension |
jekyll-front-matter | JekyllFrontMatterExtension |
macros | MacrosExtension |
media-tags | MediaTagsExtension |
resizable-image | ResizableImageExtension |
superscript | SuperscriptExtension |
tables | TablesExtension |
sim-toc | SimTocExtension |
toc | TocExtension |
typographic | TypographicExtension |
wikilink | WikiLinkExtension |
xwiki-macros | MacroExtension |
yaml-front-matter | YamlFrontMatterExtension |
youtube-embedded | YouTubeLinkExtension |
abbreviation extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.abbreviation.AbbreviationExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
abbreviations-keep | last | first | fail | locked |
use-links | xs:boolean |
abbreviations-placement | as-is | document-top | group-with-first | group-with-last | document-bottom |
abbreviations-sort | as-is | sort | sort-unused-last | sort-delete-unused | delete-unused |
make-merged-abbreviations-unique | xs:boolean |
admonition extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.admonition.AdmonitionExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
content-indent | xs:integer |
allow-leading-space | xs:boolean |
interrupts-paragraph | xs:boolean |
interrupts-item-paragraph | xs:boolean |
with-spaces-interrupts-item-paragraph | xs:boolean |
allow-lazy-continuation | xs:boolean |
unresolved-qualifier | xs:string |
qualifier-type-map | map(xs:string, xs:string) |
qualifier-title-map | map(xs:string, xs:string) |
type-svg-map | map(xs:string, xs:string) |
anchorlink extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.anchorlink.AnchorLinkExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
anchorlinks-wrap-text | xs:boolean |
anchorlinks-text-prefix | xs:string |
anchorlinks-text-suffix | xs:string |
anchorlinks-anchor-class | xs:string |
anchorlinks-set-name | xs:boolean |
anchorlinks-set-id | xs:boolean |
anchorlinks-no-block-quote | xs:boolean |
aside extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.aside.AsideExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
extend-to-blank-line | xs:boolean |
ignore-blank-line | xs:boolean |
allow-leading-space | xs:boolean |
interrupts-paragraph | xs:boolean |
interrupts-item-paragraph | xs:boolean |
with-lead-spaces-interrupts-item-paragraph | xs:boolean |
attributes extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.attributes.AttributesExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
attributes-keep | last | first | fail | locked |
assign-text-attributes | xs:boolean |
fenced-code-info-attributes | xs:boolean |
fenced-code-add-attributes | add-to-pre-code | add-to-pre | add-to-code |
wrap-non-attribute-text | xs:boolean |
use-empty-implicit-as-span-delimiter | xs:boolean |
format-attributes-combine-consecutive | xs:boolean |
format-attributes-sort | xs:boolean |
format-attributes-spaces | as-is | add | remove |
format-attribute-equal-space | as-is | add | remove |
format-attribute-value-quotes | as-is | no-quotes-single-preferred | no-quotes-double-preferred | single-preferred | double-preferred | single-quotes | double-quotes |
format-attribute-id | as-is | implicit-preferred | explicit-preferred |
format-attribute-class | as-is | implicit-preferred | explicit-preferred |
autolink extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.autolink.AutolinkExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
ignore-links | xs:string |
definition extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.definition.DefinitionExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
colon-marker | xs:boolean |
marker-spaces | xs:integer |
tilde-marker | xs:boolean |
double-blank-line-breaks-list | xs:boolean |
format-marker-spaces | xs:integer |
format-marker-type | any | colon | tilde |
emoji extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.emoji.EmojiExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
root-image-path | xs:string |
use-shortcut-type | github | emoji-cheat-sheet | any-github-preferred | any-emoji-cheat-sheet-preferred |
use-image-type | image-only | unicode-only | unicode-fallback-to-image |
use-unicode-file-names | xs:boolean |
attr-image-size | xs:string |
attr-image-class | xs:string |
attr-align | xs:string |
enumeratedreference extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.enumerated.reference.EnumeratedReferenceExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
enumerated-references-keep | last | first | fail | locked |
enumerated-reference-placement | as-is | document-top | group-with-first | group-with-last | document-bottom |
enumerated-reference-sort | as-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:
Property | Value |
---|---|
footnotes-keep | last | first | fail | locked |
footnote-ref-prefix | xs:string |
footnote-ref-suffix | xs:string |
footnote-back-ref-string | xs:string |
footnote-link-ref-class | xs:string |
footnote-back-link-ref-class | xs:string |
footnote-placement | as-is | document-top | group-with-first | group-with-last | document-bottom |
footnote-sort | as-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:
Property | Value |
---|---|
git-hub-issues-url-root | xs:string |
git-hub-issue-url-prefix | xs:string |
git-hub-issue-url-suffix | xs:string |
git-hub-issue-html-prefix | xs:string |
git-hub-issue-html-suffix | xs: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:
Property | Value |
---|---|
strikethrough-style-html-open | xs:string |
strikethrough-style-html-close | xs: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:
Property | Value |
---|---|
subscript-style-html-open | xs:string |
subscript-style-html-close | xs: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:
Property | Value |
---|---|
strikethrough-style-html-open | xs:string |
strikethrough-style-html-close | xs:string |
subscript-style-html-open | xs:string |
subscript-style-html-close | xs: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:
Property | Value |
---|---|
item-done-marker | xs:string |
item-not-done-marker | xs:string |
tight-item-class | xs:string |
loose-item-class | xs:string |
paragraph-class | xs:string |
item-done-class | xs:string |
item-not-done-class | xs:string |
format-list-item-case | as-is | lowercase | uppercase |
format-list-item-placement | as-is | incomplete-first | incomplete-nested-first | complete-to-non-task | complete-nested-to-non-task |
format-ordered-task-item-priority | xs:integer |
format-default-task-item-priority | xs:integer |
format-prioritized-task-items | xs:boolean |
format-task-item-priorities | map(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:
Property | Value |
---|---|
git-hub-users-url-root | xs:string |
git-hub-user-url-prefix | xs:string |
git-hub-user-url-suffix | xs:string |
git-hub-user-html-prefix | xs:string |
git-hub-user-html-suffix | xs:string |
gitlab extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.gitlab.GitLabExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
ins-parser | xs:boolean |
del-parser | xs:boolean |
block-quote-parser | xs:boolean |
nested-block-quotes | xs:boolean |
inline-math-parser | xs:boolean |
render-block-math | xs:boolean |
render-block-mermaid | xs:boolean |
render-video-images | xs:boolean |
render-video-link | xs:boolean |
math-languages | xs:string* |
mermaid-languages | xs:string* |
inline-math-class | xs:string |
block-math-class | xs:string |
block-mermaid-class | xs:string |
video-image-class | xs:string |
video-image-link-text-format | xs:string |
ins extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.ins.InsExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
ins-style-html-open | xs:string |
ins-style-html-close | xs: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:
Property | Value |
---|---|
macro-definitions-keep | last | first | fail | locked |
macro-definitions-placement | as-is | document-top | group-with-first | group-with-last | document-bottom |
macro-definitions-sort | as-is | sort | sort-unused-last | sort-delete-unused | delete-unused |
source-wrap-macro-references | xs: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:
Property | Value |
---|---|
superscript-style-html-open | xs:string |
superscript-style-html-close | xs:string |
tables extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.tables.TablesExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
trim-cell-whitespace | xs:boolean |
min-separator-dashes | xs:integer |
max-header-rows | xs:integer |
min-header-rows | xs:integer |
append-missing-columns | xs:boolean |
discard-extra-columns | xs:boolean |
column-spans | xs:boolean |
header-separator-column-match | xs:boolean |
class-name | xs:string |
with-caption | xs:boolean |
format-table-trim-cell-whitespace | xs:boolean |
format-table-lead-trail-pipes | xs:boolean |
format-table-space-around-pipes | xs:boolean |
format-table-adjust-column-width | xs:boolean |
format-table-apply-column-alignment | xs:boolean |
format-table-fill-missing-columns | xs:boolean |
format-table-fill-missing-min-column | xs:integer |
format-table-left-align-marker | as-is | add | remove |
format-table-min-separator-column-width | xs:integer |
format-table-min-separator-dashes | xs:integer |
format-table-caption | as-is | add | remove-empty | remove |
format-table-caption-spaces | as-is | add | remove |
format-table-indent-prefix | xs:string |
sim-toc extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.toc.SimTocExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
levels | xs:integer |
is-text-only | xs:boolean |
is-numbered | xs:boolean |
list-type | hierarchy | flat | flat-reversed | sorted | sorted-reversed |
is-html | xs:boolean |
title-level | xs:integer |
title | xs:string |
ast-include-options | xs:boolean |
blank-line-spacer | xs:boolean |
div-class | xs:string |
list-class | xs:string |
case-sensitive-toc-tag | xs:boolean |
format-update-on-format | as-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:
Property | Value |
---|---|
levels | xs:integer |
is-text-only | xs:boolean |
is-numbered | xs:boolean |
list-type | hierarchy | flat | flat-reversed | sorted | sorted-reversed |
is-html | xs:boolean |
title-level | xs:integer |
title | xs:string |
ast-include-options | xs:boolean |
blank-line-spacer | xs:boolean |
div-class | xs:string |
list-class | xs:string |
case-sensitive-toc-tag | xs:boolean |
format-update-on-format | as-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:
Property | Value |
---|---|
enable-quotes | xs:boolean |
enable-smarts | xs:boolean |
angle-quote-close | xs:string |
angle-quote-open | xs:string |
angle-quote-unmatched | xs:string |
double-quote-close | xs:string |
double-quote-open | xs:string |
double-quote-unmatched | xs:string |
ellipsis | xs:string |
ellipsis-spaced | xs:string |
em-dash | xs:string |
en-dash | xs:string |
single-quote-close | xs:string |
single-quote-open | xs:string |
single-quote-unmatched | xs:string |
wikilink extension
Consult documentation for the Flexmark-java
extension com.vladsch.flexmark.ext.wikilink.WikiLinkExtension
.
This extension has the following configurable options:
Property | Value |
---|---|
allow-inlines | xs:boolean |
allow-anchors | xs:boolean |
allow-anchor-escape | xs:boolean |
allow-pipe-escape | xs:boolean |
disable-rendering | xs:boolean |
link-first-syntax | xs:boolean |
link-prefix | xs:string |
link-prefix-absolute | xs:string |
image-prefix | xs:string |
image-prefix-absolute | xs:string |
image-links | xs:boolean |
link-file-extension | xs:string |
image-file-extension | xs:string |
link-escape-chars | xs:string |
link-replace-chars | xs: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:
Property | Value |
---|---|
enable-inline-macros | xs:boolean |
enable-block-macros | xs:boolean |
enable-rendering | xs: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.