You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-9Lines changed: 18 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ Sphinx Extension to redirect files
7
7

8
8
9
9
This sphinx extension redirects non-existent pages to working pages.
10
-
Additionally, a builder is provided to check that deleted/renamed files in your git repo are redirected.
10
+
Rediraffe can also check that deleted/renamed files in your git repo are redirected.
11
11
12
-
Rediraffe supports the html and dirhtml builders.
12
+
Rediraffe creates a graph of all specified redirects and traverses it to point all internal urls to leaf urls. This means that chained redirects will be resolved. For example, if a config has 6 chained redirects, all 6 links will redirect directly to the final link. The end user will never experience more than 1 redirection.
13
13
14
-
Note: Chained redirects will be resolved. For example, if a config has 6 chained redirects, all 6 links will redirect directly to the final link. The end user will never experience more than 1 redirection.
14
+
Note: Rediraffe supports the html and dirhtml builders.
15
15
16
16
## Installation
17
17
@@ -23,16 +23,25 @@ Add `sphinxext.rediraffe` to your extensions list in your `conf.py`
23
23
24
24
```python
25
25
extensions = [
26
-
sphinxext.rediraffe,
26
+
"sphinxext.rediraffe",
27
27
]
28
28
```
29
29
30
-
To check that deleted/renamed files in your git repo are in your redirects,
31
-
1. Make sure `rediraffe_branch` and `rediraffe_redirects` are set in conf.py.
30
+
Set `rediraffe_redirects` to a dict or file of redirects in your `conf.py`
31
+
32
+
### Diff Checker
33
+
The diff checker ensures that deleted/renamed files in your git repo are in your redirects.
34
+
35
+
To run the diff checker,
36
+
1. Set `rediraffe_branch` and `rediraffe_redirects` in conf.py.
32
37
2. Run the `rediraffecheckdiff` builder.
33
38
34
39
### Auto Redirect builder
35
-
For convenience, the auto redirect builder can be used to automatically add renamed files to your redirects file. Simply run the `rediraffewritediff` builder.
40
+
The auto redirect builder can be used to automatically add renamed files to your redirects file. Simply run the `rediraffewritediff` builder.
41
+
42
+
To run the auto redirecter:
43
+
1. Set `rediraffe_branch` and `rediraffe_redirects` in conf.py.
44
+
2. Run the `redireaffewritediff` builder.
36
45
37
46
Note: The auto redirect builder only works with a configuration file.
38
47
Note: Deleted files cannot be added to your redirects file automatically.
@@ -41,7 +50,7 @@ Note: Deleted files cannot be added to your redirects file automatically.
41
50
These values are placed in the conf.py of your sphinx project.
42
51
43
52
*`rediraffe_branch`
44
-
* Required for rediraffecheckdiff builder. The branch or commit to diff against.
53
+
* Required for the `rediraffecheckdiff` and `rediraffewritediff` builders. The branch or commit to diff against.
45
54
46
55
*`rediraffe_redirects`
47
56
* Required. A filename or dict containing redirects
@@ -56,7 +65,7 @@ These values are placed in the conf.py of your sphinx project.
56
65
*`rel_url` - the relative path from from_url to to_url.
57
66
58
67
*`rediraffe_auto_redirect_perc`
59
-
* Optional. The percentage as an integer representing the accuracy required before auto redirecting with the `rediraffewritediff` builder. The default is 100.
68
+
* Optional. Only used by the `rediraffewritediff` builder. The percentage as an integer representing the accuracy required before auto redirecting with the `rediraffewritediff` builder. The default is 100.
0 commit comments