summaryrefslogtreecommitdiff
path: root/sphinx/util/docutils.py
Commit message (Collapse)AuthorAgeFilesLines
* refactor: Add CustomReSTDispatcher as a base class of custom dispatchersTakeshi KOMIYA2022-01-161-14/+37
| | | | | To create custom reST dispatcher easily, this adds CustomReSTDispatcher class as a base class of custom dispatchers.
* Migrate to Node.findall() from Node.traverse()Takeshi KOMIYA2022-01-031-0/+10
| | | | | | | | Node.traverse() was marked as deprecated since docutils-0.18. Instead of it, Node.findall() has been added as successor of traverse(). This applies a patch to docutils-0.17 or older to be available Node.findall() and use it.
* Merge branch '4.3.x' into 4.xTakeshi KOMIYA2022-01-011-1/+1
|\
| * A happy new year!Takeshi KOMIYA2022-01-011-1/+1
| |
* | drop translator-specific unknown_visit callsJames Knight2021-12-051-1/+4
|/ | | | | | | | | | | | | | | | | | | | | | | 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>
* Replace distutils.versions.LooseVersion by packaging.version.VersionTakeshi KOMIYA2021-11-071-2/+2
| | | | | | | Distutils module are now deprecated and will be removed in Python 3.12. This replaces it by packaging module and reduces the dependency to it. refs: #9820
* Fix typos discovered by codespellChristian Clauss2021-09-081-2/+2
|
* Fix #9481: autosummary: some warnings contain non-existing filenamesTakeshi KOMIYA2021-07-251-0/+8
| | | | | | | | | | | | | | `SphinxDirective.get_source_info()` returns the pair of fullpath of source and current line number. But our logging module expects one of these: * A string consists of fullpath and current line number * A pair of docname and current line number To show correct location for warnings, this adds `get_location()` method that returns the former one. Note: This also modifies C/C++ domains.
* refactor: Add Optional to type annotationsTakeshi KOMIYA2021-05-031-4/+4
|
* refactor: use raw Type for type annotationsTakeshi KOMIYA2021-04-041-6/+6
|
* refactor: Use PEP-526 based variable annotation (sphinx.util)Takeshi KOMIYA2021-03-101-4/+4
|
* Merge branch '3.x'Takeshi KOMIYA2021-01-011-1/+1
|\
| * A happy new year!Takeshi KOMIYA2021-01-011-1/+1
| | | | | | | | | | | | | | .. note:: $ find sphinx tests LICENSE doc/conf.py -type f -exec sed -i '' -e 's/2007\-20../2007-2021/' {} \; $ git co sphinx/locale/**/*.js sphinx/templates/epub3/mimetype
* | Merge branch '3.x'Takeshi KOMIYA2020-11-121-3/+3
|\ \ | |/
| * Sort imports with isortFrançois Freitag2020-11-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Keep imports alphabetically sorted and their order homogeneous across Python source files. The isort project has more feature and is more active than the flake8-import-order plugin. Most issues caught were simply import ordering from the same module. Where imports were purposefully placed out of order, tag with isort:skip.
* | Fix #8342: Emit a warning if a unknown domain is given for directive or role8342_warning_for_unknown_domainTakeshi KOMIYA2020-10-281-0/+3
| | | | | | | | | | | | | | | | Currently, Sphinx mention nothing if users use unknown domain in their documents (ex. `.. unknown:directive::`, `:unknown:role` and so on). This starts to warn them to be clear non acceptable mark-ups. refs: #8342
* | Merge branch '3.x'Takeshi KOMIYA2020-08-011-1/+1
|\ \ | |/
| * Fix typoFabio Utzig2020-07-271-1/+1
| | | | | | | | Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
* | Merge branch '3.x'Takeshi KOMIYA2020-07-241-1/+1
|\ \ | |/
| * fix typoTetsuo Koyama2020-07-191-1/+1
| |
* | Merge branch '3.x'Takeshi KOMIYA2020-07-111-1/+2
|\ \ | |/
| * Fix #7619: Duplicated node IDs are generated if node has multiple IDsTakeshi KOMIYA2020-07-091-1/+2
| |
* | refactor: Update type annotationsTakeshi KOMIYA2020-05-021-15/+15
| |
* | Merge branch '3.x'Takeshi KOMIYA2020-04-061-0/+4
|\ \ | |/
| * Fix #6477: Escape first "!" in a cross reference linking no longer possibleTakeshi KOMIYA2020-03-281-0/+4
| |
* | Merge branch '3.x'Takeshi KOMIYA2020-03-231-4/+0
|\ \ | |/
| * Merge branch '2.x' into 3.xTakeshi KOMIYA2020-03-221-4/+0
| |\
| | * Fix #7343: Sphinx builds has been slower since 2.4.0 on debug modeTakeshi KOMIYA2020-03-201-4/+0
| | | | | | | | | | | | | | | For now, the debug log from SphinxTranslator does not help developers. So this disable the log outputs. Let's reconsider if we'll need it.
* | | Merge branch '3.x'Takeshi KOMIYA2020-03-211-4/+9
|\ \ \ | |/ /
| * | C and C++ domains, change to new loggingJakob Lykke Andersen2020-03-171-4/+9
| | | | | | | | | | | | Also add get_source_info() to SphinxDirective and SphinxRole
* | | Hello TYPE_CHECKING!Takeshi KOMIYA2020-03-071-3/+2
| | |
* | | Deprecate codes for python 3.5Takeshi KOMIYA2020-03-071-2/+1
|/ /
* | Merge branch '2.x' into 3.xTakeshi KOMIYA2020-03-011-4/+4
|\ \ | |/
| * Fix #7223: Sphinx builds has been slower since 2.4.0Takeshi KOMIYA2020-02-291-4/+4
| |
* | refactor: Update type annotations in sphinx.util.*Takeshi KOMIYA2020-02-231-4/+6
| |
* | Merge branch '2.0'Takeshi KOMIYA2020-01-191-1/+40
|\ \ | |/
| * SphinxTranslator calls visitor/departure method for super node classTakeshi KOMIYA2020-01-101-1/+40
| |
* | Merge branch '2.0'Takeshi KOMIYA2020-01-011-2/+2
|\ \ | |/
| * A happy new year!Takeshi KOMIYA2020-01-011-1/+1
| |
| * mypy: Enable disallow_incomplete_defs flag for type checkingTakeshi KOMIYA2019-12-301-2/+4
| |
* | Merge branch '2.0'Takeshi KOMIYA2019-11-171-2/+1
|\ \ | |/
| * Don't return False always on __exit__()Takeshi KOMIYA2019-10-201-2/+1
| | | | | | | | | | | | | | | | According to the python/mypy#7214, mypy-0.740 prefers a return value of __exit__() method which does not swallow exceptions is None instead of bool. mypy#7214: https://github.com/python/mypy/issues/7214
* | Merge branch '2.0'Takeshi KOMIYA2019-10-201-1/+1
|\ \ | |/
| * Fix mypy violations (for mypy-0.740)Takeshi KOMIYA2019-10-201-1/+1
| |
* | Merge branch '2.0'Takeshi KOMIYA2019-10-061-8/+8
|\ \ | |/
| * Fix mypy violations (for mypy-0.730)Takeshi KOMIYA2019-10-061-8/+8
| |
* | Merge branch '2.0'jfbu2019-08-011-7/+8
|\ \ | |/
| * Fix type annotation for python 3.5.1Takeshi KOMIYA2019-07-131-7/+8
| |
* | Merge branch '2.0'Takeshi KOMIYA2019-07-131-8/+8
|\ \ | |/
| * Merge branch '2.1.3' into 2.0Takeshi KOMIYA2019-07-131-8/+8
| |\