Skip to content

Commit ab54225

Browse files
authored
Refactor readme (#34)
1 parent 1e6b344 commit ab54225

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Sphinx Extension to redirect files
77
![Rediraffe](assets/rediraffe_logo.svg)
88

99
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.
1111

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.
1313

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.
1515

1616
## Installation
1717

@@ -23,16 +23,25 @@ Add `sphinxext.rediraffe` to your extensions list in your `conf.py`
2323

2424
```python
2525
extensions = [
26-
sphinxext.rediraffe,
26+
"sphinxext.rediraffe",
2727
]
2828
```
2929

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.
3237
2. Run the `rediraffecheckdiff` builder.
3338

3439
### 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.
3645

3746
Note: The auto redirect builder only works with a configuration file.
3847
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.
4150
These values are placed in the conf.py of your sphinx project.
4251

4352
* `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.
4554

4655
* `rediraffe_redirects`
4756
* Required. A filename or dict containing redirects
@@ -56,7 +65,7 @@ These values are placed in the conf.py of your sphinx project.
5665
* `rel_url` - the relative path from from_url to to_url.
5766

5867
* `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.
6069

6170
## Example Config
6271

0 commit comments

Comments
 (0)