Steffen "Daode" Nurpmeso <sdaoden@gmail.com> writes:
Russ Allbery <rra@stanford.edu> wrote:
|If you do decide to use POD, you may want to pick a different letter than |I, since I<> is already a POD formatting code (for italics). D<> is safe |to use; there's no existing formatting code.
Well, that was just what came to my mind on saturday. Maybe U<> (for URL)? It seems unused.
Yup, that would work.
I also can hardly imagine that spreading formatting tags will be accepted by the actual tz maintainer(s), since otherwise they might have done it 15 years ago.
True. :)
I think the script can easily get extended by another mode which simply takes an encoding name and reads text from STDIN/file, converting to tz database-style comment output along the way; i.e., HTML entities. It would have to decode HTML entities to E<>, which should work, then? Shouldn't be that hard either.
Yup, that would also work and wouldn't be too difficult, since E<> takes the same values as HTML entities.
..Well i think for L<> to work the way you show it above the POD parser must be adjusted; or we need to use special tags and make POD treat them as links.
You mean the L<anchor|http://www.example.com/> form? No, that's just standard POD; any POD parser will handle that out of the box. Or do you mean not emitting the contents of U<> and D<>? that would indeed require some tweaks, but not very difficult ones.
I haven't yet used POD any more sophisticated than this:
use Pod::Text; my $parser = Pod::Text->new(loose => 1, indent => 0, width => 72); $parser->parse_from_file($0, '-');
and of course normal module documentation, so some hints how to do the required task would be appreciated.
Basically, you tell Pod::Simple that you accept some additional formatting codes with: $parser->accept_codes(qw(D U)); and then add new cmd_d and cmd_u subs that do whatever they should do with the contents. I can explain more if anyone is interested in going this direction.
It of course all stands and falls with wether these adjustments will be acceptable for the tz database as such. I'm not planning to fork the project.
Indeed. -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>