mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Change "Permalink to this {headline -> heading}"
"heading" is a better word to use in this tooltip, since it better matches the use case.
This commit is contained in:
parent
d417b0ab83
commit
bc635627d3
@ -196,7 +196,7 @@ var Documentation = {
|
|||||||
$('div[id] > :header:first').each(function() {
|
$('div[id] > :header:first').each(function() {
|
||||||
$('<a class="headerlink">\u00B6</a>').
|
$('<a class="headerlink">\u00B6</a>').
|
||||||
attr('href', '#' + this.id).
|
attr('href', '#' + this.id).
|
||||||
attr('title', _('Permalink to this headline')).
|
attr('title', _('Permalink to this heading')).
|
||||||
appendTo(this);
|
appendTo(this);
|
||||||
});
|
});
|
||||||
$('dt[id]').each(function() {
|
$('dt[id]').each(function() {
|
||||||
|
@ -434,12 +434,12 @@ class HTMLTranslator(SphinxTranslator, BaseTranslator):
|
|||||||
node.parent.hasattr('ids') and node.parent['ids']):
|
node.parent.hasattr('ids') and node.parent['ids']):
|
||||||
# add permalink anchor
|
# add permalink anchor
|
||||||
if close_tag.startswith('</h'):
|
if close_tag.startswith('</h'):
|
||||||
self.add_permalink_ref(node.parent, _('Permalink to this headline'))
|
self.add_permalink_ref(node.parent, _('Permalink to this heading'))
|
||||||
elif close_tag.startswith('</a></h'):
|
elif close_tag.startswith('</a></h'):
|
||||||
self.body.append('</a><a class="headerlink" href="#%s" ' %
|
self.body.append('</a><a class="headerlink" href="#%s" ' %
|
||||||
node.parent['ids'][0] +
|
node.parent['ids'][0] +
|
||||||
'title="%s">%s' % (
|
'title="%s">%s' % (
|
||||||
_('Permalink to this headline'),
|
_('Permalink to this heading'),
|
||||||
self.config.html_permalinks_icon))
|
self.config.html_permalinks_icon))
|
||||||
elif isinstance(node.parent, nodes.table):
|
elif isinstance(node.parent, nodes.table):
|
||||||
self.body.append('</span>')
|
self.body.append('</span>')
|
||||||
|
@ -389,12 +389,12 @@ class HTML5Translator(SphinxTranslator, BaseTranslator):
|
|||||||
node.parent.hasattr('ids') and node.parent['ids']):
|
node.parent.hasattr('ids') and node.parent['ids']):
|
||||||
# add permalink anchor
|
# add permalink anchor
|
||||||
if close_tag.startswith('</h'):
|
if close_tag.startswith('</h'):
|
||||||
self.add_permalink_ref(node.parent, _('Permalink to this headline'))
|
self.add_permalink_ref(node.parent, _('Permalink to this heading'))
|
||||||
elif close_tag.startswith('</a></h'):
|
elif close_tag.startswith('</a></h'):
|
||||||
self.body.append('</a><a class="headerlink" href="#%s" ' %
|
self.body.append('</a><a class="headerlink" href="#%s" ' %
|
||||||
node.parent['ids'][0] +
|
node.parent['ids'][0] +
|
||||||
'title="%s">%s' % (
|
'title="%s">%s' % (
|
||||||
_('Permalink to this headline'),
|
_('Permalink to this heading'),
|
||||||
self.config.html_permalinks_icon))
|
self.config.html_permalinks_icon))
|
||||||
elif isinstance(node.parent, nodes.table):
|
elif isinstance(node.parent, nodes.table):
|
||||||
self.body.append('</span>')
|
self.body.append('</span>')
|
||||||
|
@ -1664,7 +1664,7 @@ def test_html_permalink_icon(app):
|
|||||||
|
|
||||||
assert ('<h1>The basic Sphinx documentation for testing<a class="headerlink" '
|
assert ('<h1>The basic Sphinx documentation for testing<a class="headerlink" '
|
||||||
'href="#the-basic-sphinx-documentation-for-testing" '
|
'href="#the-basic-sphinx-documentation-for-testing" '
|
||||||
'title="Permalink to this headline"><span>[PERMALINK]</span></a></h1>' in content)
|
'title="Permalink to this heading"><span>[PERMALINK]</span></a></h1>' in content)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx('html', testroot='html_signaturereturn_icon')
|
@pytest.mark.sphinx('html', testroot='html_signaturereturn_icon')
|
||||||
|
Loading…
Reference in New Issue
Block a user