line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::optex::textconv::pandoc; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
936
|
use v5.14; |
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
7
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
58
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
7
|
use App::optex::textconv::Converter 'import'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @CONVERTER = ( |
12
|
|
|
|
|
|
|
[ qr/\.doc[xm]$/ => \&to_text ], |
13
|
|
|
|
|
|
|
[ qr/\.ppt[xm]$/ => \&to_text ], |
14
|
|
|
|
|
|
|
[ qr/\.xls[xm]$/ => \&to_text ], |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub to_text { |
18
|
0
|
|
|
0
|
0
|
|
my $file = shift; |
19
|
0
|
|
|
|
|
|
my $format = q(pandoc -t plain "%s"); |
20
|
0
|
|
|
|
|
|
my $exec = sprintf $format, $file; |
21
|
0
|
|
|
|
|
|
qx($exec); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |