3.2.1.6. sphinx.ext.autodoc.cut_lines

sphinx.ext.autodoc.cut_lines(pre, post=0, what=None)[source]

Return a listener that removes the first pre and last post lines of every docstring. If what is a sequence of strings, only docstrings of a type in what will be processed.

Use like this (e.g. in the setup() function of conf.py):

from sphinx.ext.autodoc import cut_lines
app.connect('autodoc-process-docstring', cut_lines(4, what=['module']))

This can (and should) be used in place of :confval:`automodule_skip_lines`.