line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Markdown::Hoedown; |
2
|
4
|
|
|
4
|
|
207869
|
use 5.008005; |
|
4
|
|
|
|
|
41
|
|
3
|
4
|
|
|
4
|
|
20
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
79
|
|
4
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
115
|
|
5
|
4
|
|
|
4
|
|
1827
|
use parent qw(Exporter); |
|
4
|
|
|
|
|
1197
|
|
|
4
|
|
|
|
|
22
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = "1.03"; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @EXPORT = qw( |
10
|
|
|
|
|
|
|
markdown |
11
|
|
|
|
|
|
|
markdown_toc |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
315
|
use XSLoader; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
814
|
|
15
|
|
|
|
|
|
|
XSLoader::load(__PACKAGE__, $VERSION); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub markdown { |
18
|
5
|
|
|
5
|
1
|
1824
|
my $str = shift; |
19
|
5
|
|
|
|
|
25
|
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
|
|
|
|
|
27
|
); |
31
|
|
|
|
|
|
|
my $md = Text::Markdown::Hoedown::Markdown->new( |
32
|
|
|
|
|
|
|
$args{extensions}, |
33
|
|
|
|
|
|
|
$args{max_nesting}, |
34
|
5
|
|
|
|
|
39
|
$renderer |
35
|
|
|
|
|
|
|
); |
36
|
5
|
|
|
|
|
112
|
return $md->render($str); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub markdown_toc { |
40
|
1
|
|
|
1
|
1
|
80
|
my $str = shift; |
41
|
1
|
|
|
|
|
6
|
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
|
|
|
|
|
26
|
); |
51
|
|
|
|
|
|
|
my $md = Text::Markdown::Hoedown::Markdown->new( |
52
|
|
|
|
|
|
|
$args{extensions}, |
53
|
|
|
|
|
|
|
$args{max_nesting}, |
54
|
1
|
|
|
|
|
24
|
$renderer, |
55
|
|
|
|
|
|
|
); |
56
|
1
|
|
|
|
|
58
|
return $md->render($str); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
__END__ |