Skip to content

Commit

Permalink
[libc][docs] add redirect for math/index.html (#120274)
Browse files Browse the repository at this point in the history
commit a9aff44 ("[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.
  • Loading branch information
nickdesaulniers authored Dec 17, 2024
1 parent 1c16807 commit 4c5ddc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libc/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# 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"]
Expand Down Expand Up @@ -261,3 +261,5 @@

# Enable this if you want TODOs to show up in the generated documentation.
todo_include_todos = True

redirects = {"math/index": "../headers/math/index.html"}
1 change: 1 addition & 0 deletions llvm/docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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-reredirects==0.1.2
furo==2024.1.29
myst-parser==2.0.0

0 comments on commit 4c5ddc9

Please sign in to comment.