As one of the comment suggested, sphinx-epytext
does provides the relevant support. How it worked for me:
Installing it is very easy:
pip install -U sphinx-epytext
It contains one file process_docstring.py
that converts the epytext markups to reStructuredText markups by replacing @
with colon :
.
Some of the fields I found missing in there were: ivar, var, cvar, vartype
Simply extend the existing list FIELDS
in there:
FIELDS.extend(['ivar', 'var', 'cvar', 'vartype'])
Epytext understands @type
for variables, but sphinx understands :vartype
.
To fix that, replace the former ones with later ones inside process_docstring
method.
Most of the syntax or docstring parts that Sphinx can't comprehend are reported as Warnings. You can log these warnings by running sphinx-build
with -w <WarningLogFile>
. As per my experience with it, Sphinx is very sensitive about how a field should start or end, missing-formatting-syntax, etc.