Write your own Pod translator.

No, seriously, it's really easy. I talk about it in a chapter for or two for Mastering Perl, but mostly "Working with Pod". Although I use Pod::PseudoPod::HTML because O'Reilly has some extra Pod features, it's the same idea. You can even grab my own pod2html from the Mastering Perl repository. All of the HTML for the chapter pages comes out of my own pod2html.

Instead of using pod2html (the one that uses Pod::Html from Tom C.), create your own pod2html. It's not that hard considering that the entire script is:

use Pod::Html; pod2html @ARGV;

The Pod::Simple equivalent is:

use Pod::Simple::HTML; Pod::Simple::HTML->parse_from_file( @ARGV );

That's just the stock, off-the-shelf behavior though. If you want to change what happens when it parses the L<> stuff, you only have to override the parts that handle that part.

package My::Pod::HTML::Simple; use base qw( Pod::HTML::Simple ); sub do_link { ... whatever you want ... } 1;

Now your pod2html becomes:

use My::Pod::Simple::HTML; My::Pod::Simple::HTML->parse_from_file( @ARGV );
--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review

In reply to Re: POD L<> and relative links? by brian_d_foy
in thread POD L<> and relative links? by skazat

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.