Commit Graph

64 Commits

Author SHA1 Message Date
Antonio Valentino
620491fcd5 Retireve docstirng form base classes (Closes #3140) 2017-08-18 11:37:11 +02:00
Takeshi KOMIYA
bfd71cd77b Fix #3926: Add `autodoc_warningiserror to suppress the behavior of -W` option 2017-07-15 22:04:56 +09:00
shimizukawa
de2cd652ab update CHANGES refs #2961 2017-04-19 16:28:56 +09:00
Robin Jarry
ececc4dcfe ext: enhance autodoc_mock_imports
The autodoc_mock_imports option requires to explicitly declare *every*
external module and sub-module that are imported by the documented code.
This is not practical as the list can become very large and must be
maintained as the code changes.

Also, the mocking is minimal which causes errors when compiling the
docs. For example, if you declare:

    autodoc_mock_imports = ['django.template']

And try to document a module:

    .. automodule:: my.lib.util

Which contains this code:

    from django.template import Library
    register = Library()

The following error occurs:

    File ".../my/lib/util.py" line 2
        register = Library()
    TypeError: 'object' object is not callable

Other similar errors can occur such as "TypeError: 'object' object has
no len".

To address these limitations, only require to declare the top-level
module that should be mocked:

    autodoc_mock_imports = ['django']

Will mock "django" but also any sub-module: "django.template",
"django.contrib", etc.

Also, make the mocked modules yield more complete dummy objects to avoid
these TypeError problems.

Behind the scenes, it uses the python import hooks mechanism specified
in PEP 302.

Signed-off-by: Robin Jarry <robin@jarry.cc>
2017-04-18 17:08:17 +02:00
Rob Ruana
f45fe6fc8c Fix #3174: [Napoleon] Defers autodoc-skip-member to other extensions if Napoleon doesn't care if the member is skipped 2016-11-23 10:45:39 -08:00
Takeshi KOMIYA
dca1669b2f Merge pull request #2300 from akruis/feature_autoclass_content_from__new__
Feature: enhance autoclass:: to use the docstring of __new__ if __init__ method's is missing of empty
2016-02-14 14:45:25 +09:00
Georg Brandl
5e8642983b Fixup links in the documentation. 2016-02-13 16:00:46 +01:00
Anselm Kruis
0311f33347 Feature: enhance autoclass:: to use the docstring of __new__
The method new is an alternative to __init__, but autoclass does not 
respect __new__. This commit enhances the directive autoclass:: to try
__new__ method's docstring, if __init__ method's docstring is missing or
empty.

The commit also adds tests and updates the documentation.
2016-02-05 19:09:43 +01:00
EricFromCanada
65e924a3e4 rewrapping paragraphs when over 80 characters wide 2014-06-18 11:53:25 -04:00
Georg Brandl
02363c3ce2 merge with stable 2014-03-06 08:13:14 +01:00
Georg Brandl
b944c843f5 Add warnings that autodoc imports the modules. 2014-03-05 07:45:45 +01:00
Rob Ruana
63fbb819c7 Makes suggested changes before adding napoleon to sphinx 2014-01-19 13:43:54 -05:00
Georg Brandl
5023da8ac3 mock: little changes, changelog and versionadded 2014-01-19 10:34:52 +01:00
guibog
a8f65e9d3c autodoc extension: add autodoc_mock_imports config value 2013-10-23 16:36:45 +08:00
Georg Brandl
44418fd1a1 changelog update for PR#136 2013-09-16 09:26:14 +02:00
Georg Brandl
d2b4f9a095 Merged in Vladimirsson/sphinx (pull request #136)
Added ``imported-members`` option for ``automodule`` directive in autodoc
2013-09-16 09:23:56 +02:00
Bogdan Opanchuk
a7a4f7569a Added `imported-members option for automodule` directive in autodoc 2013-04-20 21:58:18 +10:00
Johannes Dewender
649ab8030c autodoc: change :novalue: to :annoation: option
The :novalue: option is now called :annotation: and has an additional feature:
When given with an argument, you can specify what the annotation
of the object will be.
2013-02-27 16:38:55 +01:00
Johannes Dewender
391f99d13a autodoc: document novalue option
The update is listed for version 1.2.
This should be changed if the change is released later.
2013-01-22 17:58:47 +01:00
Georg Brandl
c333f515cd Doc change for d7ac5e46307d 2012-05-08 12:51:28 +02:00
Georg Brandl
fe8ed35dfb Make it clearer how autodoc special comments have to be formatted. 2012-03-17 16:54:17 +01:00
Georg Brandl
a63230f12d #431: Doc comments for attributes can now be given on the same line as the assignment. 2011-01-15 15:40:59 +01:00
Georg Brandl
87b0ac63ed merge with 1.0 2011-01-09 00:47:48 +01:00
Georg Brandl
b89e9b4346 Clarification. 2011-01-08 23:50:03 +01:00
Georg Brandl
7518d19437 #469: document __all__ ordering in members. 2010-08-05 18:59:04 +02:00
Georg Brandl
580e1c90d3 #481, #482: fix `.name` reference matching.
#482: When doing a non-exact search, match only the given type of object.
#481: Apply non-exact search for Python reference targets with ``.name`` for modules too.
2010-08-05 13:39:23 +02:00
Georg Brandl
a304c8d247 Fix-up half-sentence. 2011-01-03 23:50:30 +01:00
Georg Brandl
f6cb763ff8 #564: Add :confval:autodoc_docstring_signature which retrieves the signature from the first line of the docstring, if it is found there. 2011-01-03 22:51:33 +01:00
Georg Brandl
594c1a90f4 #520: Provide `special-members` option for autodoc directives. 2011-01-03 21:56:41 +01:00
Georg Brandl
92cb77a131 #176: Provide `private-members` option for autodoc directives. 2011-01-03 21:48:37 +01:00
Chris Rebert
ef62d317e5 autodoc's docstring/special-comment detection works for instance attributes too 2010-10-02 00:05:59 -07:00
Georg Brandl
f4f3066581 Use the new rst domain in the sphinx docs. 2010-04-17 10:39:51 +02:00
Georg Brandl
1ea64352fe A bit more tutorial. 2010-03-14 19:46:54 +01:00
Georg Brandl
a31e7e2f5d #187: Added support for source ordering of members in autodoc, with `autodoc_member_order = 'bysource'`. 2010-02-28 11:39:13 +01:00
Georg Brandl
fab92b215a Added `autodoc_default_flags` config value, which can be used
to select default flags for all autodoc directives.
2010-02-21 22:16:06 +01:00
Georg Brandl
290a623669 Note that member docstrings need to be reST as well. 2009-09-09 19:10:24 +02:00
Georg Brandl
87cf9675c8 Fix markup. 2009-09-09 18:27:59 +02:00
Georg Brandl
c3b8e3fdf0 Clarify docs of automodule options. 2009-09-09 18:26:59 +02:00
Georg Brandl
269345a0f3 Clarify and fix typo. 2009-06-16 21:19:15 +02:00
Georg Brandl
e517911ac3 Autodoc can now exclude single members from documentation
via the ``exclude-members`` option.
2009-03-15 23:52:48 +01:00
Georg Brandl
d2d3606158 Autodoc can now order members either alphabetically (like previously) or by member type;
configurable either with the config value ``autodoc_member_order`` or a ``member-order`` option per directive.

Also fix a bug that documented module-level functions as attributes.
2009-02-27 15:48:41 +01:00
Georg Brandl
dd32405563 Remove docs for removed automodule_skip_lines setting. 2009-02-27 15:22:45 +01:00
Georg Brandl
10c89799fd Fix #93: note that show-inheritance works with automodule. 2009-02-15 18:52:28 +01:00
Georg Brandl
55c4f5a096 merge with trunk 2009-01-22 19:25:24 +01:00
Georg Brandl
29cc19a199 merge with 0.5 2009-01-22 19:23:23 +01:00
Georg Brandl
05cf79da52 A bit of clarification about where Sphinx finds autodoced modules. 2009-01-22 19:22:49 +01:00
Georg Brandl
aedbdd953d Fix more line length and trailing whitespace. 2009-01-10 22:18:18 +01:00
Georg Brandl
34a08b862e Document how autodoc with attributes works. 2009-01-06 00:28:29 +01:00
Georg Brandl
155411a93d Allow skipping members by event. 2008-11-02 20:04:24 +00:00
Georg Brandl
b4f91a5ce5 #3422: allow changing the signature of functions via a new hook. 2008-07-29 18:30:23 +00:00