Name
cx:pegdown — Convert Markdown text to XHTML.
Synopsis
<p:declare-step
type
="
cx:pegdown
"
xmlns:cx
="
http://xmlcalabash.com/ns/extensions
"
>
<p:input
port
="
source
"
/>
<p:output
port
="
result
"
/>
<p:option
name
="
max-parsing-time
"
/>
<!--
integer -->
<p:option
name
="
smarts
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
quotes
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
abbreviations
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
hardwraps
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
autolinks
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
tables
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
definitions
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
fenced-code-blocks
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
wikilinks
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
strikethrough
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
anchorlinks
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
suppress-html-blocks
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
suppress-inline-html
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
suppress-all-html
"
select
="
'false'
"
/>
<!--
boolean -->
<p:option
name
="
plugins
"
/>
<!--
string -->
<p:option
name
="
link-renderer
"
/>
<!--
string -->
<p:option
name
="
verbatim-serializer
"
/>
<!--
string -->
<p:option
name
="
to-html-serializer-plugins
"
/>
<!--
string -->
</p:declare-step>
Description
This step converts Markdown documents into XHTML.
The cx:pegdown
step defines a number
of options. The list is intended to be comprehensive with respect to the
attributes and options that can be passed to the
PegDown formatter. The names reflect the
names used by the project, as far as I can tell. They are:
max-parsing-time, smarts, quotes, abbreviations, hardwraps, autolinks, tables, definitions, fenced-code-blocks, wikilinks, strikethrough, anchorlinks, suppress-html-blocks, suppress-inline-html, suppress-all-html, plugins, link-renderer, verbatim-serializer, to-html-serializer-plugins
The max-parsing-time
is a number of milliseconds.
Most of the rest of the options are booleans, defaulting to false.
The last few options identify extension classes:
plugins
-
The fully qualified classname for a plugin class.
link-renderer
-
The fully qualified classname for a link rendering class.
verbatim-serializer
-
A sequence of name/classname pairs for verbatim serialization.
to-html-serializer-plugins
-
A list of fully qualifieid classnames for HTML serialization.
For example, consider this Markdown file:
Running this through cx:pegdown
produces:
Usage
To use this step, you must include its declaration in your pipeline. You can copy the declaration above or import a library that defines this step, such as
Implementation
This step is implemented by the xmlcalabash1-pegdown module. The jar file from that project must be in the class path in order to use this step.