diff options
author | Walter Doerwald <walter@livinglogic.de> | 2021-06-14 14:02:19 +0200 |
---|---|---|
committer | Walter Doerwald <walter@livinglogic.de> | 2021-06-14 14:02:19 +0200 |
commit | 9aedeee53891bcbbba0b0adaf72a3e30f99a00f7 (patch) | |
tree | 64493dbaae5e221e50260734bc75ad7ad831d0b9 | |
parent | 798adc4f57ef0fd3b79e90ef6176c1f554b4e53b (diff) | |
download | sphinx-git-9aedeee53891bcbbba0b0adaf72a3e30f99a00f7.tar.gz |
Remove configuration option html_signaturereturn_icon.
-rw-r--r-- | doc/usage/configuration.rst | 7 | ||||
-rw-r--r-- | sphinx/builders/html/__init__.py | 1 | ||||
-rw-r--r-- | sphinx/writers/html.py | 6 | ||||
-rw-r--r-- | sphinx/writers/html5.py | 6 | ||||
-rw-r--r-- | tests/test_build_html.py | 11 |
5 files changed, 7 insertions, 24 deletions
diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst index 6a3b19da4..0b2bd4e3e 100644 --- a/doc/usage/configuration.rst +++ b/doc/usage/configuration.rst @@ -1191,13 +1191,6 @@ that use Sphinx's HTMLWriter class. .. versionadded:: 3.5 -.. confval:: html_signaturereturn_icon - - A text for prepended to the type hint for the return type of a function or - method. HTML tags are allowed. Default: an arrow; ``→`` - - .. versionadded:: 4.1 - .. confval:: html_sidebars Custom sidebar templates, must be a dictionary that maps document names to diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py index 34103ad98..85669474e 100644 --- a/sphinx/builders/html/__init__.py +++ b/sphinx/builders/html/__init__.py @@ -1320,7 +1320,6 @@ def setup(app: Sphinx) -> Dict[str, Any]: app.add_config_value('html_add_permalinks', UNSET, 'html') app.add_config_value('html_permalinks', True, 'html') app.add_config_value('html_permalinks_icon', 'ΒΆ', 'html') - app.add_config_value('html_signaturereturn_icon', '→', 'html') app.add_config_value('html_use_index', True, 'html') app.add_config_value('html_split_index', False, 'html') app.add_config_value('html_copy_source', True, 'html') diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index 9fd9fe715..ce0132625 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -174,9 +174,9 @@ class HTMLTranslator(SphinxTranslator, BaseTranslator): pass def visit_desc_returns(self, node: Element) -> None: - self.body.append(' <span class="sig-return"><span class="sig-return-icon">') - self.body.append(self.config.html_signaturereturn_icon) - self.body.append('</span> <span class="sig-return-typehint">') + self.body.append(' <span class="sig-return">') + self.body.append('<span class="sig-return-icon">→</span>') + self.body.append(' <span class="sig-return-typehint">') def depart_desc_returns(self, node: Element) -> None: self.body.append('</span></span>') diff --git a/sphinx/writers/html5.py b/sphinx/writers/html5.py index 1df9bb466..95dc92052 100644 --- a/sphinx/writers/html5.py +++ b/sphinx/writers/html5.py @@ -145,9 +145,9 @@ class HTML5Translator(SphinxTranslator, BaseTranslator): pass def visit_desc_returns(self, node: Element) -> None: - self.body.append(' <span class="sig-return"><span class="sig-return-icon">') - self.body.append(self.config.html_signaturereturn_icon) - self.body.append('</span> <span class="sig-return-typehint">') + self.body.append(' <span class="sig-return">') + self.body.append('<span class="sig-return-icon">→</span>') + self.body.append(' <span class="sig-return-typehint">') def depart_desc_returns(self, node: Element) -> None: self.body.append('</span></span>') diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 3e2c2e4d4..958dee568 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -1628,17 +1628,8 @@ def test_html_permalink_icon(app): @pytest.mark.sphinx('html', testroot='html_signaturereturn_icon') -def test_html_signaturereturn_icon_default(app): +def test_html_signaturereturn_icon(app): app.build() content = (app.outdir / 'index.html').read_text() assert ('<span class="sig-return-icon">→</span>' in content) - - -@pytest.mark.sphinx('html', testroot='html_signaturereturn_icon', - confoverrides={'html_signaturereturn_icon': '<span>RETURN</span>'}) -def test_html_signaturereturn_icon_custon(app): - app.build() - content = (app.outdir / 'index.html').read_text() - - assert ('<span class="sig-return-icon"><span>RETURN</span></span>' in content) |