X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fpod2html.PL;h=602a866e428bd690f8d25d99d73251b1903bde56;hb=4fc194b2052979cb8d28873cf62c0ce84cd214f5;hp=ced84783e5fb407d5c1f5ccaa4eb786e39811d38;hpb=347a6e9122479579acd85b56a9ef411f7145d7f5;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/pod2html.PL b/pod/pod2html.PL index ced8478..602a866 100644 --- a/pod/pod2html.PL +++ b/pod/pod2html.PL @@ -12,10 +12,9 @@ use File::Basename qw(&basename &dirname); # This forces PL files to create target in same directory as PL file. # This is so that make depend always knows where to find PL derivatives. -chdir(dirname($0)); -($file = basename($0)) =~ s/\.PL$//; -$file =~ s/\.pl$// - if ($^O eq 'VMS' or $^O eq 'os2'); # "case-forgiving" +chdir dirname($0); +$file = basename($0, '.PL'); +$file .= '.com' if $^O eq 'VMS'; open OUT,">$file" or die "Can't create $file: $!"; @@ -25,14 +24,15 @@ print "Extracting $file (with variable substitutions)\n"; # You can use $Config{...} to use Configure variables. print OUT <<"!GROK!THIS!"; -$Config{'startperl'} +$Config{startperl} + eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}' + if \$running_under_some_shell; !GROK!THIS! # In the following, perl variables are not expanded during extraction. print OUT <<'!NO!SUBS!'; -eval 'exec perl -S $0 ${1+"$@"}' - if $running_under_some_shell; + # # pod2html - convert pod format to html # Version 1.15 @@ -118,8 +118,9 @@ for $count (0,1) { open(HTML,">$html") || die "can't create $html: $ERRNO"; print HTML '',"\n",'',"\n"; print HTML "
" unless $NO_NS; - print HTML "$pod\n\n"; + print HTML "$pod"; print HTML "
" unless $NO_NS; + print HTML "\n\n"; } for ($i = 0; $i <= $#all; $i++) { # decide what to do with each chunk $all[$i] =~ /^(\w+)\s*(.*)\n?([^\0]*)$/ ; @@ -322,6 +323,7 @@ sub scan_thing{ # scan a chunk for later references my($cmd,$title,$pod) = @_; $_ = $title; s/\n$//; + s/E<(\d+)>/&#$1;/g; s/E<(.*?)>/&$1;/g; # remove any formatting information for the headers s/[SFCBI]<(.*?)>/$1/g; @@ -378,7 +380,7 @@ sub picrefs { } } if (length($key)) { - ($pod2,$num) = split(/_/,$value,2); + ($pod2, $num) = $value =~ /^(.*)_(\S+_\d+)$/; if ($htype eq "NAME") { return "\n\n$bigkey\n" } @@ -501,11 +503,12 @@ sub gensym { sub pre_escapes { # twiddle these, and stay up late :-) my($thing) = @_; for ($$thing) { - s/([\200-\377])/noremap("&".ord($1).";")/ge; + s/([\200-\377])/noremap("&#".ord($1).";")/ge; s/"(.*?)"/``$1''/gs; s/&/noremap("&")/ge; s/</\&#$1\;/g; # embedded numeric special s/E<([^\/][^<>]*)>/\&$1\;/g; # embedded special } }