Skip to main content

A Sphinx extension to remove needless links

Project description

Linklint checks .rst files for excessive links to references.

It also can be used as a Sphinx extension to automatically unlink references that should not be links.

Checks

Linklint has two different checks:

  • self: find references that link to their own section. For example, in the description of a class, use :class: referring to itself. These should not be links since they will not take you someplace new.

  • paradup: find multiple identical references within a single paragraph. The first should be a link, but subsequent references don’t need to be links, they are just distractions.

Sphinx extension

To use linklint as a Sphinx extension, add it to the extensions list in your conf.py file:

extensions = [
    # .. probably other extensions are already here..
    "linklint.ext",
]

During the build process, linklint will run all its checks and unlink any reference it considers excessive.

Command-line use

You can use linklint as a command-line linter:

% linklint --help
usage: linklint [-h] [--check CHECK] [--fix] files [files ...]

positional arguments:
  files          RST files to lint

options:
  -h, --help     show this help message and exit
  --check CHECK  comma-separated checks to run (self, paradup, all)
  --fix          Fix the issues in place

This can be useful to see what linklint considers excessive, or to modify .rst files to unlink excessive references. Linklint unlinks references by changing :func:`foo` to :func:`!foo`.

If you agree with linklint’s decisions, the Sphinx extension is a better option, since it doesn’t require changing the source files, and doesn’t hard-code the decisions.

Changes

v0.3.1 (2026-03-01)

Published to PyPI.

v0.3.0 (2026-02-28)

Methods are associated with classes properly in a number of ways.

The Sphinx extension now displays the number of references that were unlinked. The CPython docs report 3612 references unlinked.

v0.2.0 (2026-02-22)

Now available as a Sphinx extension. Instead of changing .rst source files, the excessive links are automatically unlinked in the generated documentation.

v0.1.0 (2026-02-21)

First version: works as a linter with --check and --fix to change .rst source files.

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

linklint-0.3.1.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

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

linklint-0.3.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file linklint-0.3.1.tar.gz.

File metadata

  • Download URL: linklint-0.3.1.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for linklint-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e8e6b1caac5e6426086f1eaa20505f9077433920c88daab42788bbe9425d6ef2
MD5 4ef68e5e1834e152aff51f46dce86d3b
BLAKE2b-256 4811a09f73bb7c71ff06c92258045a08a97a4c0c2a4b3951d0e5ed74366f78aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for linklint-0.3.1.tar.gz:

Publisher: publish.yml on nedbat/linklint

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

File details

Details for the file linklint-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: linklint-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for linklint-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b922d08185e7053af053cd7d3853b6f27cf3c9159b3659931adb62ab326a989
MD5 1296bae7b78dd7a30743269b38abae18
BLAKE2b-256 d3b48057c0d5fdc72f237b9422bb78d3ac88d8fbb9f13e967ac59c0ce6543972

See more details on using hashes here.

Provenance

The following attestation bundles were made for linklint-0.3.1-py3-none-any.whl:

Publisher: publish.yml on nedbat/linklint

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