NAME

Markdown::Render - Render markdown as HTML

SYNOPSIS

use Markdown::Render;

my $md = Markdown::Render->new( infile => 'README.md');

$md->render_markdown->print_html;

...or from the command line to create HTML

md-utils.pl -r README.md > README.html

...or from the command line to replace render custom tags

md-utils.pl README.md.in > README.md

DESCRIPTION

Renders markdown as HTML using either GitHub's API or Text::Markdown::Discount. Optionally adds additional metadata to markdown document using custom tags.

See README.md for more details.

Note: This module originally used Text::Markdown as an alternative to using the GitHub API however, there are too many bugs and idiosyncracies in that module. This module will now use Text::Markdown::Discount which is not only faster, but seems to be more compliant with GFM.

Note: Text::Markdown::Discount relies on the text-markdown library which did not actually support all of the markdown features (including code fencing). You can find an updated version of Text::Markdown::Discount here: https://github.com/rlauer6/text-markdown-discount

METHODS AND SUBROUTINES

new

new( options )

Any of the options passed to the new method can also be set or retrieved use the set_NAME or get_NAME methods.

finalize_markdown

Updates the markdown by interpolating the custom keywords. Invoking this method will create a table of contents and replace keywords with their values.

Invoke this method prior to invoking render_markdown.

Returns the Markdown::Render object.

render_markdown

Passes the markdown to GitHub's markdown rendering engine. After invoking this method you can retrieve the processed html by invoking get_html or create a fully rendered HTML page using the print_html method.

Returns the Markdown::Render object.

print_html

print_html(options)

Outputs the fully rendered HTML page.

AUTHOR

Rob Lauer - rlauer6@comcast.net

LICENSE

This software is licensed under the same terms as Perl.

SEE OTHER

GitHub Markdown API Text::Markdown::Discount