Skip to content

Commit

Permalink
Remove configuration option html_signaturereturn_icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
doerwalter committed Jun 14, 2021
1 parent 798adc4 commit 9aedeee
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 24 deletions.
7 changes: 0 additions & 7 deletions doc/usage/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion sphinx/builders/html/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions sphinx/writers/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ def depart_desc_type(self, node: Element) -> None:
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">&#x2192;</span>')
self.body.append(' <span class="sig-return-typehint">')

def depart_desc_returns(self, node: Element) -> None:
self.body.append('</span></span>')
Expand Down
6 changes: 3 additions & 3 deletions sphinx/writers/html5.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def depart_desc_type(self, node: Element) -> None:
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">&#x2192;</span>')
self.body.append(' <span class="sig-return-typehint">')

def depart_desc_returns(self, node: Element) -> None:
self.body.append('</span></span>')
Expand Down
11 changes: 1 addition & 10 deletions tests/test_build_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -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">&#x2192;</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)

0 comments on commit 9aedeee

Please sign in to comment.