Skip to content

Latest commit

 

History

History
166 lines (87 loc) · 3.13 KB

README.md

File metadata and controls

166 lines (87 loc) · 3.13 KB

Build Status

NAME

Text::Markdown::Hoedown - hoedown for Perl5

SYNOPSIS

use Text::Markdown::Hoedown;

print markdown(<<'...');
# foo

bar

  * hoge
  * fuga
...

DESCRIPTION

Text::Markdown::Hoedown is binding library for hoedown.

hoedown is a forking project from sundown.

FUNCTIONS

  • my $out = markdown($src :Str, %options) :Str

    Rendering markdown.

    Options are following:

    • toc_nesting_lvl

      Nesting levels for TOC generation.

      (Default: 99)

    • extensions

      This is bit flag. You can use the flags by '|' operator. Values are following:

      • HOEDOWN_EXT_TABLES

        Parse PHP-Markdown style tables.

      • HOEDOWN_EXT_FENCED_CODE

        Parse fenced code blocks.

      • HOEDOWN_EXT_FOOTNOTES

        Parse footnotes.

      • HOEDOWN_EXT_AUTOLINK

        Automatically turn safe URLs into links.

      • HOEDOWN_EXT_STRIKETHROUGH

        Parse stikethrough spans.

      • HOEDOWN_EXT_UNDERLINE

        Parse _underline_ instead of emphasis.

      • HOEDOWN_EXT_HIGHLIGHT

        Parse ==highlight== spans.

      • HOEDOWN_EXT_QUOTE

        Render "quotes" as <q>quotes</q>.

      • HOEDOWN_EXT_SUPERSCRIPT

        Parse super^script.

      • HOEDOWN_EXT_MATH

        Parse TeX $$math$$ syntax, Kramdown style.

      • HOEDOWN_EXT_NO_INTRA_EMPHASIS

        Disable emphasis_between_words.

      • HOEDOWN_EXT_SPACE_HEADERS

        Require a space after '#' in headers.

      • HOEDOWN_EXT_MATH_EXPLICIT

        Instead of guessing by context, parse $inline math$ and $$always block math$$ (requires HOEDOWN_EXT_MATH).

      • HOEDOWN_EXT_DISABLE_INDENTED_CODE

        Don't parse indented code blocks.

    • html_options

      This is bit flag. You can use the flags by '|' operator. Values are following:

      • HOEDOWN_HTML_SKIP_HTML

        Strip all HTML tags.

      • HOEDOWN_HTML_ESCAPE

        Escape all HTML.

      • HOEDOWN_HTML_HARD_WRAP

        Render each linebreak as <br>.

      • HOEDOWN_HTML_USE_XHTML

        Render XHTML.

    • max_nesting

      I don't know what this do.

  • markdown_toc($src:Str, %opts) :Str

    Generate TOC HTML from $str.

    Options are following:

    • nesting_level

      Maximum nesting level for TOC.

    • extensions

      Same as above.

    • max_nesting

      Same as above.

    All HOEDOWN_* constants are exported by default.

TODO

  • Document about low level APIs

HACKING

hoedown/ directory is managed by git subtree.

You can pull the modifications from upstream by following command:

 git subtree pull --prefix=hoedown git@github.com:hoedown/hoedown.git master

LICENSE

Copyright (C) tokuhirom.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

tokuhirom tokuhirom@gmail.com