|
18 | 18 |
|
19 | 19 | sys.path.append(os.path.abspath("_ext"))
|
20 | 20 | extensions = [
|
| 21 | + "hoverxref.extension", |
21 | 22 | "multiproject",
|
22 |
| - "sphinx.ext.autosectionlabel", |
| 23 | + "myst_parser", |
| 24 | + "notfound.extension", |
| 25 | + "sphinx_design", |
| 26 | + "sphinx_search.extension", |
| 27 | + "sphinx_tabs.tabs", |
| 28 | + "sphinx-prompt", |
23 | 29 | "sphinx.ext.autodoc",
|
| 30 | + "sphinx.ext.autosectionlabel", |
| 31 | + "sphinx.ext.extlinks", |
24 | 32 | "sphinx.ext.intersphinx",
|
25 | 33 | "sphinxcontrib.httpdomain",
|
26 | 34 | "sphinxcontrib.video",
|
27 |
| - "sphinx_tabs.tabs", |
28 |
| - "sphinx-prompt", |
29 |
| - "notfound.extension", |
30 |
| - "hoverxref.extension", |
31 |
| - "sphinx_search.extension", |
32 | 35 | "sphinxemoji.sphinxemoji",
|
33 |
| - "sphinx_design", |
34 |
| - "myst_parser", |
| 36 | + "sphinxext.opengraph", |
35 | 37 | ]
|
36 | 38 |
|
37 | 39 | multiproject_projects = {
|
|
51 | 53 |
|
52 | 54 | docset = get_project(multiproject_projects)
|
53 | 55 |
|
| 56 | +ogp_site_name = "Read the Docs Documentation" |
| 57 | +ogp_use_first_image = True # https://github.com/readthedocs/blog/pull/118 |
| 58 | +ogp_image = "https://docs.readthedocs.io/en/latest/_static/img/logo-opengraph.png" |
| 59 | +# Inspired by https://github.com/executablebooks/MyST-Parser/pull/404/ |
| 60 | +ogp_custom_meta_tags = [ |
| 61 | + '<meta name="twitter:card" content="summary_large_image" />', |
| 62 | +] |
| 63 | +ogp_enable_meta_description = True |
| 64 | +ogp_description_length = 300 |
54 | 65 |
|
55 | 66 | templates_path = ["_templates"]
|
56 | 67 |
|
57 | 68 | master_doc = "index"
|
58 | 69 | copyright = "Read the Docs, Inc & contributors"
|
59 |
| -version = "9.4.0" |
| 70 | +version = "9.8.0" |
60 | 71 | release = version
|
61 |
| -exclude_patterns = ["_build", "shared"] |
| 72 | +exclude_patterns = ["_build", "shared", "_includes"] |
62 | 73 | default_role = "obj"
|
| 74 | +intersphinx_cache_limit = 14 # cache for 2 weeks |
63 | 75 | intersphinx_timeout = 3 # 3 seconds timeout
|
64 | 76 | intersphinx_mapping = {
|
65 | 77 | "python": ("https://docs.python.org/3.10/", None),
|
|
85 | 97 | "rtd-dev": ("https://dev.readthedocs.io/en/latest/", None),
|
86 | 98 | "jupyter": ("https://docs.jupyter.org/en/latest/", None),
|
87 | 99 | }
|
88 |
| -# Redundant in Sphinx 5.0 |
| 100 | + |
| 101 | +# Intersphinx: Do not try to resolve unresolved labels that aren't explicitly prefixed. |
| 102 | +# The default setting for intersphinx_disabled_reftypes can cause some pretty bad |
| 103 | +# breakage because we have rtd and rtd-dev stable versions in our mappings. |
| 104 | +# Hence, if we refactor labels, we won't see broken references, since the |
| 105 | +# currently active stable mapping keeps resolving. |
| 106 | +# Recommending doing this on all projects with Intersphinx. |
89 | 107 | # https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#confval-intersphinx_disabled_reftypes
|
90 |
| -intersphinx_disabled_reftypes = ["std:doc"] |
| 108 | +intersphinx_disabled_reftypes = ["*"] |
| 109 | + |
91 | 110 | myst_enable_extensions = [
|
92 | 111 | "deflist",
|
93 | 112 | ]
|
|
131 | 150 | html_css_files = ["css/custom.css", "css/sphinx_prompt_css.css"]
|
132 | 151 | html_js_files = ["js/expand_tabs.js"]
|
133 | 152 |
|
| 153 | +if os.environ.get("READTHEDOCS_VERSION_TYPE") == "external": |
| 154 | + html_js_files.append("js/readthedocs-doc-diff.js") |
| 155 | + |
134 | 156 | html_logo = "img/logo.svg"
|
135 | 157 | html_theme_options = {
|
136 | 158 | "logo_only": True,
|
|
141 | 163 | # TODO: remove once we support different rtd config
|
142 | 164 | # files per project.
|
143 | 165 | "conf_py_path": f"/docs/{docset}/",
|
| 166 | + # Use to generate the Plausible "data-domain" attribute from the template |
| 167 | + "plausible_domain": f"{os.environ.get('READTHEDOCS_PROJECT')}.readthedocs.io", |
144 | 168 | }
|
145 | 169 |
|
146 | 170 | hoverxref_auto_ref = True
|
147 | 171 | hoverxref_domains = ["py"]
|
148 | 172 | hoverxref_roles = [
|
149 | 173 | "option",
|
150 |
| - "doc", # Documentation pages |
151 |
| - "term", # Glossary terms |
| 174 | + # Documentation pages |
| 175 | + # Not supported yet: https://github.com/readthedocs/sphinx-hoverxref/issues/18 |
| 176 | + "doc", |
| 177 | + # Glossary terms |
| 178 | + "term", |
152 | 179 | ]
|
153 | 180 | hoverxref_role_types = {
|
154 | 181 | "mod": "modal", # for Python Sphinx Domain
|
|
201 | 228 | r"https://readthedocs\.org/accounts/gold",
|
202 | 229 | ]
|
203 | 230 |
|
| 231 | +extlinks = { |
| 232 | + "rtd-issue": ("https://github.com/readthedocs/readthedocs.org/issues/%s", "#%s"), |
| 233 | +} |
| 234 | + |
204 | 235 | # Disable epub mimetype warnings
|
205 | 236 | suppress_warnings = ["epub.unknown_project_files"]
|
0 commit comments