Commit Graph

18690 Commits

Author SHA1 Message Date
François Freitag
5851344934
Merge pull request #9894 from croth1/linkcheck_ignore_docs
linkcheck: Exclude links from matched documents
2021-12-08 21:57:38 +01:00
Christian Roth
10023da895 linkcheck: Exclude links from matched documents 2021-12-08 10:01:45 +01:00
Takeshi KOMIYA
471022b6df
Merge pull request #9948 from joukewitteveen/patch-1
doc: Improve autodoc extension example
2021-12-08 02:26:14 +09:00
Jouke Witteveen
e200e7b7c1
doc: Improve autodoc extension example
Enumerations can have aliases, which should be documented as well.
2021-12-06 12:31:09 +01:00
James Knight
75914c67c7 drop translator-specific unknown_visit calls
Removes the need for various translators from raising a
`NotImplementedError` exception when missing support for a specific node
type. docutils will already raise [1][2] a `NotImplementedError`
exception for these cases. This help reduce the implementation inside
Sphinx as well as prevents the possible undesired replication of
unknown-node handling with third-party extensions [3].

In most cases, generating a warning message for an unsupported node type
can be preferred. Providing an indication that a node is not supported
can be easier for a user of Sphinx to understand a limitation of a
builder over a generic "not implemented" exception. This commit takes
the logging call which is already used by `texinfo` and applies it to
the `SphinxTranslator` base class -- which any Sphinx translator
implementation can use.

[1]: https://repo.or.cz/docutils.git/blob/d169015ee0f412cffd69b33654d8a119d99bc0f3:/docutils/nodes.py#l2048
[2]: https://repo.or.cz/docutils.git/blob/53716a13b48128af6045139d3cd2909f61e7ed8e:/docutils/nodes.py#l1897
[3]: https://github.com/sphinx-doc/sphinx/issues/9921

