line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Markdown::Hoedown; |
2
|
4
|
|
|
4
|
|
136499
|
use 5.008005; |
|
4
|
|
|
|
|
12
|
|
3
|
4
|
|
|
4
|
|
23
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
81
|
|
4
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
107
|
|
5
|
4
|
|
|
4
|
|
906
|
use parent qw(Exporter); |
|
4
|
|
|
|
|
872
|
|
|
4
|
|
|
|
|
16
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = "1.02"; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @EXPORT = qw( |
10
|
|
|
|
|
|
|
markdown |
11
|
|
|
|
|
|
|
markdown_toc |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
249
|
use XSLoader; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
643
|
|
15
|
|
|
|
|
|
|
XSLoader::load(__PACKAGE__, $VERSION); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub markdown { |
18
|
5
|
|
|
5
|
1
|
1450
|
my $str = shift; |
19
|
5
|
|
|
|
|
18
|
my %args = ( |
20
|
|
|
|
|
|
|
html_options => 0, |
21
|
|
|
|
|
|
|
extensions => 0, |
22
|
|
|
|
|
|
|
max_nesting => 16, |
23
|
|
|
|
|
|
|
toc_nesting_lvl => 99, |
24
|
|
|
|
|
|
|
@_, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $renderer = Text::Markdown::Hoedown::Renderer::HTML->new( |
28
|
|
|
|
|
|
|
$args{html_options}, |
29
|
|
|
|
|
|
|
$args{toc_nesting_lvl}, |
30
|
5
|
|
|
|
|
23
|
); |
31
|
|
|
|
|
|
|
my $md = Text::Markdown::Hoedown::Markdown->new( |
32
|
|
|
|
|
|
|
$args{extensions}, |
33
|
|
|
|
|
|
|
$args{max_nesting}, |
34
|
5
|
|
|
|
|
24
|
$renderer |
35
|
|
|
|
|
|
|
); |
36
|
5
|
|
|
|
|
73
|
return $md->render($str); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub markdown_toc { |
40
|
1
|
|
|
1
|
1
|
64
|
my $str = shift; |
41
|
1
|
|
|
|
|
4
|
my %args = ( |
42
|
|
|
|
|
|
|
nesting_level => 6, |
43
|
|
|
|
|
|
|
extensions => 0, |
44
|
|
|
|
|
|
|
max_nesting => 16, |
45
|
|
|
|
|
|
|
@_, |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $renderer = Text::Markdown::Hoedown::Renderer::HTMLTOC->new( |
49
|
|
|
|
|
|
|
$args{nesting_level}, |
50
|
1
|
|
|
|
|
15
|
); |
51
|
|
|
|
|
|
|
my $md = Text::Markdown::Hoedown::Markdown->new( |
52
|
|
|
|
|
|
|
$args{extensions}, |
53
|
|
|
|
|
|
|
$args{max_nesting}, |
54
|
1
|
|
|
|
|
9
|
$renderer, |
55
|
|
|
|
|
|
|
); |
56
|
1
|
|
|
|
|
35
|
return $md->render($str); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
__END__ |