markdown - Man Page
Converts Markdown text to HTML
package require Tcl 8.5
package require Markdown 1.2.2
package require textutil ?0.8?
::Markdown::register langspec converter
The package Markdown provides a command to convert Markdown annotated text into HMTL.
- ::Markdown::convert markdown
This command takes in a block of Markdown text, and returns a block of HTML.
- ::Markdown::register langspec converter
Register a language specific converter for prettifying a code block (e.g. syntax highlighting). Markdown supports fenced code blocks with an optional language specifier (e.g. "tcl"). When the markdown parser processes such a code block and a converter for the specified langspec is registered, the converter is called with the raw code block as argument. The converter is supposed to return the markup of the code block as result. The specified converter can be an arbitrary Tcl command, the raw text block is added as last argument upon invocation.
Reset the language counters.
Supported Markdown Syntax
This markdown converter supports the original markdown by Gruber and Swartz (see their syntax [https://daringfireball.net/projects/markdown/syntax] page for details):
- atx- and setext-style headers
- emphasis and strong emphasis
- unordered and ordered lists
- inline-style, reference-style and automatic links
- inline- and reference-style images
- inline code
- code blocks (with four indent spaces or one tab)
- inline HTML
- backslash escapes
- horizontal rules
In addition, the following extended markdown sytax is supported, taken from PHP Markdown Extra and GFM (Github Flavoured Markdown):
- pipe tables
- fenced code blocks (with an optional language specifier)
Bugs, Ideas, Feedback
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category textutil of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please also report any ideas for enhancements you may have for either package and/or documentation.
When proposing code changes, please provide unified diffs, i.e the output of diff -u.
Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.