On 2010-04-19, Max Battcher wrote:
> Guenter Milde wrote:
>> On 2010-04-19, Howard Butler wrote:
>>> I am getting it too, though on older versions of sphinx + docutils, it
>>> doesn't happen, and I think it is because something has gotten more
>>> strict.  I have also tried adjusting the offending docstring multiple
>>> ways, and I can't figure out *what* exactly it doesn't like about the
>>> indentation.  

...

> $ python
> >>> from docutils.core import publish_parts
> >>> publish_parts(myfunc.__doc__)

> This should make it a bit more obvious when you encounter what I would 
> guess to be one of the most likely non-obvious causes of formatting 
> errors from docstrings, which is docstrings in a form like:

> def myfunc():
>      """This is the first line.
>      More lines here.
>      Another line.
>      So forth."""

> If you check myfunc.__doc__, you'll see that the first line has no 
> indentation and all of the remaining lines have indentation:

> This is the first line.
>      More lines here.
>      Another line.
>      So forth.

Interestingly, if you check help(myfunc), the lines are aligned::

  myfunc()
      This is the first line.
      More lines here.
      Another line.
      So forth.

and IMO, the docstring-extractor should replicate this behaviour.

Günter

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-...@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to