Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b34cf14

Browse files
committed
flesh out the README
1 parent 09b9d59 commit b34cf14

1 file changed

Lines changed: 64 additions & 8 deletions

File tree

README.rst

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,88 @@
11
========
2-
linklint
2+
Linklint
33
========
44

5-
Linklint checks .rst files for inappropriate links.
5+
Linklint checks .rst files for excessive links to references.
66

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

1010

11+
Checks
12+
======
13+
14+
Linklint has two different checks:
15+
16+
- ``self``: find references that link to their own section. For example, in the
17+
description of a class, use `:class:` referring to itself. These should not
18+
be links since they will not take you someplace new.
19+
20+
- ``paradup``: find multiple identical references within a single paragraph.
21+
The first should be a link, but subsequent references don't need to be links,
22+
they are just distractions.
23+
24+
25+
Sphinx extension
26+
================
27+
28+
To use linklint as a Sphinx extension, add it to the ``extensions`` list in
29+
your ``conf.py`` file:
30+
31+
.. code:: python
32+
33+
extensions = [
34+
# .. probably other extensions are already here..
35+
"linklint.ext",
36+
]
37+
38+
During the build process, linklint will run all its checks and unlink any
39+
reference it considers excessive.
40+
41+
42+
Command-line use
43+
================
44+
45+
You can use linklint as a command-line linter::
46+
47+
% linklint --help
48+
usage: linklint [-h] [--check CHECK] [--fix] files [files ...]
49+
50+
positional arguments:
51+
files RST files to lint
52+
53+
options:
54+
-h, --help show this help message and exit
55+
--check CHECK comma-separated checks to run (self, paradup, all)
56+
--fix Fix the issues in place
57+
58+
This can be useful to see what linklint considers excessive, or to modify .rst
59+
files to unlink excessive references. Linklint unlinks references by changing
60+
``:func:`foo``` to ``:func:`!foo```.
61+
62+
If you agree with linklint's decisions, the Sphinx extension is a better
63+
option, since it doesn't require changing the source files, and doesn't
64+
hard-code the decisions.
65+
66+
1167
Changes
1268
=======
1369

14-
0.3.0 2026-02-28
15-
------------------
70+
v0.3.0 (2026-02-28)
71+
-------------------
1672

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

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

22-
0.2.0 2026-02-22
23-
------------------
78+
v0.2.0 (2026-02-22)
79+
-------------------
2480

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

28-
0.1.0 2026-02-21
29-
------------------
84+
v0.1.0 (2026-02-21)
85+
-------------------
3086

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

0 commit comments

Comments
 (0)