Add something like this to conf.py:
import re def process_docstring(app, what, name, obj, options, lines): spaces_pat = re.compile(r"( {8})") ll = [] for l in lines: ll.append(spaces_pat.sub(" ",l)) lines[:] = ll def setup(app): app.connect('autodoc-process-docstring', process_docstring)
See also the Sphinx Docstring preprocessing documentation.
gieffe
source share