pax_global_header 0000666 0000000 0000000 00000000064 14036271711 0014514 g ustar 00root root 0000000 0000000 52 comment=09516f0df9fb63559de2c0828e216e912c01a443 sphinxext-rediraffe-0.2.7/ 0000775 0000000 0000000 00000000000 14036271711 0015501 5 ustar 00root root 0000000 0000000 sphinxext-rediraffe-0.2.7/.github/ 0000775 0000000 0000000 00000000000 14036271711 0017041 5 ustar 00root root 0000000 0000000 sphinxext-rediraffe-0.2.7/.github/workflows/ 0000775 0000000 0000000 00000000000 14036271711 0021076 5 ustar 00root root 0000000 0000000 sphinxext-rediraffe-0.2.7/.github/workflows/ci.yml 0000664 0000000 0000000 00000005074 14036271711 0022222 0 ustar 00root root 0000000 0000000 name: ci on: [push, pull_request] jobs: check-format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python 3.8 uses: actions/setup-python@v2 with: python-version: 3.8 - uses: pre-commit/action@v2.0.0 test: name: "Build (${{ matrix.os }} Python ${{ matrix.python-version }})" runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.6', '3.7', '3.8', '3.9'] steps: - uses: actions/checkout@v2 - name: Setup Python uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dev dependencies shell: bash run: | set -xe python -VV python -m site python -m pip install --upgrade pip setuptools wheel python -m pip install -r dev-requirements.txt - name: Build wheel run: | python setup.py bdist_wheel - name: Install wheel shell: bash run: | python -m pip install dist/*.whl - name: Install test dependencies run: | python -m pip install -r test-requirements.txt - name: Find Chrome Location if : ${{ matrix.os == 'windows-latest' }} run: | if not exist "C:\Program Files (x86)\Google" mkdir "C:\Program Files (x86)\Google" if not exist "C:\Program Files (x86)\Google\Chrome" mkdir "C:\Program Files (x86)\Google\Chrome" mklink /D "C:\Program Files (x86)\Google\Chrome\Application" "C:\Program Files\Google\Chrome\Application" shell: cmd - name: Run Tests run: | cd tests python -m pytest -vv --headless pypi-release: if: startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'wpilibsuite' needs: test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.7' - name: Install Dependencies run: | python -m pip install --upgrade pip setuptools wheel python -m pip install -r dev-requirements.txt - name: Build PyPI Wheel run: | python setup.py sdist python setup.py bdist_wheel - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@master with: user: __token__ password: ${{ secrets.pypi_password }} sphinxext-rediraffe-0.2.7/.gitignore 0000664 0000000 0000000 00000006651 14036271711 0017501 0 ustar 00root root 0000000 0000000 # Created by https://www.toptal.com/developers/gitignore/api/python,linux,windows,macos,visualstudiocode # Edit at https://www.toptal.com/developers/gitignore?templates=python,linux,windows,macos,visualstudiocode ### Linux ### *~ # temporary files which can be created if a process still has a handle open of a deleted file .fuse_hidden* # KDE directory preferences .directory # Linux trash folder which might appear on any partition or disk .Trash-* # .nfs files are created when an open file is removed but is still being accessed .nfs* ### macOS ### # General .DS_Store .AppleDouble .LSOverride # Icon must end with two \r Icon # Thumbnails ._* # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk ### Python ### # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ pip-wheel-metadata/ share/python-wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover *.py,cover .hypothesis/ .pytest_cache/ pytestdebug.log # Translations *.mo *.pot # Django stuff: *.log local_settings.py db.sqlite3 db.sqlite3-journal # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ doc/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # IPython profile_default/ ipython_config.py # pyenv .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. # However, in case of collaboration, if having platform-specific dependencies or dependencies # having no cross-platform support, pipenv may install dependencies that don't work, or not # install all needed dependencies. #Pipfile.lock # PEP 582; used by e.g. github.com/David-OConnor/pyflow __pypackages__/ # Celery stuff celerybeat-schedule celerybeat.pid # SageMath parsed files *.sage.py # Environments .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ .dmypy.json dmypy.json # Pyre type checker .pyre/ # pytype static type analyzer .pytype/ ### VisualStudioCode ### .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json *.code-workspace ### VisualStudioCode Patch ### # Ignore all local history of files .history ### Windows ### # Windows thumbnail cache files Thumbs.db Thumbs.db:encryptable ehthumbs.db ehthumbs_vista.db # Dump file *.stackdump # Folder config file [Dd]esktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Windows Installer files *.cab *.msi *.msix *.msm *.msp # Windows shortcuts *.lnk # VS Code config .vscode/ # End of https://www.toptal.com/developers/gitignore/api/python,linux,windows,macos,visualstudiocode sphinxext-rediraffe-0.2.7/.pre-commit-config.yaml 0000664 0000000 0000000 00000000662 14036271711 0021766 0 ustar 00root root 0000000 0000000 # Install pre-commit hooks via # pre-commit install repos: # - repo: git://github.com/pre-commit/pre-commit-hooks # rev: v2.2.3 # hooks: # - id: check-json # - id: check-yaml # - id: end-of-file-fixer # - id: trailing-whitespace # - repo: https://gitlab.com/pycqa/flake8 # rev: 3.7.9 # hooks: # - id: flake8 - repo: https://github.com/psf/black rev: 20.8b1 hooks: - id: black sphinxext-rediraffe-0.2.7/LICENSE.md 0000664 0000000 0000000 00000002057 14036271711 0017111 0 ustar 00root root 0000000 0000000 MIT License Copyright (c) 2020 Vasista Vovveti Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. sphinxext-rediraffe-0.2.7/MANIFEST.in 0000664 0000000 0000000 00000000023 14036271711 0017232 0 ustar 00root root 0000000 0000000 include LICENSE.md sphinxext-rediraffe-0.2.7/README.md 0000664 0000000 0000000 00000010501 14036271711 0016755 0 ustar 00root root 0000000 0000000 # sphinxext-rediraffe  [](https://github.com/psf/black) Sphinx Extension to redirect files  This sphinx extension redirects non-existent pages to working pages. Rediraffe can also check that deleted/renamed files in your git repo are redirected. 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. Note: Rediraffe supports the html and dirhtml builders. ## Installation `python -m pip install sphinxext-rediraffe` ## Usage Add `sphinxext.rediraffe` to your extensions list in your `conf.py` ```python extensions = [ "sphinxext.rediraffe", ] ``` Set `rediraffe_redirects` to a dict or file of redirects in your `conf.py` ### Diff Checker The diff checker ensures that deleted/renamed files in your git repo are in your redirects. To run the diff checker, 1. Set `rediraffe_branch` and `rediraffe_redirects` in conf.py. 2. Run the `rediraffecheckdiff` builder. ### Auto Redirect builder The auto redirect builder can be used to automatically add renamed files to your redirects file. Simply run the `rediraffewritediff` builder. To run the auto redirecter: 1. Set `rediraffe_branch` and `rediraffe_redirects` in conf.py. 2. Run the `rediraffewritediff` builder. Note: The auto redirect builder only works with a configuration file. Note: Deleted files cannot be added to your redirects file automatically. ## Options These values are placed in the conf.py of your sphinx project. * `rediraffe_branch` * Required for the `rediraffecheckdiff` and `rediraffewritediff` builders. The branch or commit to diff against. * `rediraffe_redirects` * Required. A filename or dict containing redirects * `rediraffe_template` * 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. * variables available to rediraffe_template: * `from_file` - the file being redirected as written in rediraffe_redirects. * `to_file` - the destination file that from_file is redirected to as written in rediraffe_redirects. * `from_url` - the path to from_url's html file (built by rediraffe) relative to the outdir. * `to_url` - the path to to_url's built html file relative to the outdir. * `rel_url` - the relative path from from_url to to_url. * `rediraffe_auto_redirect_perc` * 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. ## Example Config ### redirects only (file) conf.py: ```python rediraffe_redirects = "redirects.txt" ``` redirects.txt: ``` # comments start with "#" "another file.rst" index.rst another2.rst 'another file.rst' ``` Note: Filepaths can be wrapped in quotes (single or double). This is especially useful for filepaths containing spaces. ### redirects only (dict) conf.py: ```python rediraffe_redirects = { "another.rst": "index.rst", "another2.rst": "another.rst", } ``` ### redirects + diff checker conf.py: ```python rediraffe_redirects = "redirects.txt" rediraffe_branch = "main~1" ``` ### redirects with jinja template conf.py: ```python rediraffe_redirects = "redirects.txt" rediraffe_template = "template.html" ``` template.html: ```html
Your destination is {{to_url}}
``` A complex example can be found at tests/roots/ext/. ## Testing Rediraffe uses pytest for testing. To run tests: 1. Install this package 2. Install test dependencies ```bash python -m pip install -r test-requirements.txt ``` 3. Navigate to the tests directory and run ```bash python -m pytest --headless ``` The `--headless` flag ensures that a browser window does not open during browser backed selenium testing. sphinxext-rediraffe-0.2.7/assets/ 0000775 0000000 0000000 00000000000 14036271711 0017003 5 ustar 00root root 0000000 0000000 sphinxext-rediraffe-0.2.7/assets/rediraffe_logo.svg 0000664 0000000 0000000 00000007502 14036271711 0022477 0 ustar 00root root 0000000 0000000 sphinxext-rediraffe-0.2.7/assets/rediraffe_logo_1024.png 0000664 0000000 0000000 00000345671 14036271711 0023146 0 ustar 00root root 0000000 0000000 PNG IHDR y G|> pHYs ?= ?=Iu= tEXtSoftware www.inkscape.org< IDATxyTՙ7߹zWzzgG"j*nh-NLIf;N::m &!3u[Dphh꽻z{?0cDY֭|(4yQ8f咊͜*L2PR! EB]QI(2MBQd$TRDGH` $',cR_H9 0! -4bPQŠLni)""""F@DDmCQu2+ U RxG K.!@('^ @B B$`՞]0Q4c( eJ1bh@$ pX_ th AdHUPMfhDDDDb( \U(IUz&J X .1AI@D8Cֶ1+$""" DDgiCQu:R T@J JIT<;OC C8(4q@1? DD2WUJBU\'! ~}R7:.L@D!חxrr`&48Q] v]R*:btQDDDDwE"Jhk]9yr`:?$ v.xFEDDD=Ҭ*Cb1,<Ղ1ȷ!h;HFEDDDD.)3OJy J`!ҍLɢpj o=袈(&@i.wФLp]:C>fORbTמ߹|IQ!ŴեYS]Ob 3L> l S]>QLPTdL[hER" LD#]>FxMEԞftADDD{nHDQouyN@pаB ,`3O"q-{+R ċx