Skip to content

Commit

Permalink
Add skipping mechanism autodoc
Browse files Browse the repository at this point in the history
It currently just skips __init__ like the old one did
Refs #9624
  • Loading branch information
martyngigg committed Jun 11, 2014
1 parent ea99dc5 commit f080956
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Code/Mantid/docs/source/conf.py
Expand Up @@ -23,7 +23,8 @@
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.doctest',
'mantiddoc.directives'
'mantiddoc.directives',
'mantiddoc.autodoc'
]

#try: # bonus for doxygen links - TODO off for now
Expand Down
24 changes: 24 additions & 0 deletions Code/Mantid/docs/sphinxext/mantiddoc/autodoc.py
@@ -0,0 +1,24 @@
"""
Mantid customizations for the behaviour of the Sphinx autodoc
extension
"""

def skip(app, what, name, obj, skip, options):
"""
Arguments:
app: Sphinx application object
what: the type of the object which the docstring belongs to (one of "module", "class", "exception", "function", "method", "attribute")
name: the fully qualified name of the object
obj: the object itself
skip: a boolean indicating if autodoc will skip this member if the user handler does not override the decision
options: the options given to the directive: an object with attributes inherited_members, undoc_members,
show_inheritance and noindex that are true if the flag option of same name was given to the auto directive
"""
if name == "__init__":
return False
return skip

def setup(app):
# Define which methods are skipped when running autodoc
# on a member
app.connect("autodoc-skip-member", skip)

0 comments on commit f080956

Please sign in to comment.