~percona-toolkit-dev/percona-toolkit/release-2.2.3

« back to all changes in this revision

Viewing changes to util/pod2rst-fixed.packed

  • Committer: Brian Fraser
  • Date: 2013-03-20 16:14:37 UTC
  • Revision ID: brian.fraser@percona.com-20130320161437-uoyhih4dokn7tbf9
Fixes for the online docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
5683
5683
 
5684
5684
my $input_file = shift @ARGV or die "Need an input file";
5685
5685
 
 
5686
my $nofix = scalar @ARGV;
 
5687
 
5686
5688
my $tool = basename($input_file);
5687
5689
 
5688
5690
open my $in_fh, q{<:encoding(UTF-8)}, $input_file
5716
5718
my $fixed_output = '';
5717
5719
 
5718
5720
while (my $para = <$in>) {
 
5721
   if ( $nofix ) {
 
5722
      $fixed_output .= $para;
 
5723
      next;
 
5724
   }
 
5725
   
5719
5726
   next if $para =~ m/^\.\. highlight:: perl/;
5720
5727
 
5721
5728
   $in_code_block = $para =~ m/^\s{2,}/ ? 1 : 0;
5749
5756
      $para =~ s/^[ ]+$//mg;
5750
5757
      $para =~ s/^\n\n/\n/mg;
5751
5758
      $para =~ s/code-block:: bash(\s+)CREATE/code-block:: sql$1CREATE/sg;
 
5759
      $para =~ s/\*\*:program/** :program/g;
5752
5760
      if ( ($section || '') eq 'OUTPUT' ) {
5753
5761
         $para =~ s/^([A-Z_]+)\n\n/$1\n/;
5754
5762
      }
5757
5765
}
5758
5766
 
5759
5767
close $in;
5760
 
 
5761
 
print $header . $fixed_output;
 
5768
 
 
5769
if ($nofix) {
 
5770
   print $fixed_output;
 
5771
}
 
5772
else {
 
5773
   print $header . $fixed_output;
 
5774
}
5762
5775
 
5763
5776
sub format_links {
5764
5777
   if ( my ($label, $url) = split /\|/, $_[0] ) {