[libc-commits] [libc] [llvm] [libc][docs] add redirect for math/index.html (PR #120274)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Tue Dec 17 09:37:07 PST 2024
https://github.com/nickdesaulniers updated https://github.com/llvm/llvm-project/pull/120274
>From 811f689bfb655d6a20b50a507af338bf78a44faf Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Tue, 17 Dec 2024 09:28:46 -0800
Subject: [PATCH 1/2] [libc][docs] add redirect for math/index.html
commit a9aff440d9dd ("[libc][docs] reorganize documentation (#118836)")
moved https://libc.llvm.org/math/index.html to
https://libc.llvm.org/headers/math/index.html which makes links from various
slide decks stale.
There's an extension for sphinx that can generate redirects. Add a dependency
on that, then use it to create a redirect so that those older links still work.
I was able to install this sphinx extension via:
$ sudo apt install python3-sphinx-reredirects
We may need to install this on whatever server generates the llvm
documentation.
---
libc/docs/conf.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/libc/docs/conf.py b/libc/docs/conf.py
index 502a479b3eb2c5..ca4b5e25f5dffc 100644
--- a/libc/docs/conf.py
+++ b/libc/docs/conf.py
@@ -25,7 +25,11 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ["sphinx.ext.intersphinx", "sphinx.ext.todo"]
+extensions = [
+ "sphinx.ext.intersphinx",
+ "sphinx.ext.todo",
+ "sphinx_reredirects"
+]
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
@@ -261,3 +265,7 @@
# Enable this if you want TODOs to show up in the generated documentation.
todo_include_todos = True
+
+redirects = {
+ "math/index": "../headers/math/index.html"
+}
>From de04d160c94924727792f51184cf6326a4519975 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Tue, 17 Dec 2024 09:36:54 -0800
Subject: [PATCH 2/2] update requirements.txt
---
llvm/docs/requirements.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/docs/requirements.txt b/llvm/docs/requirements.txt
index 960a6eb644e143..b97743b0edd2ef 100644
--- a/llvm/docs/requirements.txt
+++ b/llvm/docs/requirements.txt
@@ -5,5 +5,6 @@ recommonmark==0.7.1
sphinx-automodapi==0.17.0
sphinx-bootstrap-theme==0.8.1
sphinxcontrib-applehelp==1.0.8
+sphinx-redirects==0.1.2
furo==2024.1.29
myst-parser==2.0.0
More information about the libc-commits
mailing list