At Tuesday 25 August 2009 00:58:06 > 2) How can I sort members using autodoc in the order they were > defined? autodoc imports the module and analyzes its namespace, which is an unordered dictionary. The order of definition cannot be restored from this dictionary. You have to discard the ":members:" option and order members for yourself:
.. autoclass:: Spam .. autoattribute:: number_of_eggs .. automethod:: some_eggs .. automethod:: some_more_eggs > 3) How can I avoid sphinx to add parameter information to specific > classes using autodoc? If "parameter information" refers to the signature of the constructor, you have two ways: 1. Override the signature: .. autoclass:: Spam(first_arg, second_arg) 2. Connect a function to the "autodoc-process-signature" [1] signal by adding something like this to your "conf.py": def process_signature(app, what, name, obj, opts, sig, ann): if what == 'class': return (('spam', ),) def setup(app): app.connect('autodoc-process-signature', process_signature) This will change the signature of all classes documented by autodoc to contain only one argument called "spam". > 4) I have some dummy class named FOO. I'm using that class within > parameter definitions, and the output I get using autodoc is the > standard "<........FOO at .....>" stuff I don't want to see. How can I > overwrite this? Overwriting the __repr__ or __str__ methods doesn't > change that thing. Use a signature processing function like describe above to remove or change this "FOO" parameter. The original signature is available in the "signature" argument of this function. [1] http://sphinx.pocoo.org/ext/autodoc.html#event-autodoc-process-signature -- Freedom is always the freedom of dissenters. (Rosa Luxemburg)
signature.asc
Description: This is a digitally signed message part.