mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Close #6550: html: Allow to use HTML permalink texts
Add new configuration variables: `html_permalinks` and `html_permalinks_icon`. This refines the settings around HTML permalinks. * html_add_permalinks * Deprecated. * html_permalinks * Enable or disable permalinks feature. * html_permalinks_icon * Change the icon for permalinks
This commit is contained in:
@@ -1665,3 +1665,23 @@ def test_highlight_options_old(app):
|
||||
location=ANY, opts={})
|
||||
assert call_args[2] == call(ANY, 'java', force=False, linenos=False,
|
||||
location=ANY, opts={})
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='basic',
|
||||
confoverrides={'html_permalinks': False})
|
||||
def test_html_permalink_disable(app):
|
||||
app.build()
|
||||
content = (app.outdir / 'index.html').read_text()
|
||||
|
||||
assert '<h1>The basic Sphinx documentation for testing</h1>' in content
|
||||
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='basic',
|
||||
confoverrides={'html_permalinks_icon': '<span>[PERMALINK]</span>'})
|
||||
def test_html_permalink_icon(app):
|
||||
app.build()
|
||||
content = (app.outdir / 'index.html').read_text()
|
||||
|
||||
assert ('<h1>The basic Sphinx documentation for testing<a class="headerlink" '
|
||||
'href="#the-basic-sphinx-documentation-for-testing" '
|
||||
'title="Permalink to this headline"><span>[PERMALINK]</span></a></h1>' in content)
|
||||
|
||||
Reference in New Issue
Block a user