The CR character was added for readability of output. But it makes the
texinfo writer a bit complicated. This removes it from output to keep
our code simple (reducing conditions).
Fix#9940
Avoid \pysiglinewithargsret tricks to get correct vertical spacing
in multiline declarations in case mark-up inserts a \phantomsection.
Activate such tricks also in \pysigline, but now with the
\phantomsection test.
Relates #7241, #8980, #8995
Whether or not to allow linebreaks is matter of debate because user of
pdf can not reflow the displayed text, and overfull lines may lead to
loss of data beyond page border.
Since Sphinx 1.5, inline literals allow linebreaks after the characters
".", ",", ";", "?", "!", "/" and "\" (cf the inlineliteralwraps key of
latex_elements['sphinxsetup']).
With pdflatex the dash "-" does not allow a linebreak when used with a
monospace font (btw the dash is escaped to \sphinxhyphen{} which expands
back to a dash). But this failed with xelatex, so previous commits
ensured nobreak behaviour by redefining \sphinxhyphen to be
\sphinxhyphennobreak when encountered in inline and parsed literals.
This commit adds \sphinxhyphenin{inline,parsed}literal macros which
default to \sphinxhyphennobreak and thus allow to customize how the
dashes from sources will behave in such contexts in pdf output.
It seems docutils does not fill the topic node with the source info when
a topic directive has a bullet list. As a workaround, This fills the
source info of them.
When invoking the `coverage` on a Windows environment, the following
exception may generate:
...
raise CoverageException(f"Couldn't read {fname!r} as a config file")
coverage.exceptions.CoverageException: Couldn't read 'C:mycodesphinx/setup.cfg' as a config file
ERROR: InvocationError for command 'C:\mycode\sphinx\.tox\coverage\Scripts\python.EXE' -X dev -m pytest --durations 25 (exited with code 1)
Enclosing with configuration file with quotes can improve the handling
of a provided path on multiple platform types.
Signed-off-by: James Knight <james.d.knight@live.com>
If autodoc_unqualified_typehints feature enabled, autodoc suppresses the
leading module names of typehints of function signatures (ex.
`io.StringIO` -> `StringIO`)
To make the generated function signatures simple, this adds a new
parameter `unqualified_typehints` to sphinx.util.inspect:
stringify_signature() to suppress the leading module name of
typehints.
To make the generated function signatures simple, this adds a new
parameter `smartref` to sphinx.util.typing:stringify() to suppress the
leading module name from typehints.
`directivetype` is set to mimic `ClassDocumenter`. Reflect that.
`isinstance` would work on the enum members, but that is not what we want here.
`issubclass` raises a TypeError when called on objects that are not classes.
Now python domain supports the "~" prefix at the beginning of the
typehints of the function signatures:
.. py:function:: func(x: ~typing.Dict)
It's rescognized as the same as python reference roles do
(ex. :py:class:`~typing.Dict`).