tcsh.man2html (167466) | tcsh.man2html (231990) |
---|---|
1: # -*- perl -*- | 1: # -*- perl -*- |
2# $tcsh: tcsh.man2html,v 1.14 2006/03/02 18:46:45 christos Exp $ | 2# $tcsh: tcsh.man2html,v 1.15 2011/02/05 16:15:56 christos Exp $ |
3 4# tcsh.man2html, Dave Schweisguth <dcs@proton.chem.yale.edu> 5# 6# Notes: 7# 8# Always puts all files in the directory tcsh.html, creating it if necessary. 9# tcsh.html/top.html is the entry point, and tcsh.html/index.html is a symlink 10# to tcsh.html/top.html so one needn't specify a file at all if working through --- 673 unchanged lines hidden (view full) --- 684 } else { 685 push(@end, $#para); # End at the end 686 } 687 688 # Fontify each part 689 690 $bold = $italic = 0; 691 foreach $i (0 .. $#begin) { | 3 4# tcsh.man2html, Dave Schweisguth <dcs@proton.chem.yale.edu> 5# 6# Notes: 7# 8# Always puts all files in the directory tcsh.html, creating it if necessary. 9# tcsh.html/top.html is the entry point, and tcsh.html/index.html is a symlink 10# to tcsh.html/top.html so one needn't specify a file at all if working through --- 673 unchanged lines hidden (view full) --- 684 } else { 685 push(@end, $#para); # End at the end 686 } 687 688 # Fontify each part 689 690 $bold = $italic = 0; 691 foreach $i (0 .. $#begin) { |
692 $* = 1; | |
693 $part = join('', @para[$begin[$i] .. $end[$i]]); | 692 $part = join('', @para[$begin[$i] .. $end[$i]]); |
694 $part =~ s/^\.([BI])\s+(.*)$/\\f$1$2\\fR/g; # .B, .I 695 @pieces = split(/(\\f[BIR])/, $part); | 693 $part =~ s/^\.([BI])\s+(.*)$/\\f$1$2\\fR/gm; # .B, .I 694 @pieces = split(/(\\f[BIR])/m, $part); |
696 $part = ''; 697 foreach $j (@pieces) { 698 if ($j eq '\fB') { 699 if ($italic) { 700 $italic = 0; 701 $part .= '</I>'; 702 } 703 unless ($bold) { --- 16 unchanged lines hidden (view full) --- 720 } elsif ($italic) { 721 $italic = 0; 722 $part .= '</I>'; 723 } 724 } else { 725 $part .= $j; 726 } 727 } | 695 $part = ''; 696 foreach $j (@pieces) { 697 if ($j eq '\fB') { 698 if ($italic) { 699 $italic = 0; 700 $part .= '</I>'; 701 } 702 unless ($bold) { --- 16 unchanged lines hidden (view full) --- 719 } elsif ($italic) { 720 $italic = 0; 721 $part .= '</I>'; 722 } 723 } else { 724 $part .= $j; 725 } 726 } |
728 $* = 0; | |
729 730 # Close bold/italic before break 731 732 if ($end[$i] == $#para || $para[$end[$i] + 1] =~ /^<BR>/) { 733 # Perl 5 lossage alert 734 if ($bold) { 735 $bold = 0; 736 $part =~ s/(\n)?$/<\/B>$1\n/; --- 116 unchanged lines hidden --- | 727 728 # Close bold/italic before break 729 730 if ($end[$i] == $#para || $para[$end[$i] + 1] =~ /^<BR>/) { 731 # Perl 5 lossage alert 732 if ($bold) { 733 $bold = 0; 734 $part =~ s/(\n)?$/<\/B>$1\n/; --- 116 unchanged lines hidden --- |