Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

POD nested item list not rendered as expected

by GrandFather (Saint)
on Jun 19, 2007 at 02:38 UTC ( [id://621918]=perlquestion: print w/replies, xml ) Need Help??

GrandFather has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to create nested item lists using POD. The simple test POD:

=over 4 =item Item Entry - left justified, but as designed :( item description - fine =over 4 =item Nested item entry - not fine, not indented nested item's description, ok wrt item, but indented to 8 expected =back =back

renders as

Item Entry - left justified, but as designed :( item description - fine Nested item entry - not fine, not indented nested item's description, ok wrt item, but indented to 8 expected

where I expected the items to look like:

Item Entry - left justified, but as designed :( item description - fine Nested item entry - not fine, not indented nested item's description, ok wrt item, but indented to 8 expe +cted

The issue seems to be that pod2html is generating

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

but if I replace that with

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

(as generated by PerlMonks) the nesting is as I expect. Is this a problem with pod2html as shipped by ActiveState with their Perl v5.8.7 distribution, or is there something that I am missing?


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re: POD nested item list not rendered as expected
by doom (Deacon) on Jun 19, 2007 at 06:54 UTC
    Unfortunately, pod2html is very stale, and effectively broken (it's a minor scandal that the perl porters haven't gotten around to endorsing a replacement for it).

    You should almost certainly try again with Pod::Simple::HTMLBatch, which is what's actually used to generate the html you see on cpan.org.

    I wrote up some commentary on it awhile back: Review Pod::Simple::HTMLBatch

Re: POD nested item list not rendered as expected
by ysth (Canon) on Jun 19, 2007 at 03:58 UTC
    The html I see is really broken; I'm surprised you get anything at all when claiming XHTML. The inner list follows rather than is nested in the outer list's dd tag (giving a dl directly inside a dl, which is verboten) and there's a bonus closing-li tag before the closing-dl tags.

      so the simple fix (apart from updating Perl) is to edit Perl/Lib/Pod/Html.pm to "fix" the header generated by the print HTML <<END_OF_HEAD; heredoc by altering the header text to match the second header given above.

      It may be that that is fixed in some fashion in POD::Html.pm 1.0504 which seems to ship with Perl 5.8.8 rather than the 1.0503 version shipped with Perl 5.8.7 which I'm currently using. I notice though that the header text in the heredoc is unchanged.


      DWIM is Perl's answer to Gödel
        I wouldn't count on all browsers indenting the way you want, even with HTML 4.01 headers. And I tried with 5.8.8's Pod::Html 1.0504.
Re: POD nested item list not rendered as expected
by Anonymous Monk on Jun 19, 2007 at 04:07 UTC
    Upgrade
    perl -MPod::Html -e"die Pod::Html->VERSION" perl -MPod::Html -e'die Pod::Html->VERSION'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://621918]
Approved by naikonta
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-23 22:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found