Changeset 22821 for src

Show
Ignore:
Timestamp:
10/29/08 21:29:15 (2 months ago)
Author:
azawawi
Message:

[STD_syntax_highlight] updates to pod docs... --redspans-html=filename option
[STD_syntax_highlight] redspans-mode is not ready yet ... working on it...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/perl6/STD_syntax_highlight

    r22820 r22821  
    3131 
    3232    # write only simple html/css to simple.html 
    33     STD_syntax_highlight --simple-html=simple.html foo.pl 
     33    STD_syntax_highlight --simple-html=foo.simple.html foo.pl 
     34 
     35    # write redspans output to foo.redspans.html 
     36    STD_syntax_highlight --redspans-html=foo.redspans.html foo.pl 
    3437=head1 SUBROUTINES 
    3538 
     
    4043#process the command line 
    4144my ($clean_html,$help) = (0,0); 
    42 my ($simple_html,$full_html) = (0,'-'); 
     45my ($simple_html,$full_html,$redspans_html) = (0,'-',0); 
    4346GetOptions( 
    4447    "clean-html"=>\$clean_html, 
    4548    "simple-html=s"=>\$simple_html, 
    4649    "full-html=s"=>\$full_html, 
     50    "redspans-html=s"=>\$redspans_html, 
    4751    "help"=>\$help 
    4852); 
     
    5963 
    6064    --simple-html=filename 
    61         simple mode output filename (disabled by default, - for STDOUT)   
     65        write simple-mode html to filename (disabled by default, - for STDOUT)   
    6266 
    6367    --full-html=filename    
    64         full mode output filename (enabled by default, - for STDOUT) 
     68        write full-mode html to filename (enabled by default, - for STDOUT) 
     69  
     70    --redspans-html=filename    
     71        write redspans-mode html to filename (enabled by default, - for STDOUT) 
    6572     
    6673HELP 
     
    107114            open FILE, ">$full_html" or 
    108115                die "Cannot open $full_html for writing: $OS_ERROR\n"; 
     116            print FILE $output; 
     117            close FILE; 
     118        } 
     119    } 
     120    if($redspans_html) { 
     121        my $output = highlight_perl6_redspans(); 
     122        if($redspans_html eq '-') { 
     123            print $output; 
     124        } else { 
     125            open FILE, ">$redspans_html" or 
     126                die "Cannot open $redspans_html for writing: $OS_ERROR\n"; 
    109127            print FILE $output; 
    110128            close FILE; 
     
    302320} 
    303321 
     322=item highlight_perl6_redspans 
     323 
     324This is same as C<highlight_perl> when --redspans is used. 
     325No more javascript tree viewer or anything fancy.  
     326Only nodes that have a color are printed. Not optimal but works ;-) 
     327=cut 
     328sub highlight_perl6_redspans { 
     329   # my ($orig,$events,$opt) = @_; 
     330} 
     331 
    304332=item escape_html 
    305333 
     
    330358The initial STD tree traversal code was written by Paweł Murias (pmurias). 
    331359 
     360The redspans traversal code was written by Larry Wall (TimToady). 
     361 
    332362The browser code was written by Ahmad M. Zawawi (azawawi) 
    333363=cut