/usr/share/perl5/Pod/ProjectDocs/Parser.pm is in libpod-projectdocs-perl 0.50-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | package Pod::ProjectDocs::Parser;
use strict;
use warnings;
our $VERSION = '0.50'; # VERSION
use Moose;
with 'Pod::ProjectDocs::Template';
use Pod::ProjectDocs::Parser::XHTML;
has 'local_modules' => (
is => 'rw',
isa => 'HashRef',
);
sub gen_html {
my ( $self, %args ) = @_;
my $doc = $args{doc};
my $components = $args{components};
my $mgr_desc = $args{desc};
my $parser = Pod::ProjectDocs::Parser::XHTML->new();
# Use HTML5 with UTF8.
$parser->html_doctype('<!DOCTYPE html>');
$parser->html_charset('UTF-8');
$parser->html_encode_chars(q{&<>'"});
# Add our custom CSS file.
$parser->html_css( $components->{css}->relative_url($doc) );
# Generator options.
$parser->index(1);
$parser->title( $doc->name() . ' — ' . $doc->config()->title() );
$parser->anchor_items(1);
$parser->no_errata_section(1);
# Custom options.
$parser->doc($doc);
$parser->local_modules( $self->local_modules() );
$parser->current_files_output_path( $doc->get_output_path );
# Close <div class="pod"> (injected below) and add "generated by" content.
$parser->html_footer(
'</div><div class="footer">generated by <a href="http://metacpan.org/module/Pod::ProjectDocs">Pod::ProjectDocs</a></div></body></html>'
);
# Start parsing/generation.
my $output;
$parser->output_string( \$output );
$parser->parse_file( $doc->origin );
# Add body header section and open <div class="pod">.
my $header_box = $self->_generate_header_box( $doc, $mgr_desc );
$output =~ s/(<body[^>]*>)/$1$header_box\n<div class="pod">/;
# Add HTML language information.
my $language = $doc->config()->lang();
$output =~ s/<html>/<html lang="$language" xml:lang="$language">/;
return $output;
}
sub _generate_header_box {
my ( $self, $doc, $mgr_desc ) = @_;
my $text = $self->process(
$doc,
$doc->data,
{
title => $doc->config->title,
desc => $doc->config->desc,
name => $doc->name,
outroot => $doc->config->outroot,
src => $doc->get_output_src_path,
mgr_desc => $mgr_desc,
nosourcecode => $doc->config->nosourcecode,
}
);
return $text if $^O ne 'MSWin32';
while ( $text =~ s|href="(.*?)\\(.*?)"|href="$1/$2"| ) {
next;
}
return $text;
}
1;
|