Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

POD nested item list not rendered as expected

by GrandFather (Cardinal)
on Jun 19, 2007 at 02:38 UTC ( #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

Comment on POD nested item list not rendered as expected
Select or Download Code
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'
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

Log In?
Username:
Password:

What's my password?
Create A New User
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? | Other CB clients
Other Users?
Others wandering the Monastery: (13)
As of 2014-07-30 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (234 votes), past polls