Skip to content

Commit 3d28774

Browse files
committed
Minor tweaks to docs configuration, and update reqs for it.
1 parent 877ed6d commit 3d28774

File tree

5 files changed

+52
-28
lines changed

5 files changed

+52
-28
lines changed

docs/conf.py

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
from pathlib import Path
21
import importlib.metadata
32
import re
43

54
from yarl import URL
65

7-
DOCS = Path(__file__).parent
8-
96
GITHUB = URL("https://github.com/")
107
HOMEPAGE = GITHUB / "python-jsonschema/referencing"
118

129
project = "referencing"
1310
author = "Julian Berman"
14-
copyright = "2022, " + author
11+
copyright = f"2022, {author}"
1512

1613
release = importlib.metadata.version("referencing")
1714
version = release.partition("-")[0]
@@ -28,10 +25,12 @@
2825
"sphinx.ext.intersphinx",
2926
"sphinx.ext.napoleon",
3027
"sphinx.ext.todo",
28+
"sphinx.ext.viewcode",
3129
"sphinx_click",
3230
"sphinx_copybutton",
3331
"sphinx_json_schema_spec",
3432
"sphinxcontrib.spelling",
33+
"sphinxext.opengraph",
3534
]
3635

3736
pygments_style = "lovelace"
@@ -73,20 +72,31 @@ def setup(app):
7372
app.connect("missing-reference", _resolve_broken_refs)
7473

7574

76-
# -- Extension configuration -------------------------------------------------
75+
def entire_domain(host):
76+
return r"http.?://" + re.escape(host) + r"($|/.*)"
77+
78+
79+
linkcheck_ignore = [
80+
entire_domain("img.shields.io"),
81+
f"{GITHUB}.*#.*",
82+
str(HOMEPAGE / "actions"),
83+
str(HOMEPAGE / "workflows/CI/badge.svg"),
84+
]
85+
86+
# = Extensions =
7787

78-
# -- Options for autodoc extension -------------------------------------------
88+
# -- autodoc --
7989

8090
autodoc_default_options = {
8191
"members": True,
8292
"member-order": "bysource",
8393
}
8494

85-
# -- Options for autosectionlabel extension ----------------------------------
95+
# -- autosectionlabel --
8696

8797
autosectionlabel_prefix_document = True
8898

89-
# -- Options for intersphinx extension ---------------------------------------
99+
# -- intersphinx --
90100

91101
intersphinx_mapping = {
92102
"hatch": ("https://hatch.pypa.io/latest/", None),
@@ -98,7 +108,7 @@ def setup(app):
98108
"setuptools": ("https://setuptools.pypa.io/en/latest/", None),
99109
}
100110

101-
# -- Options for extlinks extension ------------------------------------------
111+
# -- extlinks --
102112

103113
extlinks = {
104114
"gh": (str(HOMEPAGE) + "/%s", None),
@@ -107,21 +117,7 @@ def setup(app):
107117
"httpx": ("https://www.python-httpx.org/%s", None),
108118
}
109119

110-
# -- Options for the linkcheck builder ---------------------------------------
111-
112-
113-
def entire_domain(host):
114-
return r"http.?://" + re.escape(host) + r"($|/.*)"
115-
116-
117-
linkcheck_ignore = [
118-
entire_domain("codecov.io"),
119-
entire_domain("img.shields.io"),
120-
f"{GITHUB}.*#.*",
121-
str(HOMEPAGE / "actions"),
122-
str(HOMEPAGE / "python-jsonschema/workflows/CI/badge.svg"),
123-
]
124-
125-
# -- Options for spelling extension ------------------------------------------
120+
# -- sphinxcontrib-spelling --
126121

122+
spelling_word_list_filename = "spelling-wordlist.txt"
127123
spelling_show_suggestions = True

docs/requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ sphinx-copybutton
66
sphinx-json-schema-spec
77
sphinx>5
88
sphinxcontrib-spelling>5
9+
sphinxext-opengraph
910
yarl

docs/requirements.txt

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ charset-normalizer==3.1.0
1818
# via requests
1919
click==8.1.3
2020
# via sphinx-click
21+
contourpy==1.0.7
22+
# via matplotlib
23+
cycler==0.11.0
24+
# via matplotlib
2125
docutils==0.19
2226
# via
2327
# sphinx
2428
# sphinx-click
29+
fonttools==4.39.2
30+
# via matplotlib
2531
furo==2022.12.7
2632
# via -r docs/requirements.in
2733
idna==3.4
@@ -32,14 +38,26 @@ imagesize==1.4.1
3238
# via sphinx
3339
jinja2==3.1.2
3440
# via sphinx
41+
kiwisolver==1.4.4
42+
# via matplotlib
3543
lxml==4.9.2
3644
# via sphinx-json-schema-spec
3745
markupsafe==2.1.2
3846
# via jinja2
47+
matplotlib==3.7.1
48+
# via sphinxext-opengraph
3949
multidict==6.0.4
4050
# via yarl
51+
numpy==1.24.2
52+
# via
53+
# contourpy
54+
# matplotlib
4155
packaging==23.0
42-
# via sphinx
56+
# via
57+
# matplotlib
58+
# sphinx
59+
pillow==9.4.0
60+
# via matplotlib
4361
pyenchant==3.2.2
4462
# via sphinxcontrib-spelling
4563
pygments==2.14.0
@@ -49,12 +67,18 @@ pygments==2.14.0
4967
# sphinx
5068
pygments-github-lexers==0.0.5
5169
# via -r docs/requirements.in
70+
pyparsing==3.0.9
71+
# via matplotlib
72+
python-dateutil==2.8.2
73+
# via matplotlib
5274
file:.#egg=referencing
5375
# via -r docs/requirements.in
5476
requests==2.28.2
5577
# via sphinx
56-
rpds-py==0.7.0
78+
rpds-py==0.7.1
5779
# via referencing
80+
six==1.16.0
81+
# via python-dateutil
5882
snowballstemmer==2.2.0
5983
# via sphinx
6084
soupsieve==2.4
@@ -68,6 +92,7 @@ sphinx==6.1.3
6892
# sphinx-copybutton
6993
# sphinx-json-schema-spec
7094
# sphinxcontrib-spelling
95+
# sphinxext-opengraph
7196
sphinx-basic-ng==1.0.0b1
7297
# via furo
7398
sphinx-click==4.4.0
@@ -90,6 +115,8 @@ sphinxcontrib-serializinghtml==1.1.5
90115
# via sphinx
91116
sphinxcontrib-spelling==8.0.0
92117
# via -r docs/requirements.in
118+
sphinxext-opengraph==0.8.1
119+
# via -r docs/requirements.in
93120
urllib3==1.26.15
94121
# via requests
95122
yarl==1.8.2
File renamed without changes.

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ pytest-subtests==0.10.0
2323
# via -r test-requirements.in
2424
file:.#egg=referencing
2525
# via -r test-requirements.in
26-
rpds-py==0.7.0
26+
rpds-py==0.7.1
2727
# via referencing

0 commit comments

Comments
 (0)