line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
DR::SunDown - perl bindings for sundown |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use DR::SunDown; |
8
|
|
|
|
|
|
|
my $markdown = `cat README.markdown`; |
9
|
|
|
|
|
|
|
my $html = markdown2html $markdown; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head2 utf8 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
The converter returns utf8-strings if it receives utf8-strings. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Encode 'encode', 'decode'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# $string is encoded utf8 |
18
|
|
|
|
|
|
|
my $string = markdown2html encode utf8 => $data; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# $string and $data have the same utf8 flag |
21
|
|
|
|
|
|
|
my $string = markdown2html $data; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
utf8::decode( $data ) if utf8::is_utf8( $data ); |
24
|
|
|
|
|
|
|
# $string is decoded utf8 |
25
|
|
|
|
|
|
|
my $string = markdown2html $data; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
The library is a perl binding for C-library |
31
|
|
|
|
|
|
|
L. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 EXPORTS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 markdown2html(TEXT) |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Converts markdown text to html. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 AUTHOR |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Dmitry E. Oboukhov |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 LICENSE |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
47
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.8 or, |
48
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
package DR::SunDown; |
53
|
1
|
|
|
1
|
|
45064
|
use Carp (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
54
|
1
|
|
|
1
|
|
6
|
use base qw(Exporter); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
166
|
|
55
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
56
|
|
|
|
|
|
|
our @EXPORT = qw(markdown2html); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
require XSLoader; |
59
|
|
|
|
|
|
|
XSLoader::load('DR::SunDown', $VERSION); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|