Hello.

I don't see how the sphinx modifications can make this happen.
The only modification to autodoc is to add a EventDocumenter class.

The docstring is there:

>>> import pyglet.window
>>> print pyglet.window.Window.invalid.__doc__

bool(x) -> bool   <- (Question: where does this come from?)

Returns True when the argument x is true, False otherwise.
The builtins True and False are the only two instances of the class bool.
The class bool is a subclass of the class int, and cannot be subclassed.

But sphinx does not read the docstring, see sphinx.ext.autodoc.py line 1206: # if it's not a data descriptor, its docstring is very probably the wrong thing to display
no_docstring = True

If I remove this, the doctring appears at the docs, but I dont know why is this. I'm on it.


You can try this:

# Attribute documentation patch
from sphinx.ext.autodoc import ClassLevelDocumenter, AttributeDocumenter

def fix_add_content(self, more_content, no_docstring=False):
    # See sphinx.ext.autodoc.py line 1206
ClassLevelDocumenter.add_content(self, more_content, no_docstring=False)

AttributeDocumenter.add_content = fix_add_content


El 16/11/2013 17:02, "Juan J. Martínez" escribió:
Hello,

I have some issues generating Pyglet's documentation.

1.1.x was using epydoc (and probably some sphinx too), but 1.2 is using
sphinx only. Looks like we have a patched Sphinx extension in our tree
to make autodoc work with pyglet.

My problem is basically that some autodoc strings aren't extracted properly.

For example:

  this:

  https://code.google.com/p/pyglet/source/browse/pyglet/window/__init__.py#362

  results in:

http://pyglet-current.usebox.net/api/window/pyglet.window.Window.html#pyglet.window.Window.invalid

We're using `autoattribute` and that result isn't correct according to
Sphinx documentation:

http://sphinx-doc.org/ext/autodoc.html#directive-autoattribute

I can't explain what's going on. I suspect this behaviour is related to
our patched version of autosummary, but I don't have the knowledge or
the time to find out what's going on.

May be someone on the list knows how Pyglet's doc generation works and
can give me some pointers.

Regards,

Juan



--
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to