Parameters are uppercased when rendering doc-strings with Numpydoc #296
-
When using the Sphinx extension Numpydoc alongside Autodoc to render NumPy-style doc-strings, parameter names and their types appear in uppercase on the page, regardless of how they are defined in the code. To reproduce, create this extensions = ['sphinx.ext.autodoc', 'numpydoc']
html_theme = 'furo'
import sys
sys.path.insert(0, '.') this .. automodule:: module
:members: and this def function(index, text):
"""
Doc-string with parameter list in NumPy style.
Parameters
----------
index: int
An index number.
text : str
Some text.
""" Then run The parameter names and types are in all-caps, which is probably not intended, given how confusing that might be in API documentation. The reason seems to be that the CSS selector <dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>index: int</strong></dt>
<dd><p>An index number.</p></dd>
<dt><strong>text</strong><span class="classifier">str</span></dt>
<dd><p>Some text.</p></dd>
</dl></dd></dl> Instead of Numpydoc, we can also render Numpy-style doc-strings with Napoleon, simply by replacing <dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>index</strong> (<em>int</em>) – An index number.</p></li>
<li><p><strong>text</strong> (<em>str</em>) – Some text.</p></li>
</ul></dd></dl> Tested with Furo 2021.10.9, Numpydoc 1.1.0, Sphinx 4.2.0. See also:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Fixed in 20a83d1, I think. Can you |
Beta Was this translation helpful? Give feedback.
Fixed in 20a83d1, I think.
Can you
pip install https://github.com/pradyunsg/furo/archive/refs/heads/main.zip
and confirm whether that fix works?