File Coverage

lib/Pod/PseudoPod/DOM/App/ToPML.pm
Criterion Covered Total %
statement 18 31 58.0
branch 0 2 0.0
condition n/a
subroutine 6 7 85.7
pod 0 1 0.0
total 24 41 58.5


line stmt bran cond sub pod time code
1             package Pod::PseudoPod::DOM::App::ToPML;
2             # ABSTRACT: helper functions for bin/ppdom2html
3              
4 1     1   734 use strict;
  1         2  
  1         25  
5 1     1   5 use warnings;
  1         2  
  1         20  
6 1     1   5 use autodie;
  1         2  
  1         4  
7              
8 1     1   4374 use Pod::PseudoPod::DOM;
  1         2  
  1         31  
9 1     1   5 use Pod::PseudoPod::DOM::Corpus;
  1         2  
  1         32  
10              
11 1     1   6 use Pod::PseudoPod::DOM::App qw( open_fh );
  1         1  
  1         230  
12              
13             sub process_files_with_output
14             {
15 0     0 0   my @docs;
16             my %anchors;
17 0           my $corpus = Pod::PseudoPod::DOM::Corpus->new;
18              
19 0           for my $file (@_)
20             {
21 0           my ($source, $output) = @$file;
22              
23 0           my $parser = Pod::PseudoPod::DOM->new(
24             formatter_role => 'Pod::PseudoPod::DOM::Role::PML',
25             formatter_args => { add_body_tags => 1, anchors => \%anchors },
26             filename => $output,
27             );
28              
29 0           my $PMLOUT = open_fh( $output, '>' );
30 0           $parser->output_fh($PMLOUT);
31              
32 0 0         die "Unable to open file ($source)\n" unless -e $source;
33 0           $parser->parse_file( open_fh( $source ) );
34              
35 0           $corpus->add_document( $parser->get_document, $parser );
36             }
37              
38 0           $corpus->write_documents;
39 0           $corpus->write_index;
40 0           $corpus->write_toc;
41             }
42              
43             1;
44              
45             __END__
46              
47             =pod
48              
49             =encoding UTF-8
50              
51             =head1 NAME
52              
53             Pod::PseudoPod::DOM::App::ToPML - helper functions for bin/ppdom2html
54              
55             =head1 VERSION
56              
57             version 1.20210620.2040
58              
59             =head1 AUTHOR
60              
61             chromatic <chromatic@wgz.org>
62              
63             =head1 COPYRIGHT AND LICENSE
64              
65             This software is copyright (c) 2021 by chromatic.
66              
67             This is free software; you can redistribute it and/or modify it under
68             the same terms as the Perl 5 programming language system itself.
69              
70             =cut