| Markdown::Render(3pm) | User Contributed Perl Documentation | Markdown::Render(3pm) |
Markdown::Render - Render markdown as HTML
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 -r README.md > README.html
...or from the command line to replace render custom tags
md-utils README.md.in > README.md
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 <https://github.com/rlauer6/markdown-utils/blob/master/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>
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.
default: text_markdown
default: markdown
default: false
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.
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(options)
Outputs the fully rendered HTML page.
Rob Lauer - rlauer6@comcast.net
GitHub Markdown API <https://docs.github.com/en/rest/markdown> Text::Markdown::Discount
| 2025-03-14 | perl v5.40.1 |