Skip to content

Commit

Permalink
[doc] Redirect the redirected link for single file
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed May 18, 2022
1 parent dd85e47 commit 7640454
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,33 @@


# Single file redirects are handled in this file and can be done by a pylint
# contributor if no englobing full directory redirect is applied first. See:
# contributor See:
# https://documatt.gitlab.io/sphinx-reredirects/usage.html
# Directory redirects are handled in ReadTheDoc admin interface and can only be done
# by pylint maintainers at the following URL:
# https://readthedocs.org/dashboard/pylint/redirects/
DIRECTORY_REDIRECT = [
# This list has no effect it must be manually updated from the Read the doc conf
"messages/",
# If an englobing full directory redirect is applied first then it's impossible to
# redirect a single link directly. For this you'll need to redirect the redirected link.
# I.e. 'messages/old => messages/another_dir/new.html' is impossible.
# But you can do 'messages/another_dir/old => messages/another_dir/new.html'
]
redirects: dict[str, str] = {
# "<source>": "<target>"
"intro": "index.html",
"support": "contact.html",
"user_guide/ide-integration": "installation.html",
"user_guide/message-control": "user_guide/messages/message_control.html",
"user_guide/messages/messages_introduction": "user_guide/messages/index.html",
"user_guide/messages/messages_list": "user_guide/messages/messages_overview.html",
"additional_commands/index": "user_guide/additional_commands/index.html",
}
for m in redirects:
for r in DIRECTORY_REDIRECT:
assert not m.startswith(r), (
f"Redirection will silentely fail: '{m}' start with '{r}' and "
f"Redirection will silently fail: '{m}' start with '{r}' and "
"the whole directory is redirected by ReadtheDoc conf already."
)

Expand Down

0 comments on commit 7640454

Please sign in to comment.