| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
466
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
35
|
|
|
2
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
44
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package App::Embra::Plugin::TransformMarkdown; |
|
5
|
|
|
|
|
|
|
$App::Embra::Plugin::TransformMarkdown::VERSION = '0.001'; # TRIAL |
|
6
|
|
|
|
|
|
|
# ABSTRACT: turn markdown files into html |
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
3
|
use File::Basename; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
64
|
|
|
9
|
1
|
|
|
1
|
|
3
|
use Method::Signatures; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
7
|
|
|
10
|
1
|
|
|
1
|
|
321
|
use Moo; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
5
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has 'extension' => ( |
|
15
|
|
|
|
|
|
|
is => 'ro', |
|
16
|
|
|
|
|
|
|
default => sub { 'md' }, |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has 'converter' => ( |
|
21
|
|
|
|
|
|
|
is => 'ro', |
|
22
|
|
|
|
|
|
|
default => sub { |
|
23
|
|
|
|
|
|
|
require Text::Markdown; |
|
24
|
|
|
|
|
|
|
Text::Markdown->new; |
|
25
|
|
|
|
|
|
|
}, |
|
26
|
|
|
|
|
|
|
); |
|
27
|
|
|
|
|
|
|
|
|
28
|
1
|
50
|
|
1
|
|
958
|
method transform_files { |
|
|
1
|
|
|
1
|
|
12
|
|
|
|
1
|
|
|
|
|
3
|
|
|
29
|
1
|
|
|
|
|
2
|
for my $file ( @{ $self->embra->files } ) { |
|
|
1
|
|
|
|
|
8
|
|
|
30
|
2
|
100
|
|
|
|
25
|
next if $file->ext ne $self->extension; |
|
31
|
1
|
|
|
|
|
8
|
$file->content( $self->converter->markdown( $file->content ) ); |
|
32
|
1
|
|
|
|
|
2189
|
$file->notes->{transformed_by} = __PACKAGE__; |
|
33
|
1
|
|
|
|
|
17
|
$file->ext( 'html' ); |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
with 'App::Embra::Role::FileTransformer'; |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=pod |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=encoding UTF-8 |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 NAME |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
App::Embra::Plugin::TransformMarkdown - turn markdown files into html |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 VERSION |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
version 0.001 |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
This plugin will transform the content of Markdown files into HTML and change the file's extension to C<.html>. |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 extension |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Files ending with this extension will be treated as Markdown files. Defualts to C<.md>. |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 converter |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
The object to use to convert the file content from Markdown to HTML. Defaults to an instance of L<Text::Markdown>. |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 AUTHOR |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Daniel Holz <dgholz@gmail.com> |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Daniel Holz. |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
78
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |