Skip to content

Change "Permalink to this {thing}" in tooltips, to "Link to this {thing}" #10049

@pradyunsg

Description

@pradyunsg

Describe the bug

According to Wikipedia:

A permalink or permanent link is a URL that is intended to remain unchanged for many years into the future, yielding a hyperlink that is less susceptible to link rot.

Sphinx uses the word "Permalink" in the tooltips for various things, such as headings/definitions/images/code etc. This is not configurable by the user and is not ideal; since not all of the documentation sites have similar policies on how link rot/renaming etc would be handled. This is especially problematic since a lot of Sphinx-based documentation is on ReadTheDocs, which by default has pages like pip.readthedocs.io/en/latest/ which are decidedly not going to present permalinks (unless the documentation author is really careful; which... yea, not guarenteed).

It would be better to change "Permalink" to "Link", avoiding the concern of whether a link is going to be long-lived or not entirely. Plus, it's more "generally correct" -- a permalink is still a link. :)

How to Reproduce

Build any Sphinx documentation, containing one or more headings (eg: https://pradyunsg.me/furo/kitchen-sink/demo/). When hovering over the Sphinx-injected "headerlink", notice that it says "Permalink to this heading".

Expected behavior

Change to "Link to this heading".

Your project

https://github.com/pradyunsg/furo

Screenshots

Screenshot 2022-01-01 at 17 20 09

OS

N/A

Python version

N/A

Sphinx version

4.x

Sphinx extensions

No response

Extra tools

No response

Additional context

Excluding the locale files, there's quite a few instances that would need updating:

./tests/test_directive_code.py:               'title="Permalink to this code">\xb6</a></div>')
./tests/test_directive_code.py:               'title="Permalink to this code">\xb6</a></div>')
./tests/test_ext_inheritance_diagram.py:                   'title="Permalink to this image">\xb6</a></p>\n</div>\n')
./tests/test_ext_inheritance_diagram.py:                   'title="Permalink to this image">\xb6</a></p>\n</figcaption>\n</figure>\n')
./tests/test_ext_inheritance_diagram.py:                   'title="Permalink to this image">\xb6</a></p>\n</div>\n')
./tests/test_ext_inheritance_diagram.py:                   'title="Permalink to this image">\xb6</a></p>\n</figcaption>\n</figure>\n')
./tests/test_ext_inheritance_diagram.py:                   'title="Permalink to this image">\xb6</a></p>\n</div>\n')
./tests/test_ext_inheritance_diagram.py:                   'title="Permalink to this image">\xb6</a></p>\n</figcaption>\n</figure>\n')
./tests/test_build_html.py:                '<a class="headerlink" href="#id1" title="Permalink to this image">¶</a></p>'
./tests/test_build_html.py:                '<a class="headerlink" href="#id1" title="Permalink to this image">¶</a></p>\n</figcaption>'
./tests/test_build_html.py:            'title="Permalink to this heading"><span>[PERMALINK]</span></a></h1>' in content)
./tests/test_markup.py:         ' title="Permalink to this term">¶</a></dt>'
./tests/test_markup.py:         ' title="Permalink to this term">¶</a></dt>'
./sphinx/writers/html5.py:            self.add_permalink_ref(node, _('Permalink to this definition'))
./sphinx/writers/html5.py:            self.add_permalink_ref(node.parent, _('Permalink to this definition'))
./sphinx/writers/html5.py:                self.add_permalink_ref(node, _('Permalink to this term'))
./sphinx/writers/html5.py:                self.add_permalink_ref(node.parent, _('Permalink to this heading'))
./sphinx/writers/html5.py:                                     _('Permalink to this heading'),
./sphinx/writers/html5.py:                self.add_permalink_ref(node.parent, _('Permalink to this table'))
./sphinx/writers/html5.py:            self.add_permalink_ref(node.parent, _('Permalink to this code'))
./sphinx/writers/html5.py:            self.add_permalink_ref(node.parent, _('Permalink to this image'))
./sphinx/writers/html5.py:            self.add_permalink_ref(node.parent.parent, _('Permalink to this toctree'))
./sphinx/writers/html.py:            self.add_permalink_ref(node, _('Permalink to this definition'))
./sphinx/writers/html.py:            self.add_permalink_ref(node.parent, _('Permalink to this definition'))
./sphinx/writers/html.py:                self.add_permalink_ref(node, _('Permalink to this term'))
./sphinx/writers/html.py:                self.add_permalink_ref(node.parent, _('Permalink to this heading'))
./sphinx/writers/html.py:                                     _('Permalink to this heading'),
./sphinx/writers/html.py:                self.add_permalink_ref(node.parent, _('Permalink to this table'))
./sphinx/writers/html.py:            self.add_permalink_ref(node.parent, _('Permalink to this code'))
./sphinx/writers/html.py:            self.add_permalink_ref(node.parent, _('Permalink to this image'))
./sphinx/writers/html.py:            self.add_permalink_ref(node.parent.parent, _('Permalink to this toctree'))
./sphinx/ext/mathjax.py:        self.add_permalink_ref(node, _('Permalink to this equation'))
./sphinx/ext/imgmath.py:        self.add_permalink_ref(node, _('Permalink to this equation'))
./sphinx/themes/basic/static/doctools.js:      attr('title', _('Permalink to this heading')).
./sphinx/themes/basic/static/doctools.js:      attr('title', _('Permalink to this definition')).

If this ends up being OK to do, we should change this no sooner than Sphinx 5.0 (similar to #10041).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions