Well, google wasn't being particularly helpful so I figured I'll just hack the goddamn doxygenfilter for my purpose. The doxyfilter perl script that you add as INPUT_FILTER calls PerlFilter->flter() method, which does the actual processing of each script. As suspected, it does not even look for POD syntax. All you gotta do is modify it to make it work with POD. In our case any all POD open tags (=head1, =head2 etc) are always closed (=cut). So this filter method handles that & dumps out what Doxygen will understand.

If someone wants to expand this to support full POD syntax, the following code snippet should be a good start.

sub filter { my($self, $infile) = @_; open(my $infh, $infile); my $current_class = ""; my $file = []; while( <$infh> ) { push( @$file, $_ ); } $self->file_contents( $file ); my $objcontext = grep( /^\s*use\s+base\s/, @$file ) || grep( /\@ISA/, @$file ) || grep( /^\s*bless/, @$file ) || grep( /^\s*sub\s+new\s/, @$file ) || grep( /\$self/, @$file ); push( @$file, "" ); # in order to have a delimiting empty line at + EOF for( my $line=0; $line <= $#$file; ) { $_ = $file->[$line++]; if (/^use\s+([\w:]+)/) { my $inc = $1; $inc =~ s/::/\//g; $self->print("#include \"$inc.pm\"\n"); } elsif (/^package\s+([\w:]+)/) { if ($current_class) { $self->flush; $self->print("};\n"); } next unless( $objcontext ); $current_class = $1; $self->emit_class( $current_class, $line ); } if (/^=head\d/) { my @more; while ($_ = $file->[$line++]) { if (/^=cut/s) { last; } else { #print "DOC ---- $_"; push @more, $_; } } $_ = $file->[$line++]; while ($_ =~ /^$/) { $_ = $file->[$line++]; } if (/^\s*sub\s+([\w:]+)/) { my( $proto, $name, @args ) = $self->analyze_sub($line-1); if( $current_class && @args && ($args[0] eq "\$self") ) { $self->push($self->protection($proto).' Object Methods'); $proto =~ s/\$self,*\s*//; } elsif( $current_class && ((@args && ($args[0] eq "\$class")) || ($name eq "new") +) ) { $self->push($self->protection($proto).' Class Methods'); } else { $self->push($self->protection($proto).' Functions'); } $proto = $self->munge_parameters($proto); $self->start("\@fn $proto")->more(@more)->end; $self->print($proto, ";\n"); $self->pop; } redo if defined $_; } } $self->flush(); if ($current_class) { $self->print("};\n"); } }

In reply to Re^4: DoxygenFilter & DoxyFilt by rovingeyes
in thread DoxygenFilter & DoxyFilt by rovingeyes

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.