From 8c4e6aa4c0436c9e390442333d6d07d33af00649 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sun, 22 Mar 2026 09:31:21 +0100 Subject: [PATCH] docs: delete now-unused html_redirects extension Part-of: --- docs/_exts/redirects.py | 50 ----------------------------------------- docs/conf.py | 4 ---- 2 files changed, 54 deletions(-) delete mode 100644 docs/_exts/redirects.py diff --git a/docs/_exts/redirects.py b/docs/_exts/redirects.py deleted file mode 100644 index 029720c5407..00000000000 --- a/docs/_exts/redirects.py +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright © 2020-2021 Collabora Ltd -# -# 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. - -import os -import pathlib -from urllib.parse import urlparse - - -def create_redirect(dst): - tpl = '' - return tpl.format(dst) - - -def create_redirects(app, exception): - if exception is not None or not app.builder.name == 'html': - return - for src, dst in app.config.html_redirects: - path = os.path.join(app.outdir, '{0}.html'.format(src)) - - os.makedirs(os.path.dirname(path), exist_ok=True) - - if urlparse(dst).scheme == "": - dst = pathlib.posixpath.relpath(dst, start=os.path.dirname(src)) - if not os.path.isfile(os.path.join(os.path.dirname(path), dst)): - raise Exception('{0} does not exitst'.format(dst)) - - with open(path, 'w') as f: - f.write(create_redirect(dst)) - - -def setup(app): - app.add_config_value('html_redirects', [], '') - app.connect('build-finished', create_redirects) diff --git a/docs/conf.py b/docs/conf.py index 57af3f8777b..9165ffc2aab 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -44,7 +44,6 @@ extensions = [ 'formatting', 'hawkmoth', 'nir', - 'redirects', 'sphinx.ext.graphviz', ] @@ -123,9 +122,6 @@ html_extra_path = [ 'README.VCE', ] -html_redirects = [ -] - # -- Options for linkcheck ------------------------------------------------