Pod-HtmlEasy

 view release on metacpan or  search on metacpan

lib/Pod/HtmlEasy/Parser.pm  view on Meta::CPAN

        }
    }

    # This situation is created by evt_on_head1()
    # _do_title has found nothing following =head1 NAME, so it
    # creates ...{TITLE}, and leaves it undef, so that it will be
    # picked up here when the paragraph following is processed.
    if (    ( exists $parser->{POD_HTMLEASY}{TITLE} )
        and ( not defined $parser->{POD_HTMLEASY}{TITLE} ) )
    {
        my @lines = split m{\n}smx, $text;
        my $tmp_text = shift @lines;
        if ( not defined $tmp_text ) { return $text; }
        $tmp_text =~ s{$RE{ws}{crop}}{}gsmx;   # delete surrounding whitespace
        $parser->{POD_HTMLEASY}{TITLE} = $tmp_text;
        $parser->{POD_HTMLEASY}{INFO_COUNT}++;
    }

    return $text;
}

scripts/pod2indexed_html.pl  view on Meta::CPAN

}

do_retrieve();

if ( exists $options{'dumpdb'} ) { dumpdb(); exit 0; }

if (@ARGV) { convert_local(); exit 0; }

# Put CSS_ADDON at the end of the css
# 'x' is inappropriate here
my @css = split m{$NL}sxm, Pod::HtmlEasy::Data::css;
push @css, splice @css, -1, 1, $CSS_ADDON; ## no critic (ProhibitMagicNumbers)
write_file( $CSS_FILE, join( qq{$NL}, @css ) . $NL );

if ( not -d $targetdir ) {
    mkdir $targetdir
        or error_print(qq{Unable to create $targetdir})
        or carp q{print fail};
}
if ( not -w $targetdir ) {
    error_print(qq{Unable to write $targetdir}) or carp q{print fail};

t/Run.pm  view on Meta::CPAN


        # Complete the command
        push @cmd, $cmd;
        my $harness = start \@cmd, \$in, \$out, \$err;
        foreach my $p (@pod) {
            $in .= $p;
            $harness->pump;
        }
        $harness->finish;
        ## no critic (RequireExtendedFormatting RequireLineBoundaryMatching)
        @html = map {qq{$_\n}} split m{\n}, $out;

        if ( $err ) {
            if ( $err !~ m{$error_tag} ) {
                carp $err;
            }
        }
    }
    elsif ( exists $opts->{outfile} ) {

        # Outfile is for this;



( run in 0.779 second using v1.01-cache-2.11-cpan-71847e10f99 )