Menu

#310 reST: field lists not handled correctly

v3.0
open
other (40)
5
2009-05-26
2009-05-26
No

Hello,

I'm using the reStructuredText format to document my Python API's. I'm having some problems with the field lists feature of reST though.
The following reST input is correctly handled by docutils:

:require: true (<tr class="field"><th class="docinfo-name">require:</th><td class="field-body">true</td></tr>)
:ensure: true (<tr class="field"><th class="docinfo-name">ensure:</th><td class="field-body">true</td></tr>)

But when placed in a docstring and parsed by epydoc, the following is generated:

:require: true (<div class="fields"> <p><strong>Requires:</strong>true>)
:ensure: true Warning: Unknown field tag u'ensure'

So the :require: field is translated to 'Requires' while the ensure field cannot be parsed at all.

Another problem that I came across is that the following documentation, which is copied 'as-is' from the documentation:

def foo(x, y):
"""
:Parameters:
- `x`: the x
- `y`: the y
"""
pass

results in the following warnings:

Warning: Line 77: Unable to split consolidated field "Parameters"
- does not contain a single list.
Warning: Line 78: Field list ends without a blank line; unexpected unindent.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.