App-Framework

 view release on metacpan or  search on metacpan

lib/App/Framework/Extension/Filter.pm  view on Meta::CPAN

    sub app
    {
        my ($app, $opts_href, $state_href, $line) = @_ ;
    
        my $ok = 1 ;
        if ($state_href->{'vars'}{'state'} eq 'start')
        {
            if ($line =~ m/<!-- Generated by Doxygen/i)
            {
                $ok = 0 ;
                $state_href->{'vars'}{'state'} = 'doxy-head' ;
            }
        }
        elsif ($state_href->{'vars'}{'state'} eq 'doxy-head')
        {
            $ok = 0 ;
            if ($line =~ m/<div class="contents">/i)
            {
                $ok = 1 ;
                $state_href->{'vars'}{'state'} = 'contents' ;
            }
        }
        elsif ($state_href->{'vars'}{'state'} eq 'contents')
        {
            if ($line =~ m/<hr size="1"><address style="text-align: right;"><small>Generated/i)
            {
                $ok = 0 ;
                $state_href->{'vars'}{'state'} = 'doxy-foot' ;
            }
        }
        elsif ($state_href->{'vars'}{'state'} eq 'doxy-foot')
        {
            $ok = 0 ;
            if ($line =~ m%</body>%i)
            {
                $ok = 1 ;
                $state_href->{'vars'}{'state'} = 'end' ;
            }
        }
    
        # only output if ok to do so
        $state_href->{'output'} = $line if $ok ;
    }
    
    
    #=================================================================================
    # SETUP
    #=================================================================================
    __DATA__
    
    [SUMMARY]
    Filter Doxygen created html removing frames etc.
    
    [DESCRIPTION]
    B<$name> does some stuff.


The script takes in HTML of the form:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>rctu4_test: File Index</title>
    <link href="doxygen.css" rel="stylesheet" type="text/css">
    <link href="tabs.css" rel="stylesheet" type="text/css">
    </head><body>
    **<!-- Generated by Doxygen 1.5.5 -->
    **<div class="navigation" id="top">
    **  <div class="tabs">
    **    <ul>
    ..
    **  </div>
    **</div>
    <div class="contents">
    <h1>File List</h1>Here is a list of all files with brief descriptions:<table>
      <tr><td class="indexkey">src/<a class="el" href="rctu4__tests_8c.html">rctu4_tests.c</a></td><td class="indexvalue"></td></tr>
      <tr><td class="indexkey">src/common/<a class="el" href="ate__general_8c.html">ate_general.c</a></td><td class="indexvalue"></td></tr>
    ...
    
      <tr><td class="indexkey">src/tests/<a class="el" href="test__star__daisychain__specific_8c.html">test_star_daisychain_specific.c</a></td><td class="indexvalue"></td></tr>
      <tr><td class="indexkey">src/tests/<a class="el" href="test__version__functions_8c.html">test_version_functions.c</a></td><td class="indexvalue"></td></tr>
    </table>
    
    </div>
    
    **<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jun 5 13:43:31 2009 for rctu4_test by&nbsp;
    **<a href="http://www.doxygen.org/index.html">
    **<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
    </body>
    </html>

And removes the lines beginning '**'.

The script does in-place updating of the HTML files and can be run as:

    filter-script *.html

=cut

use strict ;
use Carp ;

our $VERSION = "1.001" ;





#============================================================================================
# USES
#============================================================================================
use File::Path ;
use File::Basename ;
use File::Spec ;
use App::Framework::Core ;


#============================================================================================
# OBJECT HIERARCHY
#============================================================================================
use App::Framework::Extension ;
our @ISA ; 



( run in 1.732 second using v1.01-cache-2.11-cpan-39bf76dae61 )