Skip to content

Commit 47e18d9

Browse files
authored
Replace custom roles with styled extlinks (#1351)
1 parent 6ee39a9 commit 47e18d9

File tree

6 files changed

+16
-53
lines changed

6 files changed

+16
-53
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ indent_size = 4
1111
[*.rst]
1212
indent_size = 3
1313

14-
[*.yml]
14+
[*.{css,yml}]
1515
indent_size = 2

_extensions/custom_roles.py

-43
This file was deleted.

_static/devguide_overrides.css

+10-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
.release-cycle-chart .release-cycle-blob {
4040
stroke-width: 1.6px;
41-
/* default colours, overriden below for individual statuses */
41+
/* default colours, overridden below for individual statuses */
4242
fill: var(--color-background-primary);
4343
stroke: var(--color-foreground-primary);
4444
}
@@ -85,3 +85,12 @@
8585
.bad pre {
8686
border-left: 3px solid rgb(244, 76, 78);
8787
}
88+
89+
.extlink-cpy-file,
90+
.extlink-gh-label {
91+
border: 1px solid var(--color-background-border);
92+
border-radius: .2em;
93+
font-family: var(--font-stack--monospace);
94+
font-size: var(--font-size--small--2);
95+
padding: .1em .2em;
96+
}

conf.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
import os
2-
import sys
31
import time
42

5-
# Location of custom extensions.
6-
sys.path.insert(0, os.path.abspath(".") + "/_extensions")
7-
83
extensions = [
9-
'custom_roles',
104
'notfound.extension',
115
'sphinx.ext.extlinks',
126
'sphinx.ext.intersphinx',
@@ -176,7 +170,10 @@
176170
# This config is a dictionary of external sites,
177171
# mapping unique short aliases to a base URL and a prefix.
178172
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
173+
_repo = "https://github.com/python/cpython"
179174
extlinks = {
175+
"cpy-file": (f"{_repo}/blob/main/%s", "%s"),
176+
"gh-label": (f"{_repo}/labels/%s", "%s"),
180177
"github": ("https://github.com/%s", "%s"),
181178
"github-user": ("https://github.com/%s", "@%s"),
182179
"pypi": ("https://pypi.org/project/%s/", "%s"),

internals/parser.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ parser (the one used by the interpreter) just execute: ::
537537

538538
make regen-pegen
539539

540-
using the :cpy-file:`!Makefile` in the main directory. If you are on Windows you can
540+
using the ``Makefile`` in the main directory. If you are on Windows you can
541541
use the Visual Studio project files to regenerate the parser or to execute: ::
542542

543543
./PCbuild/build.bat --regen

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ sphinx-notfound-page>=1.0.0
77
sphinx_copybutton>=0.3.3
88
sphinxext-opengraph>=0.7.1
99
sphinxext-rediraffe
10-
Sphinx~=7.3.7
10+
Sphinx~=7.4.0

0 commit comments

Comments
 (0)