{"id":26956216,"url":"https://github.com/sphinx-doc/sphinxext-rediraffe","last_synced_at":"2026-03-12T15:03:47.943Z","repository":{"id":45183737,"uuid":"285852299","full_name":"sphinx-doc/sphinxext-rediraffe","owner":"sphinx-doc","description":"Sphinx extension to redirect files","archived":false,"fork":false,"pushed_at":"2025-09-28T15:31:27.000Z","size":1044,"stargazers_count":39,"open_issues_count":9,"forks_count":16,"subscribers_count":11,"default_branch":"0.x","last_synced_at":"2026-02-12T21:52:30.847Z","etag":null,"topics":["sphinx-extension"],"latest_commit_sha":null,"homepage":"https://sphinxext-rediraffe.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sphinx-doc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-07T14:44:38.000Z","updated_at":"2025-12-13T15:33:47.000Z","dependencies_parsed_at":"2023-12-30T06:23:54.661Z","dependency_job_id":"9b85bdb3-0ff0-434f-b1cc-c307c008ae29","html_url":"https://github.com/sphinx-doc/sphinxext-rediraffe","commit_stats":{"total_commits":31,"total_committers":6,"mean_commits":5.166666666666667,"dds":0.4516129032258065,"last_synced_commit":"d8961c2402015dafa6039ed27d973ad835d7fc09"},"previous_names":["sphinx-doc/sphinxext-rediraffe"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/sphinx-doc/sphinxext-rediraffe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-doc%2Fsphinxext-rediraffe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-doc%2Fsphinxext-rediraffe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-doc%2Fsphinxext-rediraffe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-doc%2Fsphinxext-rediraffe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sphinx-doc","download_url":"https://codeload.github.com/sphinx-doc/sphinxext-rediraffe/tar.gz/refs/heads/0.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-doc%2Fsphinxext-rediraffe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30429312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sphinx-extension"],"created_at":"2025-04-03T03:11:38.765Z","updated_at":"2026-03-12T15:03:47.505Z","avatar_url":"https://github.com/sphinx-doc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sphinxext-rediraffe\n![ci](https://github.com/wpilibsuite/sphinxext-rediraffe/workflows/ci/badge.svg)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nSphinx Extension to redirect files\n\n![Rediraffe](assets/rediraffe_logo.svg)\n\nThis sphinx extension redirects non-existent pages to working pages.\nRediraffe can also check that deleted/renamed files in your git repo are redirected.\n\nRediraffe 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.\n\nNote: Rediraffe supports the html and dirhtml builders.\n\n## Installation\n\n`python -m pip install sphinxext-rediraffe`\n\n\n## Usage\nAdd `sphinxext.rediraffe` to your extensions list in your `conf.py`\n\n```python\nextensions = [\n   \"sphinxext.rediraffe\",\n]\n```\n\nSet `rediraffe_redirects` to a dict or file of redirects in your `conf.py`\n\n### Diff Checker\nThe diff checker ensures that deleted/renamed files in your git repo are in your redirects.\n\nTo run the diff checker,\n1. Set `rediraffe_branch` and `rediraffe_redirects` in conf.py.\n2. Run the `rediraffecheckdiff` builder.\n\n### Auto Redirect builder\nThe auto redirect builder can be used to automatically add renamed files to your redirects file. Simply run the `rediraffewritediff` builder.\n\nTo run the auto redirecter:\n1. Set `rediraffe_branch` and `rediraffe_redirects` in conf.py.\n2. Run the `rediraffewritediff` builder.\n\nNote: The auto redirect builder only works with a configuration file.\nNote: Deleted files cannot be added to your redirects file automatically.\n\n## Options\nThese values are placed in the conf.py of your sphinx project.\n\n* `rediraffe_branch`\n    * Required for the `rediraffecheckdiff` and `rediraffewritediff` builders. The branch or commit to diff against.\n\n* `rediraffe_redirects`\n    * Required. A filename or dict containing redirects\n\n* `rediraffe_template`\n    * Optional. A jinja template to use to render the inserted redirecting files. If not specified, a default template will be used. This template will only be accessed after the html/htmldir builder is finished; Therefore, this file may be generated as part of your build.\n    * variables available to rediraffe_template:\n        * `from_file` - the file being redirected as written in rediraffe_redirects.\n        * `to_file` - the destination file that from_file is redirected to as written in rediraffe_redirects.\n        * `from_url` - the path to from_url's html file (built by rediraffe) relative to the outdir.\n        * `to_url` - the path to to_url's built html file relative to the outdir.\n        * `rel_url` - the relative path from from_url to to_url.\n\n* `rediraffe_auto_redirect_perc`\n    * 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.\n\n## Example Config\n\n### redirects only (file)\n\nconf.py:\n```python\nrediraffe_redirects = \"redirects.txt\"\n```\n\nredirects.txt:\n```\n# comments start with \"#\"\n\"another file.rst\" index.rst\nanother2.rst 'another file.rst'\n```\n\nNote: Filepaths can be wrapped in quotes (single or double).\nThis is especially useful for filepaths containing spaces.\n\n### redirects only (dict)\n\nconf.py:\n```python\nrediraffe_redirects = {\n    \"another.rst\": \"index.rst\",\n    \"another2.rst\": \"another.rst\",\n}\n```\n\n### redirects + diff checker\n\nconf.py:\n```python\nrediraffe_redirects = \"redirects.txt\"\nrediraffe_branch = \"main~1\"\n```\n\n### redirects with jinja template\n\nconf.py:\n```python\nrediraffe_redirects = \"redirects.txt\"\nrediraffe_template = \"template.html\"\n```\n\ntemplate.html:\n```html\n\u003chtml\u003e\n    \u003cbody\u003e\n        \u003cp\u003eYour destination is {{to_url}}\u003c/p\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\nA complex example can be found at tests/roots/ext/.\n\n## Testing\n\nRediraffe uses pytest for testing.\nTo run tests:\n1. Install this package\n2. Install test dependencies\n    ```bash\n    python -m pip install -r test-requirements.txt\n    ```\n3. Navigate to the tests directory and run\n    ```bash\n    python -m pytest --headless\n    ```\n\nThe `--headless` flag ensures that a browser window does not open during browser backed selenium testing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsphinx-doc%2Fsphinxext-rediraffe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsphinx-doc%2Fsphinxext-rediraffe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsphinx-doc%2Fsphinxext-rediraffe/lists"}