summaryrefslogtreecommitdiff
path: root/sphinx/ext/ifconfig.py
Commit message (Collapse)AuthorAgeFilesLines
* Add ``content_offset`` parameter to ``nested_parse_with_titles`` (#11147)Jeremy Maitin-Shepard2023-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Previously, ``nested_parse_with_titles`` always passed ``0`` as the input offset when invoking ``nested_parse``. When parsing the content of a directive, as is a common use case for ``nested_parse_with_titles``, this leads to incorrect source file/line number information, as it does not take into account the directive's ``content_offset``, which is always non-zero. This issue affects *all* object descriptions due to GH-10887. It also affects the ``sphinx.ext.ifconfig`` extension. The ``py:module`` and ``js:module`` directives employed a workaround for this issue, by wrapping the calls to ``nested_parse_with_title`` with ``switch_source_input``. That worked, but was more complicated (and likely less efficient) than necessary. This commit adds an optional ``content_offset`` parameter to ``nested_parse_with_titles``, and fixes callers to pass the appropriate content offset when needed. This commit eliminates the now-unnecessary calls to ``switch_source_input`` and instead specifies the correct ``content_offset``.
* Use PEP 595 typesAdam Turner2023-01-011-3/+3
|
* Insert ``from __future__ import annotations``Adam Turner2023-01-011-0/+2
|
* Enable Ruff's pygrep-hooks checksAdam Turner2022-12-291-1/+1
|
* ifconfig: Do not use a meta node for noopTakeshi KOMIYA2022-06-031-3/+2
|
* Add a meta node to fix iterationAdam Turner2022-05-311-1/+2
|
* Remove copyright and licence fieldsAdam Turner2022-02-201-3/+0
|
* Conform to PEP 257 summary line conventionsAdam Turner2022-02-201-1/+3
|
* Fix module docstring indentationAdam Turner2022-02-201-9/+9
|
* Fix module docstring first lineAdam Turner2022-02-201-2/+1
|
* Remove module titles in docstringsAdam Turner2022-02-191-3/+0
|
* Migrate to Node.findall() from Node.traverse()Takeshi KOMIYA2022-01-031-1/+1
| | | | | | | | 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.
* A happy new year!Takeshi KOMIYA2022-01-011-1/+1
|
* refactor: Add a type alias for the option_spec of directives; OptionSpecTakeshi KOMIYA2021-03-131-1/+2
|
* 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
* fix typoTetsuo Koyama2020-07-191-1/+1
|
* A happy new year!Takeshi KOMIYA2020-01-011-1/+1
|
* Migrate to py3 style type annotation: sphinx.ext.ifconfigTakeshi KOMIYA2019-07-041-11/+7
|
* Fix #6213: ifconfig: contents after headings are not shownTakeshi KOMIYA2019-04-051-2/+2
|
* Python-3-only clean ups discovered by pyupgradeJon Dufresne2019-03-171-1/+1
| | | | | | | | | | | | | | https://github.com/asottile/pyupgrade > A tool to automatically upgrade syntax for newer versions of the > language. - Drop u str prefix - Drop base object inheritance - Drop args to super() - Use set literals - Use dict comprehension - Use set comprehension
* Add a helper method ``SphinxDirective.set_source_info()``Takeshi KOMIYA2019-03-031-2/+1
|
* Merge branch '1.8'Takeshi KOMIYA2019-01-021-1/+1
|\
| * A happy new year!Takeshi KOMIYA2019-01-021-1/+1
| |
* | Remove unnecessary encoding cookie from Python source filesJon Dufresne2018-12-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Python 3, the default encoding of source files is utf-8. The encoding cookie is now unnecessary and redundant so remove it. For more details, see the docs: https://docs.python.org/3/howto/unicode.html#the-string-type > The default encoding for Python source code is UTF-8, so you can > simply include a Unicode character in a string literal ... Includes a fix for the flake8 header checks to stop expecting an encoding cookie.
* | Replace all "unicode" type by "str"Takeshi KOMIYA2018-12-151-3/+2
| |
* | Fix annotations for Directives (Replace N_co with nodes.Node)Takeshi KOMIYA2018-12-011-3/+3
| |
* | Fix annotations for minor methods and functionsTakeshi KOMIYA2018-11-301-2/+2
| |
* | Fix annotaions for extensionsTakeshi KOMIYA2018-11-281-1/+1
| |
* | Add sphinx.util.typing:unicode to help mypy-3 migrationTakeshi KOMIYA2018-11-241-0/+1
|/
* refactor: Replace Directive by SphinxDirectiveTakeshi KOMIYA2018-05-111-2/+2
|
* Fix mypy violationsTakeshi KOMIYA2018-03-241-1/+1
|
* Revert "Use typing.TYPE_CHECKING for typehints"Takeshi KOMIYA2018-03-131-3/+2
| | | | This reverts commit a073e17537c2aacaac305feadea58d4473ec97f4.
* Use typing.TYPE_CHECKING for typehintsTakeshi KOMIYA2018-02-141-2/+3
|
* A happy new year!Takeshi KOMIYA2018-01-011-1/+1
|
* Update type annotations for new mypyTakeshi KOMIYA2017-05-071-1/+1
|
* Merge branch 'stable'Takeshi KOMIYA2017-03-261-1/+1
|\
| * Year++Takeshi KOMIYA2017-03-261-1/+1
| |
* | Upgrade to mypy-0.5Takeshi KOMIYA2017-03-031-1/+1
| |
* | Remove unused "type: ignore"Takeshi KOMIYA2017-02-061-1/+1
| |
* | Fix mypy violationsTakeshi KOMIYA2017-01-191-1/+1
| |
* | Add __iter__(), add() and filter() to Config classTakeshi KOMIYA2017-01-171-1/+1
| |
* | ``sphinx.util.compat.Directive`` class is now deprecated.Takeshi KOMIYA2016-12-131-1/+1
| |
* | Add type-check annotations to sphinx.extTakeshi KOMIYA2016-11-161-3/+11
|/
* Obligatory copyright update.Georg Brandl2016-01-141-1/+1
|
* Support PEP-440 version spec for developers.shimizukawa2015-03-141-1/+1
|
* ext: pep8 fixesGeorg Brandl2015-03-081-1/+2
|
* Closes #1748: SyntaxError in sphinx/ext/ifconfig.py with Python 2.6.shimizukawa2015-03-021-1/+1
|
* Merge branch 'stable'shimizukawa2015-01-171-1/+2
|\
| * Fixes #1686: ifconfig directive doesn't care about default config values.shimizukawa2015-01-171-1/+2
| |
* | Merge branch 'stable'Georg Brandl2015-01-031-1/+1
|\ \ | |/