Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Replace dependency sphinx-issues with builtin sphinx.ext.extlinks #7016

Merged
merged 7 commits into from
Mar 22, 2023

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Mar 15, 2023

I recently discovered (from zoneinfo) that Sphinx comes with a builtin sphinx.ext.extlinks extension.

With some minimal config, it essentially does the same as sphinx-issues, so we can remove a dependency and install less, and easily add more roles if desired:

# sphinx.ext.extlinks
# This config is a dictionary of external sites,
# mapping unique short aliases to a base URL and a prefix.
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
_repo = "https://github.com/python-pillow/Pillow/"
extlinks = {
    "cve": ("https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-%s", "CVE-%s"),
    "cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
    "issue": (_repo + "issues/%s", "#%s"),
    "pr": (_repo + "pull/%s", "#%s"),
}

Also add a make htmlview target, which I'm familiar with from the CPython repos: it builds the docs and opens index.html in the browser.

And add the make html target as an alias for make doc: it's already in the help but not implemented.

@hugovk hugovk changed the title Replace dependency sphinx-issues with builtin sphinx.ext.extlinks Docs: Replace dependency sphinx-issues with builtin sphinx.ext.extlinks Mar 15, 2023
Makefile Outdated Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
docs/make.bat Outdated Show resolved Hide resolved
hugovk and others added 2 commits March 21, 2023 14:02
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@radarhere radarhere merged commit 7700840 into python-pillow:main Mar 22, 2023
@hugovk hugovk deleted the docs-replace-sphinx-issues branch March 22, 2023 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants