At 08:32 PM 2003-06-30 +0200, [EMAIL PROTECTED] wrote:
[Pod::Simple::PullParser]
If I've translated the section titles (Lets say I've changed
"=head1 NAME" to "=head1 AD"), the module does not see the
title (or accept =head1 AD section as a title -- AD means NAME).

Ah yes, the NAME problem. The *roff-centric view of this would say that Pod must have a "=head1 NAME" section, as well as others (DESCRIPTION? SYNOPSIS?). I am beginning to think that this is *roff's problem, not Perl's, and if pod2*roff converters need there to be NAME/etc sections, then it's up to them to enforce that (i.e., to insert it if it's not there).


Now, outside of just *roff formatting, it is often important to be able to extract the name of a particular Pod document. PullParser's heuristic, as you noticed, is to look for a =head1 NAME section. In the interests of nationalization, this should clearly be changed. But I wouldn't want it to be something formatter-specific, because that would require every formatter to know about every language it could possibly be formatting.

How about the following?

- If the first Pod thing is a =head1 NAME, and the next paragraph is short and might even look like "thing -- thing thing thing thing thing", then get the name/description from that.

- Otherwise if the first pod thing is a =head1 XXXXX where "XXXXX" is some string that doesn't contain lowercase ASCII letters (but may contain spaces, punctuation, Unicode characters, E<...> things, but not formatting codes like B<...>), AND if the next paragraph looks like "thing -- thing thing thing thing thing", then presume that XXXXX is just some-language-ese for "NAME", so get the name/description from the "thing -- thing..." line.

- Otherwise, if the first pod thing is a =headN Whatever Stuff, then use Whatever Stuff as the title. (N=1-4, and Whatever Stuff meaning any string at all, possibly including formatting codes, E<...> codes, etc)

- Otherwise, use the file's basename as the title.


Other, implementable, suggestions are welcome.



And a second question. Pod::Simple::HTML works fine with Turkish
characters, if it does not use escaping with ord()

I think this is a problem that we hope to solve immediately with Autrijus's =encoding suggestion. Watch the skies.


--
Sean M. Burke    http://search.cpan.org/~sburke/



Reply via email to