NAME
Text::Markdown::Discount - fast function for converting markdown to HTML (requires C compiler)
SYNOPSIS
use Text::Markdown::Discount;
my $html = markdown($text)
DESCRIPTION
Text::Markdown::Discount is a perl interface to the Discount
library, a C implementation of John Gruber's markdown
.
It is the fastest of the Perl modules available for converting markdown: see the list in "SEE ALSO". It passes Gruber's Markdown testsuite.
Given that the performance of Discount, Text::Markdown::Discount processes markdown formatted text quickly and passes the Markdown test suite at
The interface of the markdown()
function in this module is not compatible with the markdown()
function in Text::Markdown.
EXPORT
markdown is exported by default.
CONSTRUCTOR
OO interface is also available as follows.
my $md = Text::Markdown::Discount->new(%opt);
my $html = $md->markdown($text);
new
is constructor and %opt
is constructor option. keys of %opt
is as follows.
- html5
-
Enabling html5 elements handling.
CAUTION: Once generated html5 enabled object, following ALL
Text::Markdown::Discount::markdown()
calls are affected and html5 enabled in same Perl process and there is no way to disable it. It's not only limited the object which html5 flags on.
SEE ALSO
There are other modules on CPAN for converting Markdown:
Text::Markdown is a pure-perl markdown converter.
Markdent is a toolkit for parsing markdown, which can also be used to convert markdown to HTML.
Text::Markup is a converter than can handle a number of input formats, including markdown.
Text::MultiMarkdown converts MultiMarkdown (a superset of the original markdown format) to HTML.
Additional markdown resources:
Discount - David Loren Parsons's library for converting markdown, written in C.
Markdown definition - John Gruber's original definition of the markdown format.
Markdown testsuite - John Gruber's testsuite for markdown.
Markdown modules - a review of all Perl modules for handling markdown, written by Neil Bowers.
AUTHOR
Masayoshi Sekimura, <sekimura@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2009 by Masayoshi Sekimura
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
This product includes software developed by David Loren Parsons <http://www.pell.portland.or.us/~orc>