Skip to content

Commit

Permalink
Minor tweaks to docs configuration, and update reqs for it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Mar 20, 2023
1 parent 877ed6d commit 3d28774
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 28 deletions.
46 changes: 21 additions & 25 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
from pathlib import Path
import importlib.metadata
import re

from yarl import URL

DOCS = Path(__file__).parent

GITHUB = URL("https://github.com/")
HOMEPAGE = GITHUB / "python-jsonschema/referencing"

project = "referencing"
author = "Julian Berman"
copyright = "2022, " + author
copyright = f"2022, {author}"

release = importlib.metadata.version("referencing")
version = release.partition("-")[0]
Expand All @@ -28,10 +25,12 @@
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx_click",
"sphinx_copybutton",
"sphinx_json_schema_spec",
"sphinxcontrib.spelling",
"sphinxext.opengraph",
]

pygments_style = "lovelace"
Expand Down Expand Up @@ -73,20 +72,31 @@ def setup(app):
app.connect("missing-reference", _resolve_broken_refs)


# -- Extension configuration -------------------------------------------------
def entire_domain(host):
return r"http.?://" + re.escape(host) + r"($|/.*)"


linkcheck_ignore = [
entire_domain("img.shields.io"),
f"{GITHUB}.*#.*",
str(HOMEPAGE / "actions"),
str(HOMEPAGE / "workflows/CI/badge.svg"),
]

# = Extensions =

# -- Options for autodoc extension -------------------------------------------
# -- autodoc --

autodoc_default_options = {
"members": True,
"member-order": "bysource",
}

# -- Options for autosectionlabel extension ----------------------------------
# -- autosectionlabel --

autosectionlabel_prefix_document = True

# -- Options for intersphinx extension ---------------------------------------
# -- intersphinx --

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

# -- Options for extlinks extension ------------------------------------------
# -- extlinks --

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

# -- Options for the linkcheck builder ---------------------------------------


def entire_domain(host):
return r"http.?://" + re.escape(host) + r"($|/.*)"


linkcheck_ignore = [
entire_domain("codecov.io"),
entire_domain("img.shields.io"),
f"{GITHUB}.*#.*",
str(HOMEPAGE / "actions"),
str(HOMEPAGE / "python-jsonschema/workflows/CI/badge.svg"),
]

# -- Options for spelling extension ------------------------------------------
# -- sphinxcontrib-spelling --

spelling_word_list_filename = "spelling-wordlist.txt"
spelling_show_suggestions = True
1 change: 1 addition & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ sphinx-copybutton
sphinx-json-schema-spec
sphinx>5
sphinxcontrib-spelling>5
sphinxext-opengraph
yarl
31 changes: 29 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ charset-normalizer==3.1.0
# via requests
click==8.1.3
# via sphinx-click
contourpy==1.0.7
# via matplotlib
cycler==0.11.0
# via matplotlib
docutils==0.19
# via
# sphinx
# sphinx-click
fonttools==4.39.2
# via matplotlib
furo==2022.12.7
# via -r docs/requirements.in
idna==3.4
Expand All @@ -32,14 +38,26 @@ imagesize==1.4.1
# via sphinx
jinja2==3.1.2
# via sphinx
kiwisolver==1.4.4
# via matplotlib
lxml==4.9.2
# via sphinx-json-schema-spec
markupsafe==2.1.2
# via jinja2
matplotlib==3.7.1
# via sphinxext-opengraph
multidict==6.0.4
# via yarl
numpy==1.24.2
# via
# contourpy
# matplotlib
packaging==23.0
# via sphinx
# via
# matplotlib
# sphinx
pillow==9.4.0
# via matplotlib
pyenchant==3.2.2
# via sphinxcontrib-spelling
pygments==2.14.0
Expand All @@ -49,12 +67,18 @@ pygments==2.14.0
# sphinx
pygments-github-lexers==0.0.5
# via -r docs/requirements.in
pyparsing==3.0.9
# via matplotlib
python-dateutil==2.8.2
# via matplotlib
file:.#egg=referencing
# via -r docs/requirements.in
requests==2.28.2
# via sphinx
rpds-py==0.7.0
rpds-py==0.7.1
# via referencing
six==1.16.0
# via python-dateutil
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.4
Expand All @@ -68,6 +92,7 @@ sphinx==6.1.3
# sphinx-copybutton
# sphinx-json-schema-spec
# sphinxcontrib-spelling
# sphinxext-opengraph
sphinx-basic-ng==1.0.0b1
# via furo
sphinx-click==4.4.0
Expand All @@ -90,6 +115,8 @@ sphinxcontrib-serializinghtml==1.1.5
# via sphinx
sphinxcontrib-spelling==8.0.0
# via -r docs/requirements.in
sphinxext-opengraph==0.8.1
# via -r docs/requirements.in
urllib3==1.26.15
# via requests
yarl==1.8.2
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ pytest-subtests==0.10.0
# via -r test-requirements.in
file:.#egg=referencing
# via -r test-requirements.in
rpds-py==0.7.0
rpds-py==0.7.1
# via referencing

0 comments on commit 3d28774

Please sign in to comment.