#1 Auto-numbering of enumerated lists

closed-out-of-date
None
5
2005-04-05
2002-04-25
No

I discovered that currently, a list like this:
-----------------------------------------------
1. Something here
1. Another thing here
1. A different thing here
-----------------------------------------------
will be processed like this:
-----------------------------------------------
1. Something here

WARNING (level 2 system message)
Enumerated list ends without a blank line; unexpected
unindent at line 2.

1. Another thing here

WARNING (level 2 system message)
Enumerated list ends without a blank line; unexpected
unindent at line 3.

1. A different thing here
-----------------------------------------------
but because I've used wikis I expected this:
-----------------------------------------------
1. Something here
2. Another thing here
3. A different thing here
-----------------------------------------------
I modified
docutils/build/lib/docutils/parsers/rst/states.py
to make it behave the way I was expecting it to.

Specifically, it auto-increments successive identical
enumerators so that:

1,1,1 -> 1,2,3
1,2,2 -> 1,2,3
3,3,3 -> 3,4,5
1,2,2,3 -> 1,2,3 [WARNING] 3

David told me he had mixed feelings about this
behaviour, but he would post about it to the Doc-SIG to
collect other opinions.

This is my first patch submission to the project. I
hope my patch is in the correct format. -Fred

Discussion

  • Fred Bremmer

    Fred Bremmer - 2002-04-25

    Output of diff -c states.py.orig states.py

     
    Attachments
  • Felix Wiemann

    Felix Wiemann - 2005-04-05

    Logged In: YES
    user_id=1014490

    It has been finally implemented now by David Goodger, but a
    little bit differently than how you proposed:

    #. First item.
    #. Second item.
    #. Third item.

    Details from the reST spec:

    "In addition, the auto-enumerator, "#", may be used to
    automatically enumerate a list. Auto-enumerated lists may
    begin with explicit enumeration, which sets the sequence.
    Fully auto-enumerated lists use arabic numerals and begin
    with 1."

    You can grab a current snapshot from:
    http://docutils.sourceforge.net/docutils-snapshot.tgz

    Thanks for the patch nonetheless! We always appreciate patches.

     
  • Felix Wiemann

    Felix Wiemann - 2005-04-05
    • assigned_to: nobody --> felixwiemann
    • status: open --> closed-out-of-date
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks