diff --git a/doc/usage/extensions/autodoc.rst b/doc/usage/extensions/autodoc.rst index ec1d6c9b559..150b62c4d93 100644 --- a/doc/usage/extensions/autodoc.rst +++ b/doc/usage/extensions/autodoc.rst @@ -280,6 +280,12 @@ inserting them into the page source under a suitable :rst:dir:`py:module`, .. versionadded:: 1.3 + * As a hint to autodoc extension, you can put a ``::`` separator in between + module name and object name to let autodoc know the correct module name if + it is ambiguous. :: + + .. autoclass:: module.name::Noodle + .. rst:directive:: autofunction autodecorator diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index f1f4a341ade..7476f235e7a 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -155,7 +155,7 @@ def run(self) -> List[Node]: literal = nodes.literal_block(code, code) # type: Element if 'linenos' in self.options or 'lineno-start' in self.options: - literal['linenos'] = True + literal['linenos'] = 'inline' literal['classes'] += self.options.get('class', []) literal['force'] = 'force' in self.options if self.arguments: @@ -442,7 +442,7 @@ def run(self) -> List[Node]: retnode['language'] = self.options['language'] if ('linenos' in self.options or 'lineno-start' in self.options or 'lineno-match' in self.options): - retnode['linenos'] = True + retnode['linenos'] = 'inline' retnode['classes'] += self.options.get('class', []) extra_args = retnode['highlight_args'] = {} if 'emphasize-lines' in self.options: