[% setvar title User-definable POD handling %]
Note: these documents may be out of date. Do not use as reference! |
To see what is currently happening visit http://www.perl6.org/
User-definable POD handling
Maintainer: Simon Cozens <simon@brecon.co.uk> Date: 25 Sep 2000 Mailing List: perl6-language@perl.org Number: 306 Version: 1 Status: Developing
Make POD extensible by the new =handle
, =ignore
and =define
commands.
One criticism of POD is that it's too restrictive. Three new pragmatic commands will make it arbitrarily user extensible.
Imagine, if you will, that POD formatters define routines. The
=handle
command maps pieces of POD to routines. For instance, if
you're writing a book and you want the Z><
command to insert
an index entry, you'd say something like:
=handle Z<> as index
Of course, not all POD formatters should translate it like that. If they
don't provide the index
routine, then they should silently ignore the
command. Alternatively, you may map the command to a routine when a
certain formatter is run like this:
=handle Z<> as index for tex
The "X" part of the above syntax may also be an equals-command, which could be used to pass physical markup information to the formatter:
=handle =head1 as chapter for tex
You might want to take this to extremes, and pass parameters to the routine. I don't like this, though:
=handle =head1 as h1 for HTML with font_size => 20, font => courier
Tells the parser that certain POD constructs should not be processed by certain formatters:
=ignore L<> for text
Introduces a new construct to be mapped to a routine with =handle
.
This allows the parser to verify arbitrary extensions to POD.
=define =head3 =handle =head3 as h3 for HTML =handle =head3 as subsubsection for tex
POD::Parser
will need to be extended to support these three commands;
text which is found in a =handle
d area should be passed to a routine
in the formatter if one exists or passed through if one does not.
None