Lower-case the url from extlinks

8 views
Skip to first unread message

Rafael Fontenelle

unread,
Aug 13, 2024, 8:06:16 AM8/13/24
to sphinx-users
Consider a conf.py with:

extlinks = {
  "pypi": ("https://pypi.org/project/%s/", "%s"),
}

Using a Python package in lowercase or not will both works to generate a valid PyPI url.  For instance, a role :pypi:`Babel` will generate the url https://pypi.org/project/Babel, which is redirect permanently to https://pypi.org/project/babel

However, linkcheck builder will report a redirect from non-lowercase -> lowercase form. Instead of adding an exception in conf.py, I was wondering if I can lowercase the package name in the URL, to avoid such redirect. For instance, :role:`Babel` result in https://pypi.org/project/babel

Any suggestions?

Reply all
Reply to author
Forward
0 new messages