On Thu, Aug 21, 2003 at 03:09:07PM -0800, Sean M. Burke wrote:
> At 02:43 PM 2003-08-21 -0700, Michael G Schwern wrote:
> >Test::Pod throws a whole lot of non-errors which I presume are from 
> >Pod::Simple.  They fall into three categories.
> >
> >* reporting that =item lists are out of order.
> >
> >One set of failures is because it doesn't recognize that item lists can 
> >start with 0.  More generally the problem is not all numbered item lists 
> >are supposed to be ordered lists! [...] The POD formatter should be smart 
> >enough to decide if it has an ordered list or not.
> 
> The telepathic powers of Pod "formatters" (i.e., parser-plus-renderers) are 
> alas limited.

If Pod::Simple can inform me that my items are out of order then it
certainly knows that it doesn't have an ordered list starting at 1!

And if it doesn't have an ordered list starting at 1, simply treat it like
any normal list of strings.

Yes, this might require some look ahead when the formatter walks the POD
tree.  If you've written a POD parser that has trouble with look-aheads
then you might be in trouble.

Alternatively, if the formatter author wants to be lazy, you can simply
assume what you've got is a list of strings and display

=item 1

=item 3

=item 5

exactly the same way you'd display

=item foo

=item bar

=item baz

This means the POD spec doesn't have to be dumbed-down because some
formats like to make a special case out of numbered, sequential, ordered 
lists stating at 1 and some POD formatter implementations aren't good
at look-aheads.

Alternatively, if you really want to use <OL> (and I'm using HTML here
because I don't know the other common pod2x formats well enough to know if
they special-case ordered, numeric lists) you can use the "<li value=N>"
style like so:

<ol>
<li value=1>
<li value=3>
<li value=5>
</ol>

for cases where its an unbroken, ordered list of integers *not* starting at
one there's <ol start=N>

<ol start=0>
<li>
<li>
<li>
</ol>

which is 0, 1, 2, 3.

Then you can at least support lists of unordered, out of sequence numbers.

See http://www.w3.org/TR/html401/struct/lists.html#h-10.2 for details.


> >* reporting that you can't have anything between an =over and an =item.
> >
> >I'm not entirely sure this should be disallowed.  I can't find where
> >in perlpodspec it is disallowed.
> 
> I'm entirely sure this should be disallowed.
> It would take too much lookahead (like: potentially a whole document's 
> worth) to have Pod::Simple implement something more telepathic.  (Ditto for 
> the first point, in fact.)

I think this can be done without any look-ahead.

  line 1:  =over 4

Indent everything following by 4

  line 2:

New paragraph

  line 3:  foo

Display text foo indented by 4

  line 4:

New paragraph

  line 5:  =item whistle

Start a list indented by 4
Display list element whistle


-- 
Michael G Schwern        [EMAIL PROTECTED]  http://www.pobox.com/~schwern/
...let me think it over while Cheese beats you with a baseball bat.

Reply via email to