[tz] TZ file comments UTF-8? Bastardized HTML?

Russ Allbery rra at stanford.edu
Sat Jan 12 21:14:32 UTC 2013


Steffen "Daode" Nurpmeso <sdaoden at gmail.com> writes:

> How about turning over to a simple generic approach, as in

>   L<http://www.url1.com>
>   and/or
>   L<Some descriptive text><http://www.url2.com>

> and having "I" for informational links that follow the same style
> but do not provide hyperlinks and "D" for dead links?

Note that this is very, very close to POD syntax, and if you move the rest
of the way to POD syntax, you could then just extract the comments and use
any of the existing POD formatters and, from that, get any output format
you want from text through HTML to PDF.

The only changes that you'd need to make would be to change your second
example to:

    L<Some descriptive text|http://www.url2.com>

and then decide how you'd like to handle the I and D links.  One option
for the latter would be to just prefilter the output to remove the link
and return just the descriptive text before processing the rest of the
document with a POD formatter, which would be quite easy to do using
either a simple script or existing POD parsing modules.

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.

POD would also give you headings, verbatim paragraphs, and a (very
verbose, admittedly) syntax for lists if you wanted to use them, but you
of course wouldn't have to.

This doesn't solve the character set problem, sadly; POD of course has its
own method of representing characters outside the input character set, but
it's as ugly (or uglier) than all the encoding methods already proposed.
But neither would it get in the way; POD is happy with any input character
set you want to use, and just wants a single =encoding command somewhere
to tell it what to expect if you're not using US-ASCII or UTF-8.

I'm happy to help with any POD issues, including showing how to subclass
Pod::Text to add new formatting codes, if you want to go that route.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>


More information about the tz mailing list