I'm implementing a Pod pre-processor using the:

    =for pp command <option1, option2> args

escape syntax that Pod gives us.  I've started using the Pod::PP namespace,
but would like to reserve the name space.  Here's the DLSI entry:

    Name           DSLI  Description                                  Info
    -----------    ----  -------------------------------------------- -----
    Pod::PP        idpO  A Pod pre-processor                          RAM

[The following might be of interest to Brad only]

The Pod::PP class inherits from Pod::Parser. It currently suports things like:

CPP-like features:

    =for pp include "file"              # a #include, relative to local file

CPP-like features, toying for now:

    =for pp define SYMBOL value         # a #define SYMBOL value (not a macro)
    =for pp undef SYMBOL                # a #undef SYMBOL
    =for pp ifdef SYMBOL
    =for pp else
    =for pp endif
    =for pp ifndef
    =for pp if defined(SYMBOL) || (OTHER <= 4 && TARGET eq 'html')
    =for pp elif expr

No-so CPP-like, and 100% experimental:

    =for pp include <nest> "file"       # a #include with =head1 -> =head3...
    =for pp image <center> "file"       # insert image + format (centered)
    =for pp autolink "key phrase" LINK  # turn all X<key phrase> into LINK

The feature set is not fully established yet.  I'm implementing what I
currently need...  Also, it's really pre-processing.  For instance, the
"image" command can generate the various "=for html", "=for text" etc...,
(which might load "file.text" instead if "file.jpeg" is loaded for HTML),
unless pre-processing is constrained (we know we're going to generate HTML,
so don't bother, and strip all =for which are not for html).

Finally all output is normalized.  A sequence of

    ==for xxx...
    ==for yyy...

is turned into:

    =for xxx...

    =for yyy...

so that translators do not choke on the non-standard (but useful) == prefix.

Raphael

Reply via email to