Commits

georg.brandl  committed 29acfa1

Support :noindex: in autodoc directives.

  • Participants
  • Parent commits 39fcaab

Comments (0)

Files changed (3)

   - The `autodoc` extension now offers a ``show-inheritance`` option
     for autoclass that inserts a list of bases after the signature.
 
+  - The autodoc directives now support the ``noindex`` flag option.
+
 
 Bugs fixed
 ----------

File doc/ext/autodoc.rst

 
      .. versionadded:: 0.4
 
+   * All autodoc directives support the ``noindex`` flag option that has the
+     same effect as for standard :dir:`function` etc. directives: no index
+     entries are generated for the documented object (and all autodocumented
+     members).
+
+     .. versionadded:: 0.4
+
    .. note::
 
       In an :dir:`automodule` directive with the ``members`` option set, only

File sphinx/ext/autodoc.py

         # Be explicit about the module, this is necessary since .. class:: doesn't
         # support a prepended module name
         result.append(indent + u'   :module: %s' % mod, '<autodoc>')
+    if options.noindex:
+        result.append(indent + u'   :noindex:', '<autodoc>')
     result.append(u'', '<autodoc>')
 
     if options.show_inheritance and what in ('class', 'exception'):
         members = ['__all__']
     genopt.undoc = 'undoc-members' in options
     genopt.show_inheritance = 'show-inheritance' in options
+    genopt.noindex = 'noindex' in options
 
     filename_set = set()
     warnings, result = generate_rst(what, name, members, genopt, content, state.document,
 
 
 def setup(app):
-    mod_options = {'members': members_directive, 'undoc-members': directives.flag}
+    mod_options = {'members': members_directive, 'undoc-members': directives.flag,
+                   'noindex': directives.flag}
     cls_options = {'members': members_directive, 'undoc-members': directives.flag,
-                   'inherited-members': directives.flag,
+                   'noindex': directives.flag, 'inherited-members': directives.flag,
                    'show-inheritance': directives.flag}
     app.add_directive('automodule', auto_directive_withmembers,
                       1, (1, 0, 1), **mod_options)
                       1, (1, 0, 1), **cls_options)
     app.add_directive('autoexception', auto_directive_withmembers,
                       1, (1, 0, 1), **cls_options)
-    app.add_directive('autofunction', auto_directive, 1, (1, 0, 1))
-    app.add_directive('automethod', auto_directive, 1, (1, 0, 1))
-    app.add_directive('autoattribute', auto_directive, 1, (1, 0, 1))
+    app.add_directive('autofunction', auto_directive, 1, (1, 0, 1)
+                      noindex=directives.flag)
+    app.add_directive('automethod', auto_directive, 1, (1, 0, 1),
+                      noindex=directives.flag)
+    app.add_directive('autoattribute', auto_directive, 1, (1, 0, 1),
+                      noindex=directives.flag)
     app.add_config_value('automodule_skip_lines', 0, True)
     app.add_config_value('autoclass_content', 'class', True)