0

I want to write some documentation in the module which should be at one point of my documentation. At this point I don't want to document all the classes/members of the module. This can be easily done with

..automodule:: myModule
  :no-members:

However, at another point of my documentation I want to document all the classes of myModule. I could do this with

..automodule:: myModle
  :members:
  :noindex:

Unfortunately, this also includes the documentation of the module itself which I already have in my documentation and which I don't want to have here, again.

Is there a way to show only the documentation of all the members of myModule but not the documentation of myModule itself without having to list all the members manually?

barryhunter
  • 20,886
  • 3
  • 30
  • 43
Thomas
  • 1,277
  • 1
  • 12
  • 20
  • This might help: http://stackoverflow.com/a/18031024/407651 – mzjn Mar 11 '15 at 19:59
  • possible duplicate of [Exclude module docstring in autodoc](http://stackoverflow.com/questions/17927741/exclude-module-docstring-in-autodoc) – mzjn Mar 12 '15 at 13:16
  • The question is closely related to the one mentioned by @mzjn. However, some additional condition in the remove_module_docstring is necessary, as the docstring of the same module has to be removed in one case but not in the other. – Thomas Mar 12 '15 at 15:11

1 Answers1

1

Thanks to the comments I was able to solve the problem. Adding the following lines to conf.py does the trick:

def remove_module_docstring(app, what, name, obj, options, lines):
    if what == "module" and name == "hpclogging.logger" and 'members' in options:
        del lines[:]

def setup(app):
    app.connect("autodoc-process-docstring", remove_module_docstring)
Thomas
  • 1,277
  • 1
  • 12
  • 20