Converts a Markdown document into HTML.
<p:declare-step type="p:markdown-to-html"> <input port="source" primary="true" content-types="text" sequence="false"/> <output port="result" primary="true" content-types="html" sequence="false"/> <option name="parameters" as="map(xs:QName,item()*)?" required="false" select="()"/> </p:declare-step>
The p:markdown-to-html
step converts a Markdown document appearing on its
source
port into HTML. The result appears on the result
port.
Ports:
Port | Type | Primary? | Content types | Seq? | Description |
---|---|---|---|---|---|
|
|
|
|
| The Markdown document to transform. |
|
|
|
|
| The resulting HTML document. |
Options:
The p:markdown-to-html
step converts a Markdown document appearing on its
source
port into HTML. There are several flavors of Markdown, for instance CommonMark. Which Markdown flavors are supported by p:markdown-to-html
is implementation-defined and therefore dependent on the
XProc processor used. The resulting HTML appears on the result
port.
Assume we have a Markdown document that looks like this:
# Example Markdown document This is an example of a Markdown document to show what the conversion to HTML by `p:markdown-to-html` looks like.
We can convert this into HTL using p:markdown-to-html
:
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0"> <p:input port="source"/> <p:output port="result"/> <p:markdown-to-html/> </p:declare-step>
Result document:
<html xmlns="http://www.w3.org/1999/xhtml"> <head/> <body> <h1>Example Markdown document</h1> <p>This is an example of a Markdown document to show what the conversion to HTML by <code>p:markdown-to-html</code> looks like.</p> </body> </html>
The document appearing on the result
port only has a content-type
property. It has no other
document-properties (also no base-uri
).
This description of the p:markdown-to-html
step is for XProc version: 3.0. This is a required step (an XProc 3.0 processor must support this).
The formal specification for the p:markdown-to-html
step can be found here.
The p:markdown-to-html
step is part of categories:
The p:markdown-to-html
step is also present in version:
3.1.