Skip to content

Commit 7ffeae7

Browse files
committed
docs: add copybutton, opengraph, rediraffe
1 parent 7ea7454 commit 7ffeae7

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
myst-parser>=0.18
22
pydata-sphinx-theme>=0.11
33
sphinx-autobuild
4+
sphinx-copybutton
45
sphinxcontrib-autoprogram>=0.1.7
6+
sphinxext-opengraph
7+
sphinxext-rediraffe

docs/source/conf.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
#
1919
extensions = [
2020
"myst_parser",
21+
"sphinx_copybutton",
2122
"sphinx.ext.extlinks",
2223
"sphinxcontrib.autoprogram",
24+
"sphinxext.opengraph",
25+
"sphinxext.rediraffe",
2326
]
2427
root_doc = "index"
2528
source_suffix = [".md", ".rst"]
@@ -87,3 +90,43 @@
8790
"github_version": "main",
8891
"doc_path": "docs/source",
8992
}
93+
94+
95+
# -- Options for linkcheck builder -------------------------------------------
96+
# ref: https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-the-linkcheck-builder
97+
#
98+
linkcheck_ignore = [
99+
r"(.*)github\.com(.*)#", # javascript based anchors
100+
r"(.*)/#%21(.*)/(.*)", # /#!forum/jupyter - encoded anchor edge case
101+
r"https://github.com/[^/]*$", # too many github usernames / searches in changelog
102+
"https://github.com/jupyterhub/repo2docker/pull/", # too many PRs in changelog
103+
"https://github.com/jupyterhub/repo2docker/compare/", # too many comparisons in changelog
104+
]
105+
linkcheck_anchors_ignore = [
106+
"/#!",
107+
"/#%21",
108+
]
109+
110+
111+
# -- Options for the opengraph extension -------------------------------------
112+
# ref: https://github.com/wpilibsuite/sphinxext-opengraph#options
113+
#
114+
# This extension help others provide better thumbnails and link descriptions
115+
# when they link to this documentation from other websites, such as
116+
# https://discourse.jupyter.org.
117+
#
118+
# ogp_site_url is set automatically by RTD
119+
ogp_image = "_static/images/logo.png"
120+
ogp_use_first_image = True
121+
122+
123+
# -- Options for the rediraffe extension -------------------------------------
124+
# ref: https://github.com/wpilibsuite/sphinxext-rediraffe#readme
125+
#
126+
# This extensions help us relocated content without breaking links. If a
127+
# document is moved internally, we should configure a redirect like below.
128+
#
129+
rediraffe_branch = "main"
130+
rediraffe_redirects = {
131+
# "old-file": "new-folder/new-file-name",
132+
}

0 commit comments

Comments
 (0)