Signed-off-by: James Knight <james.d.knight@live.com>
2021-12-05 15:03:57 -05:00
James Knight
334bdceeff tox: support coverage on win32
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>
2021-12-05 14:24:14 -05:00
Jakob Lykke Andersen
3ae124f8ac
Merge pull request #9918 from jakobandersen/c-cpp-fundamental-type-permutation
C, C++: fundamental type parsing
2021-12-05 11:32:56 +01:00
Takeshi KOMIYA
edd14783f3
Merge pull request #9938 from sphinx-doc/bot/pull-translations
Update message catalogs
2021-12-05 16:00:15 +09:00
tk0miya
49a31b71aa Update message catalogs 2021-12-05 00:12:09 +00:00
Takeshi KOMIYA
9ba5e68315
Merge pull request #9937 from spaceofmiah/patch-1
Fixes statement typo
2021-12-05 01:55:50 +09:00
Agbonze Osazuwa
6f4280c0a3
Fixes statement typo 2021-12-04 13:13:17 +01:00
Takeshi KOMIYA
be7313348c
Merge pull request #9929 from jakobandersen/pre_line_wrap
Prevent line wrapping in literals
2021-12-04 15:39:50 +09:00
Takeshi KOMIYA
86639b7be9
Merge pull request #9852 from astrojuanlu/new-tutorial-deploying
New Sphinx tutorial, part IV
2021-12-04 12:02:23 +09:00
Takeshi KOMIYA
85efe39c55
Merge pull request #9910 from kianmeng/fix-typos
Fix typos
2021-12-04 11:46:13 +09:00
Takeshi KOMIYA
4d176d4564
Merge pull request #9928 from joukewitteveen/patch-1
doc: Fix autodoc extension example
2021-12-04 11:08:46 +09:00
Takeshi KOMIYA
c71ff1cd21 Close #9075: autodoc: Add a config variable autodoc_unqualified_typehints
If autodoc_unqualified_typehints feature enabled, autodoc suppresses the
leading module names of typehints of function signatures (ex.
`io.StringIO` -> `StringIO`)
2021-12-03 18:05:49 +09:00
Takeshi KOMIYA
5aa6cbbca8 Add unqualified_typehints parameter to stringify_signature()
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.
2021-12-03 18:05:49 +09:00
Takeshi KOMIYA
80f79aef91 Add smartref parameter to sphinx.util.typing:stringify()
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.
2021-12-03 18:05:49 +09:00
Jakob Lykke Andersen
aabf772722 Prevent literal line wrapping 2021-12-02 18:01:27 +01:00
Jouke Witteveen
bc849e2170
doc: Fix autodoc extension example
`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.
2021-12-02 16:50:09 +01:00
Jakob Lykke Andersen
f8f26286ad C, simple type specifier parsing, handling macro-keywords 2021-12-01 19:33:23 +01:00
Jakob Lykke Andersen
c09643c21f C, fix parsing of fundamental types
When multiple simple type specifiers are part of the type,
then they may appear in any order.
2021-11-30 22:00:54 +01:00
Jakob Lykke Andersen
67d673406f C++, fix parsing of fundamental types
When multiple simple type specifiers are part of the type,
then they may appear in any order.
2021-11-30 22:00:20 +01:00
Jakob Lykke Andersen
355147e893 C++, fix typo in internal function 2021-11-30 21:59:24 +01:00
Jakob Lykke Andersen
17dfa81107
Merge pull request #9914 from jakobandersen/cpp-typo
Fix typo in C++ domain
2021-11-30 18:59:50 +01:00
Jakob Lykke Andersen
ed79004e42 C++, fix typo in internal function 2021-11-30 18:35:39 +01:00
Kian-Meng, Ang
5161341b3e Fix typos 2021-11-30 05:48:44 +08:00
Takeshi KOMIYA
e188d38e9d
Merge pull request #9908 from tk0miya/remove_debug_print
Fix autodoc: Remove debug print
2021-11-30 02:03:28 +09:00
Takeshi KOMIYA
5eaed2bed7 py domain: Allow "~" prefix as a prefix of typehints in signature
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`).
2021-11-30 01:54:23 +09:00
Takeshi KOMIYA
a3edc982c1
Merge pull request #9902 from tk0miya/9899_pydomain_crossref_specifier_in_typefield
Fix #9899: py domain: Allows cross-reference specifier to :type: option
2021-11-30 01:43:51 +09:00
Takeshi KOMIYA
4f622f33d4
Merge pull request #9906 from tk0miya/9800_extlinks_adjust_priority
extlinks: Adjust priority (refs: #9800)
2021-11-30 01:38:54 +09:00
Takeshi KOMIYA
c115eb5ea7
Merge branch '4.x' into remove_debug_print 2021-11-30 01:38:18 +09:00
Takeshi KOMIYA
e8e45a3678
Merge pull request #9905 from tk0miya/9883_ismock
Fix #9883: autodoc: doccomment for the alias to mocked object was ignored
2021-11-30 01:37:41 +09:00
Takeshi KOMIYA
e25589ca1d
Merge branch '4.x' into 9899_pydomain_crossref_specifier_in_typefield 2021-11-30 01:37:04 +09:00
Takeshi KOMIYA
3812a42942 extlinks: Adjust priority (refs: #9800) 2021-11-29 10:11:36 +09:00
Takeshi KOMIYA
472abb0876 Update CHANGES 2021-11-29 10:11:14 +09:00
Takeshi KOMIYA
8dc095e7c1 Fix autodoc: Remove debug print
A message is shown on building document using NewTypes with Python
3.10.
2021-11-29 10:11:14 +09:00
Takeshi KOMIYA
a7462d57b4
Merge pull request #9907 from tk0miya/9800_fix_lint_error
Fix flake8 and isort errors (refs: #9800)
2021-11-29 10:10:42 +09:00
Takeshi KOMIYA
558f54a2b4 Fix flake8 and isort errors (refs: #9800) 2021-11-29 09:42:20 +09:00
Takeshi KOMIYA
3fa146078b Sort CHANGES entries 2021-11-29 09:38:18 +09:00
Takeshi KOMIYA
74d912133a
Merge pull request #9800 from hoefling/extlinks/replacements-check
Proposal: check if hardcoded URLs can be replaced with extlinks
2021-11-29 09:36:55 +09:00
Juan Luis Cano Rodríguez
f6a3d037f4
Remove note to simplify message 2021-11-28 19:58:30 +01:00
Takeshi KOMIYA
f88ac53e51 Fix #9883: autodoc: doccomment for the alias to mocked object was ignored 2021-11-29 02:06:16 +09:00
Takeshi KOMIYA
acaf70596e Fix #9899: py domain: Allows cross-reference specifier to :type: option 2021-11-29 00:32:56 +09:00
Takeshi KOMIYA
f8420c7787
Merge pull request #9901 from tk0miya/label_for_transifex_pr
Add i18n label to weekly transifex PR
2021-11-28 13:42:01 +09:00
Takeshi KOMIYA
17422d2227 Add i18n label to weekly transifex PR 2021-11-28 13:27:36 +09:00
Takeshi KOMIYA
f4181e79d0
Merge pull request #9900 from tk0miya/docutils-0.18.1
test: Try to import nodes.meta first (for the latest docutils)
2021-11-28 13:22:50 +09:00
Takeshi KOMIYA
4236017a3d
Merge pull request #9898 from sphinx-doc/bot/pull-translations
Update message catalogs
2021-11-28 13:05:06 +09:00
Takeshi KOMIYA
17467b7ae2 test: Try to import nodes.meta first (for the latest docutils) 2021-11-28 13:01:50 +09:00
tk0miya
15c506b86b Update message catalogs 2021-11-28 00:11:57 +00:00