Disable enumerated lists introduced by alphabetic or roman numerals.

This commit is contained in:
Georg Brandl
2007-08-03 08:15:50 +00:00
parent 27fdfc9838
commit 6ea0df4f60
5 changed files with 57 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ that Python has such wonderful documentation -- Thank You!
* Steve Alexander
* Jim Ahlstrom
* Fred Allen
* \A. Amoroso
* A. Amoroso
* Pehr Anderson
* Oliver Andrich
* Jesús Cea Avión
@@ -40,7 +40,7 @@ that Python has such wonderful documentation -- Thank You!
* Jeremy Craven
* Andrew Dalke
* Ben Darnell
* \L. Peter Deutsch
* L. Peter Deutsch
* Robert Donohue
* Fred L. Drake, Jr.
* Jeff Epler

View File

@@ -63,9 +63,19 @@ autonumbered using a ``#`` sign::
* It has two items, the second
item uses two lines.
1. This is a numbered list.
2. It has two items too.
#. This is a numbered list.
#. It has two items too.
Note that Sphinx disables the use of enumerated lists introduced by alphabetic
or roman numerals, such as ::
A. First item
B. Second item
Nested lists are possible, but be aware that they must be separated from the
parent list items by blank lines::
@@ -210,12 +220,14 @@ body at the bottom of the document after a "Footnotes" rubric heading, like so::
.. [#] Text of the first footnote.
.. [#] Text of the second footnote.
You can also explicitly number the footnotes for better context.
Comments
--------
Every explicit markup block which isn't a valid markup construct (like the
footnotes above) is regared as a comment.
footnotes above) is regarded as a comment.
Source encoding
@@ -229,4 +241,13 @@ All Python documentation source files must be in UTF-8 encoding, and the HTML
documents written from them will be in that encoding as well.
XXX: Gotchas
Gotchas
-------
There are some problems one commonly runs into while authoring reST documents:
* **Separation of inline markup:** As said above, inline markup spans must be
separated from the surrounding text by non-word characters, you have to use
an escaped space to get around that.
.. XXX more?

View File

@@ -15,7 +15,7 @@ that Python has such wonderful documentation -- Thank You!
* Steve Alexander
* Jim Ahlstrom
* Fred Allen
* \A. Amoroso
* A. Amoroso
* Pehr Anderson
* Oliver Andrich
* Jesús Cea Avión
@@ -40,7 +40,7 @@ that Python has such wonderful documentation -- Thank You!
* Jeremy Craven
* Andrew Dalke
* Ben Darnell
* \L. Peter Deutsch
* L. Peter Deutsch
* Robert Donohue
* Fred L. Drake, Jr.
* Jeff Epler

View File

@@ -63,9 +63,19 @@ autonumbered using a ``#`` sign::
* It has two items, the second
item uses two lines.
1. This is a numbered list.
2. It has two items too.
#. This is a numbered list.
#. It has two items too.
Note that Sphinx disables the use of enumerated lists introduced by alphabetic
or roman numerals, such as ::
A. First item
B. Second item
Nested lists are possible, but be aware that they must be separated from the
parent list items by blank lines::
@@ -210,12 +220,14 @@ body at the bottom of the document after a "Footnotes" rubric heading, like so::
.. [#] Text of the first footnote.
.. [#] Text of the second footnote.
You can also explicitly number the footnotes for better context.
Comments
--------
Every explicit markup block which isn't a valid markup construct (like the
footnotes above) is regared as a comment.
footnotes above) is regarded as a comment.
Source encoding
@@ -229,4 +241,13 @@ All Python documentation source files must be in UTF-8 encoding, and the HTML
documents written from them will be in that encoding as well.
XXX: Gotchas
Gotchas
-------
There are some problems one commonly runs into while authoring reST documents:
* **Separation of inline markup:** As said above, inline markup spans must be
separated from the surrounding text by non-word characters, you have to use
an escaped space to get around that.
.. XXX more?

View File

@@ -30,6 +30,13 @@ from docutils.transforms import Transform
from docutils.transforms.parts import ContentsFilter
from docutils.transforms.universal import FilterMessages
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
from docutils.parsers.rst.states import Body
Body.enum.converters['loweralpha'] = \
Body.enum.converters['upperalpha'] = \
Body.enum.converters['lowerroman'] = \
Body.enum.converters['upperroman'] = lambda x: None
from . import addnodes
from .util import get_matching_files
from .refcounting import Refcounts