Skip to content

error if a docstring ends in () #1626

@shimizukawa

Description

@shimizukawa

With sphinx-apidoc generated module documentation, when the first line of a docstring includes two or more (), the HTML output is malformed:

dotfiles_status() -- print dotfiles_status()

There's probably a feature here that I'm unintentionally utilizing. Is there a greedy match for a manual override of argdocs in the first line of a docstring?

conf.py

#!python
extensions = [
    'sphinx.ext.autodoc',
]

Examples:

#!python

def dotfiles_status(self, line):
    """dotfiles_status()  -- print dotfiles_status()"""
    pass
#!python

def dotfiles_status(self, line):
    """
    dotfiles_status()  -- print dotfiles_status()"""
    pass
#!python

def dotfiles_status(self, line):
    """
    dotfiles_status()  -- print dotfiles_status()
    """
    pass
#!python

def dotfiles_status(self, line):
    """
    dotfiles_status()  -- print dotfiles_status()
    .
    """
    pass

With an initial period in the first line containing text, or a terminal period, the output looks correct (does not break the output):

#!python
def dotfiles_status(self, line):
    """
    .
    dotfiles_status()  -- print dotfiles_status()
    """
    pass
#!python
def dotfiles_status(self, line):
    """
    dotfiles_status()  -- print dotfiles_status() .
    """
    pass

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions