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``.
Revert b32841e153
to fix parallel search index building
The image-related changes were already reverted in
2a7c40d07f,
but the search index changes also need to be reverted.
It would be nice to support parallel search index building, but the
necessary support for merging the search indices produced by each
process needs to be added first.
The current ``github.head_ref || github.run_id`` syntax only cancels
in-progress GitHub Actions runs triggered by pull requests, as
``head_ref`` is only defined for pull requests, and ``run_id`` is
always unique. This changes to using ``ref``, which is the name of
the branch or tag linked to the commit, meaning that in-progress jobs
will be cancelled on pushes to a branch.
Tests for Sphinx's CLIs, like test_apidoc, indirectly init_console to
initialize translations for Sphinx's console domain, the one with
Sphinx's log messages. This bleeds over subsequent tests by making
warnings translated. Fix this by skipping init_console when running
Sphinx's test suite.