Skip to content

Commit

Permalink
doc: Add modname separator tip for autodoc (refs: sphinx-doc#7841)
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Jun 21, 2020
1 parent 275d93b commit 3440f86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions doc/usage/extensions/autodoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions sphinx/directives/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3440f86

Please sign in to comment.