pythonpython-sphinxrestructuredtextsphinx-napoleon

Text outside parameters section in sphinx


I am writing documentation for my function using napoleon syntax. I would like to have a paragraph after my parameter list in the docs. The docs currently look like this:

def x(a):
    """
    A sample function.

    A sample blurb before.

    Parameters
    ==========
    a : str
        The input parameter

    A paragraph after.
    """
    return a

The docs are currently rendered (using the RTD theme) as

x(a)

A sample function.

A sample blurb before.

Parameters          * a(str) - The input parameter
                              * paragraph after(A) -

What I would like to see is

x(a)

A sample function.

A sample blurb before.

Parameters          * a(str) - The input parameter

A paragraph after.

How do I tell sphinx/napoleon/rST to break out of the Parameters section?


Solution

  • It appears that what I have in the Parameters section is a definition list. To mark the end of the list, two blank lines are necessary to avoid confusion, since reST allows for blank lines in a definition list:

    def x(a):
        """
        A sample function.
    
        A sample blurb before.
    
        Parameters
        ==========
        a : str
            The input parameter
    
    
        A paragraph after.
        """
        return a