Skip to content

Extra linebreak when autodoc-documented parameter has multi-paragraph output #2098

Open
@cmarqu

Description

@cmarqu

I noticed that when autodoc produces multi-paragraph output in HTML, I get an extra linebreak between the parameter name and the description.
In the following example (which is only indirectly using PST via SBT), stacklevel looks fine, but name has the extra linebreak:

Image

When I run sphinx-build with -vvv, I'm getting

[autodoc] output:
[...]
      :param stacklevel: Which stack level to add the generated tests to. This can be used to make a custom TestFactory wrapper.
      :param name: Passed as ``name`` argument to :func:`cocotb.test`.

                   .. versionadded:: 2.0
[...]

and the resulting HTML is

<li><p><strong>stacklevel</strong> (<em>int</em>) – Which stack level to add the generated tests to. This can be used to make a custom TestFactory wrapper.</p></li>
<li><p><strong>name</strong> (<em>str</em><em> | </em><em>None</em>) – <p>Passed as <code class="docutils literal notranslate"><span class="pre">name</span></code> argument to <a class="reference internal" href="#cocotb.test" title="cocotb.test"><code class="xref py py-func docutils literal notranslate"><span class="pre">cocotb.test()</span></code></a>.</p>
<div class="versionadded">
<p><span class="versionmodified added">Added in version 2.0.</span></p>
</div>
</p></li>

There should be some CSS that removes the extra linebreak.


As a side note, my PR sphinx-themes/sphinx-themes.org#157 could be taken for https://github.com/pydata/pydata-sphinx-theme/tree/main/docs/examples/kitchen-sink and would then show the problem in pure PST.
The current code is not exercising this autodoc feature: https://pydata-sphinx-theme.readthedocs.io/en/stable/examples/kitchen-sink/api.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions