summaryrefslogtreecommitdiffstats
path: root/tests/roots
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:57:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:57:07 +0000
commit46fc0a4b3dccce58c429f408c04cf5cda3af9fb5 (patch)
tree410d83c434319e0c6f8035cdfa60ae8957b1d909 /tests/roots
parentAdding upstream version 7.3.7. (diff)
downloadsphinx-46fc0a4b3dccce58c429f408c04cf5cda3af9fb5.tar.xz
sphinx-46fc0a4b3dccce58c429f408c04cf5cda3af9fb5.zip
Adding upstream version 7.4.7.upstream/7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/roots')
-rw-r--r--tests/roots/test-add_source_parser-conflicts-with-users-setting/conf.py5
-rw-r--r--tests/roots/test-add_source_parser/conf.py1
-rw-r--r--tests/roots/test-autosummary/conf.py2
-rw-r--r--tests/roots/test-build-text/conf.py4
-rw-r--r--tests/roots/test-domain-py-python_maximum_signature_line_length/index.rst13
-rw-r--r--tests/roots/test-domain-py/index.rst1
-rw-r--r--tests/roots/test-domain-py/module.rst3
-rw-r--r--tests/roots/test-domain-py/roles.rst6
-rw-r--r--tests/roots/test-domain-py/type_alias.rst15
-rw-r--r--tests/roots/test-ext-autodoc/conf.py3
-rw-r--r--tests/roots/test-ext-autodoc/target/annotated.py36
-rw-r--r--tests/roots/test-ext-autosummary-import_cycle/conf.py7
-rw-r--r--tests/roots/test-ext-autosummary-import_cycle/index.rst6
-rw-r--r--tests/roots/test-ext-autosummary-import_cycle/spam/__init__.py1
-rw-r--r--tests/roots/test-ext-autosummary-import_cycle/spam/eggs.py10
-rw-r--r--tests/roots/test-ext-autosummary-module_prefix/conf.py8
-rw-r--r--tests/roots/test-ext-autosummary-module_prefix/index.rst5
-rw-r--r--tests/roots/test-ext-autosummary-module_prefix/pkg/__init__.py0
-rw-r--r--tests/roots/test-ext-autosummary-module_prefix/pkg/mod0/__init__.py0
-rw-r--r--tests/roots/test-ext-autosummary-module_prefix/pkg/mod1/__init__.py0
-rw-r--r--tests/roots/test-ext-autosummary/conf.py3
-rw-r--r--tests/roots/test-ext-coverage/conf.py5
-rw-r--r--tests/roots/test-ext-coverage/grog/__init__.py0
-rw-r--r--tests/roots/test-ext-coverage/grog/coverage_ignored.py (renamed from tests/roots/test-ext-coverage/coverage_ignored.py)0
-rw-r--r--tests/roots/test-ext-coverage/grog/coverage_missing.py7
-rw-r--r--tests/roots/test-ext-coverage/grog/coverage_not_ignored.py (renamed from tests/roots/test-ext-coverage/coverage_not_ignored.py)0
-rw-r--r--tests/roots/test-ext-coverage/index.rst4
-rw-r--r--tests/roots/test-ext-doctest-skipif/conf.py4
-rw-r--r--tests/roots/test-ext-doctest/conf.py4
-rw-r--r--tests/roots/test-html_assets/extra/API.html.jinja (renamed from tests/roots/test-html_assets/extra/API.html_t)0
-rw-r--r--tests/roots/test-html_assets/static/API.html.jinja (renamed from tests/roots/test-html_assets/static/API.html_t)0
-rw-r--r--tests/roots/test-images/index.rst5
-rw-r--r--tests/roots/test-inheritance/conf.py1
-rw-r--r--tests/roots/test-intl/conf.py4
-rw-r--r--tests/roots/test-intl/glossary_terms_inconsistency.txt1
-rw-r--r--tests/roots/test-intl/index.txt1
-rw-r--r--tests/roots/test-intl/markup.txt6
-rw-r--r--tests/roots/test-intl/role_xref.txt3
-rw-r--r--tests/roots/test-intl/xx/LC_MESSAGES/glossary_terms_inconsistency.po3
-rw-r--r--tests/roots/test-intl/xx/LC_MESSAGES/literalblock.po32
-rw-r--r--tests/roots/test-intl/xx/LC_MESSAGES/markup.po25
-rw-r--r--tests/roots/test-latex-figure-in-admonition/conf.py2
-rw-r--r--tests/roots/test-latex-figure-in-admonition/index.rst19
-rw-r--r--tests/roots/test-latex-table/_mytemplates/latex/longtable.tex.jinja (renamed from tests/roots/test-latex-table/_mytemplates/latex/longtable.tex_t)0
-rw-r--r--tests/roots/test-latex-table/_mytemplates/latex/tabulary.tex_t1
-rw-r--r--tests/roots/test-linkcheck-anchors-ignore-for-url/index.rst1
-rw-r--r--tests/roots/test-markup-rubric/conf.py1
-rw-r--r--tests/roots/test-markup-rubric/index.rst32
-rw-r--r--tests/roots/test-root/conf.py7
-rw-r--r--tests/roots/test-root/images.txt8
-rw-r--r--tests/roots/test-root/markup.txt13
-rw-r--r--tests/roots/test-templating/conf.py4
-rw-r--r--tests/roots/test-theming/test_theme/staticfiles/static/legacytmpl.html_t2
-rw-r--r--tests/roots/test-theming/test_theme/staticfiles/static/statictmpl.html.jinja (renamed from tests/roots/test-theming/test_theme/staticfiles/static/statictmpl.html_t)0
-rw-r--r--tests/roots/test-toctree-domain-objects/document_scoping.rst23
-rw-r--r--tests/roots/test-toctree-domain-objects/index.rst1
-rw-r--r--tests/roots/test-util-copyasset_overwrite/conf.py7
-rw-r--r--tests/roots/test-util-copyasset_overwrite/index.rst0
-rw-r--r--tests/roots/test-util-copyasset_overwrite/myext.py22
-rw-r--r--tests/roots/test-util-copyasset_overwrite/myext_static/custom-styles.css1
-rw-r--r--tests/roots/test-util-copyasset_overwrite/user_static/custom-styles.css1
-rw-r--r--tests/roots/test-versioning/conf.py4
62 files changed, 355 insertions, 28 deletions
diff --git a/tests/roots/test-add_source_parser-conflicts-with-users-setting/conf.py b/tests/roots/test-add_source_parser-conflicts-with-users-setting/conf.py
index 3ad5491..5e57901 100644
--- a/tests/roots/test-add_source_parser-conflicts-with-users-setting/conf.py
+++ b/tests/roots/test-add_source_parser-conflicts-with-users-setting/conf.py
@@ -11,7 +11,10 @@ class DummyTestParser(Parser):
extensions = ['source_parser']
-source_suffix = ['.rst', '.test']
+source_suffix = {
+ '.rst': 'restructuredtext',
+ '.test': 'restructuredtext',
+}
source_parsers = {
'.test': DummyTestParser
}
diff --git a/tests/roots/test-add_source_parser/conf.py b/tests/roots/test-add_source_parser/conf.py
index 2acd4d2..ef85560 100644
--- a/tests/roots/test-add_source_parser/conf.py
+++ b/tests/roots/test-add_source_parser/conf.py
@@ -5,4 +5,3 @@ sys.path.insert(0, os.path.abspath('.'))
extensions = ['source_parser']
-source_suffix = ['.rst']
diff --git a/tests/roots/test-autosummary/conf.py b/tests/roots/test-autosummary/conf.py
index 46cf4fa..f459017 100644
--- a/tests/roots/test-autosummary/conf.py
+++ b/tests/roots/test-autosummary/conf.py
@@ -5,8 +5,6 @@ sys.path.insert(0, os.path.abspath('.'))
extensions = ['sphinx.ext.autosummary']
-# The suffix of source filenames.
-source_suffix = '.rst'
autosummary_generate = True
exclude_patterns = ['_build']
diff --git a/tests/roots/test-build-text/conf.py b/tests/roots/test-build-text/conf.py
index fd9eefb..b0fdaf8 100644
--- a/tests/roots/test-build-text/conf.py
+++ b/tests/roots/test-build-text/conf.py
@@ -1,2 +1,4 @@
-source_suffix = '.txt'
+source_suffix = {
+ '.txt': 'restructuredtext'
+}
exclude_patterns = ['_build']
diff --git a/tests/roots/test-domain-py-python_maximum_signature_line_length/index.rst b/tests/roots/test-domain-py-python_maximum_signature_line_length/index.rst
index 75e4683..9715500 100644
--- a/tests/roots/test-domain-py-python_maximum_signature_line_length/index.rst
+++ b/tests/roots/test-domain-py-python_maximum_signature_line_length/index.rst
@@ -4,3 +4,16 @@ domain-py-maximum_signature_line_length
.. py:function:: hello(name: str) -> str
.. py:function:: foo([a, [b, ]]c, d[, e, f])
+
+.. py:function:: generic_arg[T]
+
+.. py:function:: generic_foo[T]()
+
+.. py:function:: generic_bar[T](x: list[T])
+
+.. py:function:: generic_ret[R]() -> R
+
+.. py:class:: MyGenericClass[X]
+
+.. py:class:: MyList[T](list[T])
+
diff --git a/tests/roots/test-domain-py/index.rst b/tests/roots/test-domain-py/index.rst
index b24bbea..71e45f7 100644
--- a/tests/roots/test-domain-py/index.rst
+++ b/tests/roots/test-domain-py/index.rst
@@ -8,3 +8,4 @@ test-domain-py
module_option
abbr
canonical
+ type_alias
diff --git a/tests/roots/test-domain-py/module.rst b/tests/roots/test-domain-py/module.rst
index 70098f6..307e786 100644
--- a/tests/roots/test-domain-py/module.rst
+++ b/tests/roots/test-domain-py/module.rst
@@ -64,3 +64,6 @@ module
.. py:data:: test2
:type: typing.Literal[-2]
+
+.. py:type:: MyType1
+ :canonical: list[int | str]
diff --git a/tests/roots/test-domain-py/roles.rst b/tests/roots/test-domain-py/roles.rst
index 6bff2d2..d3492ce 100644
--- a/tests/roots/test-domain-py/roles.rst
+++ b/tests/roots/test-domain-py/roles.rst
@@ -5,14 +5,19 @@ roles
.. py:method:: top_level
+.. py:type:: TopLevelType
+
* :py:class:`TopLevel`
* :py:meth:`top_level`
+* :py:type:`TopLevelType`
.. py:class:: NestedParentA
* Link to :py:meth:`child_1`
+ .. py:type:: NestedTypeA
+
.. py:method:: child_1()
* Link to :py:meth:`NestedChildA.subchild_2`
@@ -46,3 +51,4 @@ roles
* Link to :py:class:`NestedParentB`
* :py:class:`NestedParentA.NestedChildA`
+* :py:type:`NestedParentA.NestedTypeA`
diff --git a/tests/roots/test-domain-py/type_alias.rst b/tests/roots/test-domain-py/type_alias.rst
new file mode 100644
index 0000000..6a3df44
--- /dev/null
+++ b/tests/roots/test-domain-py/type_alias.rst
@@ -0,0 +1,15 @@
+Type Alias
+==========
+
+.. py:module:: module_two
+
+ .. py:class:: SomeClass
+
+:py:type:`.MyAlias`
+:any:`MyAlias`
+:any:`module_one.MyAlias`
+
+.. py:module:: module_one
+
+ .. py:type:: MyAlias
+ :canonical: list[int | module_two.SomeClass]
diff --git a/tests/roots/test-ext-autodoc/conf.py b/tests/roots/test-ext-autodoc/conf.py
index 979a709..9d1cdc7 100644
--- a/tests/roots/test-ext-autodoc/conf.py
+++ b/tests/roots/test-ext-autodoc/conf.py
@@ -5,9 +5,6 @@ sys.path.insert(0, os.path.abspath('.'))
extensions = ['sphinx.ext.autodoc']
-# The suffix of source filenames.
-source_suffix = '.rst'
-
autodoc_mock_imports = [
'dummy'
]
diff --git a/tests/roots/test-ext-autodoc/target/annotated.py b/tests/roots/test-ext-autodoc/target/annotated.py
index 5b87518..7adc3e0 100644
--- a/tests/roots/test-ext-autodoc/target/annotated.py
+++ b/tests/roots/test-ext-autodoc/target/annotated.py
@@ -1,8 +1,42 @@
-from __future__ import annotations
+# from __future__ import annotations
+import dataclasses
+import types
from typing import Annotated
+@dataclasses.dataclass(frozen=True)
+class FuncValidator:
+ func: types.FunctionType
+
+
+@dataclasses.dataclass(frozen=True)
+class MaxLen:
+ max_length: int
+ whitelisted_words: list[str]
+
+
+def validate(value: str) -> str:
+ return value
+
+
+#: Type alias for a validated string.
+ValidatedString = Annotated[str, FuncValidator(validate)]
+
+
def hello(name: Annotated[str, "attribute"]) -> None:
"""docstring"""
pass
+
+
+class AnnotatedAttributes:
+ """docstring"""
+
+ #: Docstring about the ``name`` attribute.
+ name: Annotated[str, "attribute"]
+
+ #: Docstring about the ``max_len`` attribute.
+ max_len: list[Annotated[str, MaxLen(10, ['word_one', 'word_two'])]]
+
+ #: Docstring about the ``validated`` attribute.
+ validated: ValidatedString
diff --git a/tests/roots/test-ext-autosummary-import_cycle/conf.py b/tests/roots/test-ext-autosummary-import_cycle/conf.py
new file mode 100644
index 0000000..5e889f9
--- /dev/null
+++ b/tests/roots/test-ext-autosummary-import_cycle/conf.py
@@ -0,0 +1,7 @@
+import os
+import sys
+
+sys.path.insert(0, os.path.abspath('.'))
+
+extensions = ['sphinx.ext.autosummary']
+autosummary_generate = False
diff --git a/tests/roots/test-ext-autosummary-import_cycle/index.rst b/tests/roots/test-ext-autosummary-import_cycle/index.rst
new file mode 100644
index 0000000..14e7266
--- /dev/null
+++ b/tests/roots/test-ext-autosummary-import_cycle/index.rst
@@ -0,0 +1,6 @@
+.. automodule:: spam.eggs
+ :members:
+
+ .. autosummary::
+
+ spam.eggs.Ham
diff --git a/tests/roots/test-ext-autosummary-import_cycle/spam/__init__.py b/tests/roots/test-ext-autosummary-import_cycle/spam/__init__.py
new file mode 100644
index 0000000..e94cf4b
--- /dev/null
+++ b/tests/roots/test-ext-autosummary-import_cycle/spam/__init__.py
@@ -0,0 +1 @@
+"""``spam`` module docstring."""
diff --git a/tests/roots/test-ext-autosummary-import_cycle/spam/eggs.py b/tests/roots/test-ext-autosummary-import_cycle/spam/eggs.py
new file mode 100644
index 0000000..12122e8
--- /dev/null
+++ b/tests/roots/test-ext-autosummary-import_cycle/spam/eggs.py
@@ -0,0 +1,10 @@
+"""``spam.eggs`` module docstring."""
+
+import spam # Required for test.
+
+
+class Ham:
+ """``spam.eggs.Ham`` class docstring."""
+ a = 1
+ b = 2
+ c = 3
diff --git a/tests/roots/test-ext-autosummary-module_prefix/conf.py b/tests/roots/test-ext-autosummary-module_prefix/conf.py
new file mode 100644
index 0000000..1065b91
--- /dev/null
+++ b/tests/roots/test-ext-autosummary-module_prefix/conf.py
@@ -0,0 +1,8 @@
+import os
+import sys
+
+sys.path.insert(0, os.path.abspath('.'))
+
+extensions = [
+ 'sphinx.ext.autosummary',
+]
diff --git a/tests/roots/test-ext-autosummary-module_prefix/index.rst b/tests/roots/test-ext-autosummary-module_prefix/index.rst
new file mode 100644
index 0000000..fe0b13c
--- /dev/null
+++ b/tests/roots/test-ext-autosummary-module_prefix/index.rst
@@ -0,0 +1,5 @@
+.. autosummary::
+ :toctree: docs/pkg
+ :recursive:
+
+ pkg
diff --git a/tests/roots/test-ext-autosummary-module_prefix/pkg/__init__.py b/tests/roots/test-ext-autosummary-module_prefix/pkg/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/roots/test-ext-autosummary-module_prefix/pkg/__init__.py
diff --git a/tests/roots/test-ext-autosummary-module_prefix/pkg/mod0/__init__.py b/tests/roots/test-ext-autosummary-module_prefix/pkg/mod0/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/roots/test-ext-autosummary-module_prefix/pkg/mod0/__init__.py
diff --git a/tests/roots/test-ext-autosummary-module_prefix/pkg/mod1/__init__.py b/tests/roots/test-ext-autosummary-module_prefix/pkg/mod1/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/roots/test-ext-autosummary-module_prefix/pkg/mod1/__init__.py
diff --git a/tests/roots/test-ext-autosummary/conf.py b/tests/roots/test-ext-autosummary/conf.py
index 55c769c..1c0d022 100644
--- a/tests/roots/test-ext-autosummary/conf.py
+++ b/tests/roots/test-ext-autosummary/conf.py
@@ -5,6 +5,3 @@ sys.path.insert(0, os.path.abspath('.'))
extensions = ['sphinx.ext.autosummary']
autosummary_generate = True
-
-# The suffix of source filenames.
-source_suffix = '.rst'
diff --git a/tests/roots/test-ext-coverage/conf.py b/tests/roots/test-ext-coverage/conf.py
index d3ec6e8..70fd03e 100644
--- a/tests/roots/test-ext-coverage/conf.py
+++ b/tests/roots/test-ext-coverage/conf.py
@@ -5,8 +5,11 @@ sys.path.insert(0, os.path.abspath('.'))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.coverage']
+coverage_modules = [
+ 'grog',
+]
coverage_ignore_pyobjects = [
- r'^coverage_ignored(\..*)?$',
+ r'^grog\.coverage_ignored(\..*)?$',
r'\.Ignored$',
r'\.Documented\.ignored\d$',
]
diff --git a/tests/roots/test-ext-coverage/grog/__init__.py b/tests/roots/test-ext-coverage/grog/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/roots/test-ext-coverage/grog/__init__.py
diff --git a/tests/roots/test-ext-coverage/coverage_ignored.py b/tests/roots/test-ext-coverage/grog/coverage_ignored.py
index b762955..b762955 100644
--- a/tests/roots/test-ext-coverage/coverage_ignored.py
+++ b/tests/roots/test-ext-coverage/grog/coverage_ignored.py
diff --git a/tests/roots/test-ext-coverage/grog/coverage_missing.py b/tests/roots/test-ext-coverage/grog/coverage_missing.py
new file mode 100644
index 0000000..2fe4433
--- /dev/null
+++ b/tests/roots/test-ext-coverage/grog/coverage_missing.py
@@ -0,0 +1,7 @@
+"""This module is intentionally not documented."""
+
+class Missing:
+ """An undocumented class."""
+
+ def missing_a(self):
+ """An undocumented method."""
diff --git a/tests/roots/test-ext-coverage/coverage_not_ignored.py b/tests/roots/test-ext-coverage/grog/coverage_not_ignored.py
index b762955..b762955 100644
--- a/tests/roots/test-ext-coverage/coverage_not_ignored.py
+++ b/tests/roots/test-ext-coverage/grog/coverage_not_ignored.py
diff --git a/tests/roots/test-ext-coverage/index.rst b/tests/roots/test-ext-coverage/index.rst
index b846898..85dccf9 100644
--- a/tests/roots/test-ext-coverage/index.rst
+++ b/tests/roots/test-ext-coverage/index.rst
@@ -1,6 +1,6 @@
-.. automodule:: coverage_ignored
+.. automodule:: grog.coverage_ignored
:members:
-.. automodule:: coverage_not_ignored
+.. automodule:: grog.coverage_not_ignored
:members:
diff --git a/tests/roots/test-ext-doctest-skipif/conf.py b/tests/roots/test-ext-doctest-skipif/conf.py
index cd8f3eb..ae00e35 100644
--- a/tests/roots/test-ext-doctest-skipif/conf.py
+++ b/tests/roots/test-ext-doctest-skipif/conf.py
@@ -2,7 +2,9 @@ extensions = ['sphinx.ext.doctest']
project = 'test project for the doctest :skipif: directive'
root_doc = 'skipif'
-source_suffix = '.txt'
+source_suffix = {
+ '.txt': 'restructuredtext'
+}
exclude_patterns = ['_build']
doctest_global_setup = '''
diff --git a/tests/roots/test-ext-doctest/conf.py b/tests/roots/test-ext-doctest/conf.py
index d0e8b10..57fc406 100644
--- a/tests/roots/test-ext-doctest/conf.py
+++ b/tests/roots/test-ext-doctest/conf.py
@@ -2,5 +2,7 @@ extensions = ['sphinx.ext.doctest']
project = 'test project for doctest'
root_doc = 'doctest'
-source_suffix = '.txt'
+source_suffix = {
+ '.txt': 'restructuredtext'
+}
exclude_patterns = ['_build']
diff --git a/tests/roots/test-html_assets/extra/API.html_t b/tests/roots/test-html_assets/extra/API.html.jinja
index 34ecd9d..34ecd9d 100644
--- a/tests/roots/test-html_assets/extra/API.html_t
+++ b/tests/roots/test-html_assets/extra/API.html.jinja
diff --git a/tests/roots/test-html_assets/static/API.html_t b/tests/roots/test-html_assets/static/API.html.jinja
index 34ecd9d..34ecd9d 100644
--- a/tests/roots/test-html_assets/static/API.html_t
+++ b/tests/roots/test-html_assets/static/API.html.jinja
diff --git a/tests/roots/test-images/index.rst b/tests/roots/test-images/index.rst
index 9b9aac1..f6d7160 100644
--- a/tests/roots/test-images/index.rst
+++ b/tests/roots/test-images/index.rst
@@ -27,3 +27,8 @@ test-image
.. non-exist remote image
.. image:: http://localhost:7777/NOT_EXIST.PNG
+
+.. a self-contained image within a data URI
+ This image was generated using ImageMagick 6.9 with the command ``convert -pointsize 32 -font Noto-Sans-Egyptian-Hieroglyphs-Regular caption:$(printf '\U13080') -trim -border 2 -monochrome eoh.png``
+.. image:: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAjAQAAAADKt6U+AAAAAmJLR0QAAd2KE6QAAAAHdElNRQfoBQIVBgOBlOMTAAAAEGNhTnYAAAAtAAAAOwAAAAEAAAATst46RgAAAJtJREFUCNdNz70KwkAMAOA8iOhjuGh9HB9BCtoTHHwMH0Mc7KWTmx0dHDpovUk6HCil3sUmATHLR/4IAeJA+LEWPmbEeHJMWbTMZDA0CNFn8x1COFPaIHQ55R7hlZGdIjwj2aovRjJbhPvMLNN+r0g2vB7ByIWbHqqVh3LR3lhZWM0qYV8qjU6+lc4J7ZVx4SjEINBKOSinv/+YL1xvsJE6ztdqAAAADHRFWHRjYXB0aW9uAPCTgoD4hdKUAAAAD3RFWHRjYXB0aW9uOmxpbmVzADGoBz2RAAAAAElFTkSuQmCC
+ :alt: The Eye of Horus in a black font on a white background.
diff --git a/tests/roots/test-inheritance/conf.py b/tests/roots/test-inheritance/conf.py
index 26cadca..9953494 100644
--- a/tests/roots/test-inheritance/conf.py
+++ b/tests/roots/test-inheritance/conf.py
@@ -4,4 +4,3 @@ import sys
sys.path.insert(0, os.path.abspath('.'))
extensions = ['sphinx.ext.inheritance_diagram']
-source_suffix = '.rst'
diff --git a/tests/roots/test-intl/conf.py b/tests/roots/test-intl/conf.py
index 96ac664..09c47bb 100644
--- a/tests/roots/test-intl/conf.py
+++ b/tests/roots/test-intl/conf.py
@@ -1,5 +1,7 @@
project = 'Sphinx intl <Tests>'
-source_suffix = '.txt'
+source_suffix = {
+ '.txt': 'restructuredtext'
+}
keep_warnings = True
templates_path = ['_templates']
html_additional_pages = {'contents': 'contents.html'}
diff --git a/tests/roots/test-intl/glossary_terms_inconsistency.txt b/tests/roots/test-intl/glossary_terms_inconsistency.txt
index 837411b..0de1e7e 100644
--- a/tests/roots/test-intl/glossary_terms_inconsistency.txt
+++ b/tests/roots/test-intl/glossary_terms_inconsistency.txt
@@ -4,3 +4,4 @@ i18n with glossary terms inconsistency
======================================
1. link to :term:`Some term` and :term:`Some other term`.
+2. link to :term:`Some term`.
diff --git a/tests/roots/test-intl/index.txt b/tests/roots/test-intl/index.txt
index 9de15d5..ac68314 100644
--- a/tests/roots/test-intl/index.txt
+++ b/tests/roots/test-intl/index.txt
@@ -31,6 +31,7 @@ CONTENTS
section
translation_progress
topic
+ markup
.. toctree::
:maxdepth: 2
diff --git a/tests/roots/test-intl/markup.txt b/tests/roots/test-intl/markup.txt
new file mode 100644
index 0000000..d167a04
--- /dev/null
+++ b/tests/roots/test-intl/markup.txt
@@ -0,0 +1,6 @@
+i18n with strange markup
+========================
+
+1. title starting with 1.
+-------------------------
+
diff --git a/tests/roots/test-intl/role_xref.txt b/tests/roots/test-intl/role_xref.txt
index 2919b5c..f39e752 100644
--- a/tests/roots/test-intl/role_xref.txt
+++ b/tests/roots/test-intl/role_xref.txt
@@ -7,6 +7,9 @@ i18n role xref
link to :term:`Some term`, :ref:`i18n-role-xref`, :doc:`index`.
+link to :term:`Some term`, :ref:`i18n-role-xref`, :doc:`index`.
+---------------------------------------------------------------
+
.. _same-type-links:
same type links
diff --git a/tests/roots/test-intl/xx/LC_MESSAGES/glossary_terms_inconsistency.po b/tests/roots/test-intl/xx/LC_MESSAGES/glossary_terms_inconsistency.po
index ef2bf30..048b81f 100644
--- a/tests/roots/test-intl/xx/LC_MESSAGES/glossary_terms_inconsistency.po
+++ b/tests/roots/test-intl/xx/LC_MESSAGES/glossary_terms_inconsistency.po
@@ -21,3 +21,6 @@ msgstr "I18N WITH GLOSSARY TERMS INCONSISTENCY"
msgid "link to :term:`Some term` and :term:`Some other term`."
msgstr "LINK TO :term:`SOME NEW TERM`."
+
+msgid "link to :term:`Some term`."
+msgstr "LINK TO :term:`TERM NOT IN GLOSSARY`."
diff --git a/tests/roots/test-intl/xx/LC_MESSAGES/literalblock.po b/tests/roots/test-intl/xx/LC_MESSAGES/literalblock.po
index 8d3e5d8..d320d95 100644
--- a/tests/roots/test-intl/xx/LC_MESSAGES/literalblock.po
+++ b/tests/roots/test-intl/xx/LC_MESSAGES/literalblock.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sphinx 1.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-11-22 08:28+0000\n"
+"POT-Creation-Date: 2024-04-14 15:05+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -22,6 +22,11 @@ msgstr "I18N WITH LITERAL BLOCK"
msgid "Correct literal block::"
msgstr "CORRECT LITERAL BLOCK::"
+msgid ""
+"this is\n"
+"literal block"
+msgstr "THIS IS\nLITERAL BLOCK"
+
msgid "Missing literal block::"
msgstr "MISSING LITERAL BLOCK::"
@@ -31,6 +36,25 @@ msgstr "THAT'S ALL."
msgid "included raw.txt"
msgstr "INCLUDED RAW.TXT"
+msgid ""
+"===\n"
+"Raw\n"
+"===\n"
+"\n"
+".. raw:: html\n"
+"\n"
+" <iframe src=\"https://sphinx-doc.org\"></iframe>\n"
+"\n"
+msgstr ""
+"===\n"
+"RAW\n"
+"===\n"
+"\n"
+".. raw:: html\n"
+"\n"
+" <iframe src=\"HTTPS://SPHINX-DOC.ORG\"></iframe>\n"
+"\n"
+
msgid "code blocks"
msgstr "CODE-BLOCKS"
@@ -43,9 +67,6 @@ msgstr ""
" 'RESULT'\n"
"end"
-msgid "example of C language"
-msgstr "EXAMPLE OF C LANGUAGE"
-
msgid ""
"#include <stdlib.h>\n"
"int main(int argc, char** argv)\n"
@@ -59,6 +80,9 @@ msgstr ""
" return 0;\n"
"}"
+msgid "example of C language"
+msgstr "EXAMPLE OF C LANGUAGE"
+
msgid ""
"#include <stdio.h>\n"
"int main(int argc, char** argv)\n"
diff --git a/tests/roots/test-intl/xx/LC_MESSAGES/markup.po b/tests/roots/test-intl/xx/LC_MESSAGES/markup.po
new file mode 100644
index 0000000..ad6de9b
--- /dev/null
+++ b/tests/roots/test-intl/xx/LC_MESSAGES/markup.po
@@ -0,0 +1,25 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) 2018, dev
+# This file is distributed under the same license as the sphinx package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: sphinx 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-05-06 16:44+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.4.0\n"
+
+msgid "i18n with strange markup"
+msgstr "I18N WITH STRANGE MARKUP"
+
+msgid "1. title starting with 1."
+msgstr "1. TITLE STARTING WITH 1."
+
diff --git a/tests/roots/test-latex-figure-in-admonition/conf.py b/tests/roots/test-latex-figure-in-admonition/conf.py
index a45d22e..3d8b7b5 100644
--- a/tests/roots/test-latex-figure-in-admonition/conf.py
+++ b/tests/roots/test-latex-figure-in-admonition/conf.py
@@ -1 +1,3 @@
+extensions = ['sphinx.ext.todo']
+todo_include_todos = True
exclude_patterns = ['_build']
diff --git a/tests/roots/test-latex-figure-in-admonition/index.rst b/tests/roots/test-latex-figure-in-admonition/index.rst
index e3d39d3..c3fcaab 100644
--- a/tests/roots/test-latex-figure-in-admonition/index.rst
+++ b/tests/roots/test-latex-figure-in-admonition/index.rst
@@ -3,7 +3,24 @@ Test Figure in Admonition
.. caution::
- This uses a figure in an admonition.
+ This uses a figure in a caution directive.
.. figure:: img.png
+.. note::
+
+ This uses a figure in a note directive.
+
+ .. figure:: img.png
+
+.. seealso::
+
+ This uses a figure in a seealso directive.
+
+ .. figure:: img.png
+
+.. todo::
+
+ This uses a figure in a todo directive.
+
+ .. figure:: img.png
diff --git a/tests/roots/test-latex-table/_mytemplates/latex/longtable.tex_t b/tests/roots/test-latex-table/_mytemplates/latex/longtable.tex.jinja
index e2cb1db..e2cb1db 100644
--- a/tests/roots/test-latex-table/_mytemplates/latex/longtable.tex_t
+++ b/tests/roots/test-latex-table/_mytemplates/latex/longtable.tex.jinja
diff --git a/tests/roots/test-latex-table/_mytemplates/latex/tabulary.tex_t b/tests/roots/test-latex-table/_mytemplates/latex/tabulary.tex_t
new file mode 100644
index 0000000..7e6d425
--- /dev/null
+++ b/tests/roots/test-latex-table/_mytemplates/latex/tabulary.tex_t
@@ -0,0 +1 @@
+AU REVOIR, KANIGGETS
diff --git a/tests/roots/test-linkcheck-anchors-ignore-for-url/index.rst b/tests/roots/test-linkcheck-anchors-ignore-for-url/index.rst
index df287b4..02969b6 100644
--- a/tests/roots/test-linkcheck-anchors-ignore-for-url/index.rst
+++ b/tests/roots/test-linkcheck-anchors-ignore-for-url/index.rst
@@ -1,5 +1,6 @@
* `Example valid url, no anchor <http://localhost:7777/valid>`_
* `Example valid url, valid anchor <http://localhost:7777/valid#valid-anchor>`_
+* `Example valid url, valid quotable anchor <http://localhost:7777/valid#py:module::urllib.parse>`_
* `Example valid url, invalid anchor <http://localhost:7777/valid#invalid-anchor>`_
* `Example ignored url, no anchor <http://localhost:7777/ignored>`_
* `Example ignored url, invalid anchor <http://localhost:7777/ignored#invalid-anchor>`_
diff --git a/tests/roots/test-markup-rubric/conf.py b/tests/roots/test-markup-rubric/conf.py
index e274bde..eccdbf7 100644
--- a/tests/roots/test-markup-rubric/conf.py
+++ b/tests/roots/test-markup-rubric/conf.py
@@ -1,3 +1,4 @@
latex_documents = [
('index', 'test.tex', 'The basic Sphinx documentation for testing', 'Sphinx', 'report')
]
+latex_toplevel_sectioning = 'section'
diff --git a/tests/roots/test-markup-rubric/index.rst b/tests/roots/test-markup-rubric/index.rst
index c2ae68a..f91b0f7 100644
--- a/tests/roots/test-markup-rubric/index.rst
+++ b/tests/roots/test-markup-rubric/index.rst
@@ -5,3 +5,35 @@ test-markup-rubric
.. rubric:: This is
a multiline rubric
+
+.. rubric:: A rubric with a class
+ :class: myclass
+
+.. rubric:: A rubric with a heading level 1
+ :heading-level: 1
+ :class: myclass
+
+.. rubric:: A rubric with a heading level 2
+ :heading-level: 2
+ :class: myclass
+
+.. rubric:: A rubric with a heading level 3
+ :heading-level: 3
+ :class: myclass
+
+.. rubric:: A rubric with a heading level 4
+ :heading-level: 4
+ :class: myclass
+
+.. rubric:: A rubric with a heading level 5
+ :heading-level: 5
+ :class: myclass
+
+.. rubric:: A rubric with a heading level 6
+ :heading-level: 6
+ :class: myclass
+
+.. rubric:: A rubric with a heading level 7
+ :heading-level: 7
+ :class: myclass
+
diff --git a/tests/roots/test-root/conf.py b/tests/roots/test-root/conf.py
index a14ffaf..25c723b 100644
--- a/tests/roots/test-root/conf.py
+++ b/tests/roots/test-root/conf.py
@@ -17,7 +17,10 @@ jsmath_path = 'dummy.js'
templates_path = ['_templates']
-source_suffix = ['.txt', '.add', '.foo']
+source_suffix = {
+ '.txt': 'restructuredtext',
+ '.foo': 'foo',
+}
project = 'Sphinx <Tests>'
copyright = '1234-6789, copyright text credits'
@@ -68,7 +71,7 @@ latex_elements = {
shadowrule=1pt,
shadowsep=10pt,
shadowsize=10pt,
- div.topic_border-width=2pt,% alias to shadowrule
+ div.topic_border-width=2pt,% alias to shadowrule
div.topic_padding=6pt,% alias to shadowsep
div.topic_box-shadow=5pt,% overrides/alias shadowsize
%
diff --git a/tests/roots/test-root/images.txt b/tests/roots/test-root/images.txt
index 5a096dc..a07429a 100644
--- a/tests/roots/test-root/images.txt
+++ b/tests/roots/test-root/images.txt
@@ -18,5 +18,13 @@ Sphinx image handling
.. an SVG image (for HTML at least)
.. image:: svgimg.*
+.. an SVG image using width with units
+.. image:: svgimg.*
+ :width: 2cm
+
+.. an SVG image using height with units
+.. image:: svgimg.*
+ :height: 2cm
+
.. an image with more than 1 dot in its file name
.. image:: img.foo.png
diff --git a/tests/roots/test-root/markup.txt b/tests/roots/test-root/markup.txt
index ff677eb..91f4194 100644
--- a/tests/roots/test-root/markup.txt
+++ b/tests/roots/test-root/markup.txt
@@ -230,6 +230,19 @@ Tables with multirow and multicol:
figure in table
+ * - .. warning::
+
+ warning in table
+
+ * - .. seealso::
+
+ figure in a seealso in a table
+
+ .. figure:: img.png
+
+ with a caption
+
+ and a legend
Figures
-------
diff --git a/tests/roots/test-templating/conf.py b/tests/roots/test-templating/conf.py
index e03eaf1..7a2baed 100644
--- a/tests/roots/test-templating/conf.py
+++ b/tests/roots/test-templating/conf.py
@@ -1,5 +1,7 @@
project = 'Sphinx templating <Tests>'
-source_suffix = '.txt'
+source_suffix = {
+ '.txt': 'restructuredtext'
+}
keep_warnings = True
templates_path = ['_templates']
release = version = '2013.120'
diff --git a/tests/roots/test-theming/test_theme/staticfiles/static/legacytmpl.html_t b/tests/roots/test-theming/test_theme/staticfiles/static/legacytmpl.html_t
new file mode 100644
index 0000000..8b505e2
--- /dev/null
+++ b/tests/roots/test-theming/test_theme/staticfiles/static/legacytmpl.html_t
@@ -0,0 +1,2 @@
+<!-- testing legacy _t static templates -->
+<html><project>{{ project | lower | escape }}</project></html>
diff --git a/tests/roots/test-theming/test_theme/staticfiles/static/statictmpl.html_t b/tests/roots/test-theming/test_theme/staticfiles/static/statictmpl.html.jinja
index 4ab292b..4ab292b 100644
--- a/tests/roots/test-theming/test_theme/staticfiles/static/statictmpl.html_t
+++ b/tests/roots/test-theming/test_theme/staticfiles/static/statictmpl.html.jinja
diff --git a/tests/roots/test-toctree-domain-objects/document_scoping.rst b/tests/roots/test-toctree-domain-objects/document_scoping.rst
new file mode 100644
index 0000000..49aba9e
--- /dev/null
+++ b/tests/roots/test-toctree-domain-objects/document_scoping.rst
@@ -0,0 +1,23 @@
+Level 1
+=======
+
+.. py:class:: ClassLevel1a
+ ClassLevel1b
+
+ .. py:method:: f()
+
+.. py:method:: ClassLevel1a.g()
+
+.. py:method:: ClassLevel1b.g()
+
+Level 2
+-------
+
+.. py:class:: ClassLevel2a
+ ClassLevel2b
+
+ .. py:method:: f()
+
+.. py:method:: ClassLevel2a.g()
+
+.. py:method:: ClassLevel2b.g()
diff --git a/tests/roots/test-toctree-domain-objects/index.rst b/tests/roots/test-toctree-domain-objects/index.rst
index 77ee010..5f04172 100644
--- a/tests/roots/test-toctree-domain-objects/index.rst
+++ b/tests/roots/test-toctree-domain-objects/index.rst
@@ -4,3 +4,4 @@
:name: mastertoc
domains
+ document_scoping
diff --git a/tests/roots/test-util-copyasset_overwrite/conf.py b/tests/roots/test-util-copyasset_overwrite/conf.py
new file mode 100644
index 0000000..bb91f31
--- /dev/null
+++ b/tests/roots/test-util-copyasset_overwrite/conf.py
@@ -0,0 +1,7 @@
+import os
+import sys
+sys.path.insert(0, os.path.abspath('.'))
+
+extensions = ['myext']
+html_static_path = ['user_static']
+html_theme = 'basic'
diff --git a/tests/roots/test-util-copyasset_overwrite/index.rst b/tests/roots/test-util-copyasset_overwrite/index.rst
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/roots/test-util-copyasset_overwrite/index.rst
diff --git a/tests/roots/test-util-copyasset_overwrite/myext.py b/tests/roots/test-util-copyasset_overwrite/myext.py
new file mode 100644
index 0000000..544057c
--- /dev/null
+++ b/tests/roots/test-util-copyasset_overwrite/myext.py
@@ -0,0 +1,22 @@
+from pathlib import Path
+
+from sphinx.util.fileutil import copy_asset
+
+
+def _copy_asset_overwrite_hook(app):
+ css = app.outdir / '_static' / 'custom-styles.css'
+ # html_static_path is copied by default
+ assert css.read_text() == '/* html_static_path */\n', 'invalid default text'
+ # warning generated by here
+ copy_asset(
+ Path(__file__).parent.joinpath('myext_static', 'custom-styles.css'),
+ app.outdir / '_static',
+ )
+ # This demonstrates the overwriting
+ assert css.read_text() == '/* extension styles */\n', 'overwriting failed'
+ return []
+
+
+def setup(app):
+ app.connect('html-collect-pages', _copy_asset_overwrite_hook)
+ app.add_css_file('custom-styles.css')
diff --git a/tests/roots/test-util-copyasset_overwrite/myext_static/custom-styles.css b/tests/roots/test-util-copyasset_overwrite/myext_static/custom-styles.css
new file mode 100644
index 0000000..9509354
--- /dev/null
+++ b/tests/roots/test-util-copyasset_overwrite/myext_static/custom-styles.css
@@ -0,0 +1 @@
+/* extension styles */
diff --git a/tests/roots/test-util-copyasset_overwrite/user_static/custom-styles.css b/tests/roots/test-util-copyasset_overwrite/user_static/custom-styles.css
new file mode 100644
index 0000000..1b892b9
--- /dev/null
+++ b/tests/roots/test-util-copyasset_overwrite/user_static/custom-styles.css
@@ -0,0 +1 @@
+/* html_static_path */
diff --git a/tests/roots/test-versioning/conf.py b/tests/roots/test-versioning/conf.py
index 6344cb0..d52d1f2 100644
--- a/tests/roots/test-versioning/conf.py
+++ b/tests/roots/test-versioning/conf.py
@@ -1,3 +1,5 @@
project = 'versioning test root'
-source_suffix = '.txt'
+source_suffix = {
+ '.txt': 'restructuredtext'
+}
exclude_patterns = ['_build']