Posted to tcl by apn at Wed Nov 29 15:21:26 GMT 2017view raw
- .SH
- NAME
- .PP
- \f[B]cmark\f[] \[en] Tcl interface to CommonMark / Github Flavored Markdown
- .SS
- SYNOPSIS
- .IP
- .nf
- \f[C]
- package require cmark
- cmark::render ?options? TEXT
- \f[]
- .fi
- .SS
- DESCRIPTION
- .PP
- The \f[C]cmark\f[] package provides a Tcl script level interface to the
- cmark\-gfm (https://github.com/github/cmark) library for parsing
- and rendering CommonMark (http://commonmark.org/) formatted text
- which is a formalized specification of the commonly used Markdown syntax.
- The library includes support for Github extensions which add several
- features to the original specification. The extended syntax
- accepted by the library is described in the
- Github Flavored Markdown (https://github.github.com/gfm/)
- specification. Here we refer to all these syntax variants collectively
- as CommonMark.
- .PP
- The primary command exported from the package is the \f[C]render\f[] command.
- .RS
- .RE
- .IP
- .nf
- \f[C]
- cmark::render ?options? TEXT
- \f[]
- .fi
- .PP
- The command parses \f[C]TEXT\f[] which should be in CommonMark format and
- returns it rendered in one of several different output formats. Currently
- supported output formats are HTML, Latex, Groff manpage, CommonMark
- XML, CommonMark and plain text.
- .SS
- Parsing
- .PP
- The following options affect parsing of \f[C]TEXT\f[].
- .PP
- \f[C]\-footnotes\f[]
- .RS
- .PP
- Enable parsing of footnotes.
- .RE
- .PP
- \f[C]\-ghprelang\f[]
- .RS
- .PP
- Uses Github style tags for code blocks that have a language
- attribute. This uses the \f[C]lang\f[] attribute on the \f[C]<pre>\f[] tag instead
- of a class on the \f[C]<code>\f[] tag that wrap the block.
- .RE
- .PP
- \f[C]\-liberaltag\f[]
- .RS
- .PP
- Be liberal in interpretation of HTML tags.
- .RE
- .PP
- \f[C]\-smart\f[]
- .RS
- .PP
- Replaces straight quotes with curly quotes and double or triple
- hyphens with en dash and em dash respectively.
- .RE
- .PP
- \f[C]\-utf8validate\f[]
- .RS
- .PP
- Checks and replaces invalid UTF\-8 character in \f[C]TEXT\f[] with the U+FFFD
- replacement character.
- .RE
- .SS
- Rendering
- .PP
- The following options control the rendering of the input text.
- .PP
- \f[C]\-hardbreaks\f[]
- .RS
- .PP
- Renders soft line breaks as hard line breaks.
- .RE
- .PP
- \f[C]\-nobreaks\f[]
- .RS
- .PP
- Renders soft line breaks as spaces.
- .RE
- .PP
- \f[C]\-safe\f[]
- .RS
- .PP
- Removes raw HTML by placeholder comments and unsafe links such as
- \f[C]javascript :\f[], \f[C]vbscript:\f[] etc. by empty strings.
- .RE
- .PP
- \f[C]\-sourcepos\f[]
- .RS
- .PP
- Includes the \f[C]data\-sourcepos\f[] attribute on all block elements.
- .RE
- .PP
- \f[C]\-to\f[] \f[C]FORMAT\f[]
- .RS
- .PP
- Specifies the output format. \f[C]FORMAT\f[] must be one of \f[C]html\f[], \f[C]latex\f[],
- \f[C]man\f[] , \f[C]xml\f[], \f[C]commonmark\f[] or \f[C]text\f[].
- .RE
- .PP
- \f[C]\-width\f[]
- .RS
- .PP
- Specifies a max line width for wrapping. The default of \f[C]0\f[] implies
- no wrapping. Only applies to CommonMark, Latex and man output
- formats.
- .RE
- .PP
- Note that the HTML output format is a fragment and does not include any HTML
- header boilerplate.
- .SS
- Enabling GFM extensions
- .PP
- By default, the command adheres to the CommonMark (http://commonmark.org/)
- specification. Various extensions specified in
- Github Flavored Markdown (https://github.github.com/gfm/) (GFM)
- may be enabled through the options below.
- .PP
- \f[C]\-gfm\f[]
- .RS
- .PP
- Enables all GFM extensions. Equivalent to specifying all options below.
- .RE
- .PP
- \f[C]\-autolink\f[]
- .RS
- .PP
- Enables autolink (https://github.github.com/gfm/#autolinks\-extension\-) enhancements.
- .RE
- .PP
- \f[C]\-strikethrough\f[]
- .RS
- .PP
- Enables the strikethrough (https://github.github.com/gfm/#strikethrough\-extension\-)
- extension for wrapping strikethrough text in tilde \f[C]~\f[] characters.
- .RE
- .PP
- \f[C]\-table\f[]
- .RS
- .PP
- Enables the table (https://github.github.com/gfm/#tables\-extension\-)
- for formatting tables.
- .RE
- .PP
- \f[C]\-tagfilter\f[]
- .RS
- .PP
- Enables the tagfilter (https://github.github.com/gfm/#disallowed\-raw\-html\-extension\-)
- extension that disallows certain HTML tags.
- .RE
- .SS
- AUTHOR
- .PP
- Ashok P. Nadkarni