Skip to main content

Sphinx client-side redirects for removed HTML anchors

Project description

sphinx-anchormap

A Sphinx extension providing an anchormap directive for client-side redirects of removed HTML anchors.

When a section or description is moved or removed, old #fragment links out in the wild break silently. anchormap lets you declare redirect entries next to the content; they are resolved at build time, embedded in the page as JSON, and a small script redirects visitors from the stale anchor to its new location.

Installation

pip install sphinx-anchormap

Then in conf.py:

extensions = [
    "anchor_redirects",
]

Usage

Declare redirects in the document the old anchors used to live on:

.. anchormap::

   removed-anchor: :ref:`new-target`

Each entry is old-html-fragment: target. The directive produces no output; visiting the page with #removed-anchor in the URL redirects to the new target instead.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_anchormap-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_anchormap-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_anchormap-0.1.0.tar.gz.

File metadata

  • Download URL: sphinx_anchormap-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for sphinx_anchormap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eddb1e0bd8519179adc1a44c1bcd42b8a44cf80b7fad49d2640a9cb98064bbb4
MD5 3906e3c9dc499de34f2ed9fa9d8de864
BLAKE2b-256 e0d491bf0c953685ae3daac6c1a23b5944a70181d04893d0e610d76e72fd0b85

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_anchormap-0.1.0.tar.gz:

Publisher: publish.yml on StanFromIreland/sphinx-anchormap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_anchormap-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_anchormap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a50f75371f7a40f1ae02905483a5f5dc1d254e6b079a97ab35b383b1d3372409
MD5 eff9775d0408e1ab371eef999f8d5ce0
BLAKE2b-256 62b0ecbf93f6fa5f1456541702f755fb031c10143dff8f9f089dc1b5b6c7893b

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_anchormap-0.1.0-py3-none-any.whl:

Publisher: publish.yml on StanFromIreland/sphinx-anchormap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page