Open anntzer opened 7 years ago
Ok, yeah this makes sense. I can add a conf flag to choose how exceptions are rendered. I'll probably have time to get to it this weekend.
Would you accept a patch that unconditionally changes the format to the documented one? That, I can do...
Sure, I think that would be a big help. I may end up modifying your patch to add the conf flag. Either way a patch would be a great help.
What should be the output for this old test case?
("""
Example Function
Raises:
Invalid Dimensions Error
""", """
Example Function
:raises: Invalid Dimensions Error
"""),
(i.e., how to handle spaces in field name).
Subject: docstrings parsed by sphinx.ext.napoleon use a subtly different markup for documented exceptions.
Problem
(see subject)
Procedure to reproduce the problem
http://www.sphinx-doc.org/en/stable/domains.html?highlight=domains#info-field-lists indicates that exceptions should be documented as
but sphinx.ext.napoleon (whether Google or Numpy style) uses a different markup:
Expected results
sphinx.ext.napoleon should generate markup similar to the default one. In particular, the current output uses the
:exc:
interpreted text role, which is only defined by sphinx's python domain, and thus not interpretable by docutils without using sphinx. This is specifically more relevant for projects which would like to parse google/numpy docstrings e.g. with sphinxcontrib.napoleon then feed the results into docutils themselves, without needing sphinx itself (e.g., http://defopt.readthedocs.io/en/latest/).Reproducible project / your project
N/A
Environment info