|
4 | 4 | """Sphinx configuration for calendaring-jmap documentation.""" |
5 | 5 |
|
6 | 6 | import datetime |
| 7 | +import os |
7 | 8 |
|
8 | 9 | project = "calendaring-jmap" |
9 | 10 | this_year = datetime.date.today().year # noqa: DTZ011 |
|
12 | 13 |
|
13 | 14 | # Extensions |
14 | 15 | extensions = [ |
| 16 | + "notfound.extension", |
15 | 17 | "sphinx.ext.autodoc", |
16 | 18 | "sphinx.ext.napoleon", |
17 | 19 | "sphinx.ext.viewcode", |
18 | 20 | "sphinx.ext.intersphinx", |
19 | 21 | "sphinx_copybutton", |
| 22 | + "sphinx_design", |
| 23 | + "sphinx_issues", |
20 | 24 | ] |
21 | 25 |
|
| 26 | +# sphinx_issues configuration: enables :issue:`N`, :pr:`N`, :user:`name` roles |
| 27 | +issues_github_path = "pycalendar/calendaring-jmap" |
| 28 | + |
22 | 29 | # Theme configuration |
23 | 30 | html_theme = "pydata_sphinx_theme" |
24 | 31 | html_theme_options = { |
|
28 | 35 | "url": "https://github.com/pycalendar/calendaring-jmap", |
29 | 36 | "icon": "fa-brands fa-square-github", |
30 | 37 | "type": "fontawesome", |
| 38 | + "attributes": {"target": "_blank", "rel": "noopener me"}, |
31 | 39 | }, |
32 | 40 | { |
33 | 41 | "name": "PyPI", |
34 | 42 | "url": "https://pypi.org/project/calendaring-jmap", |
35 | 43 | "icon": "fa-custom fa-pypi", |
36 | 44 | "type": "fontawesome", |
| 45 | + "attributes": {"target": "_blank", "rel": "noopener me"}, |
37 | 46 | }, |
38 | 47 | ], |
39 | | - "footer_start": ["copyright"], |
| 48 | + "footer_start": ["nlnet", "copyright"], |
40 | 49 | "footer_end": ["theme-version", "sphinx-version"], |
41 | 50 | "logo": {"text": "calendaring-jmap"}, |
42 | 51 | "use_edit_page_button": True, |
43 | 52 | "show_toc_level": 2, |
| 53 | + "navbar_align": "content", |
| 54 | + "show_nav_level": 1, |
44 | 55 | "navigation_with_keys": True, |
| 56 | + "collapse_navigation": False, |
| 57 | + "search_bar_text": "Search documentation", |
45 | 58 | } |
46 | 59 |
|
47 | 60 | html_context = { |
|
52 | 65 | } |
53 | 66 |
|
54 | 67 | templates_path = ["_templates"] |
| 68 | +html_static_path = ["_static"] |
| 69 | +# Custom fa-custom/fa-pypi icon used in icon_links above |
| 70 | +html_js_files = [("js/custom-icons.js", {"defer": "defer"})] |
| 71 | + |
| 72 | +# notfound.extension configuration |
| 73 | +notfound_template = "404.html" |
| 74 | +# Defaults to READTHEDOCS_CANONICAL_URL's path on RTD; outside RTD that env |
| 75 | +# var isn't set and the extension falls back to a hardcoded "/en/latest/", |
| 76 | +# which 404s every asset on a local build. Use root-relative paths instead |
| 77 | +# when not building on RTD. |
| 78 | +if not os.environ.get("READTHEDOCS"): |
| 79 | + notfound_urls_prefix = "/" |
55 | 80 |
|
56 | 81 | # Intersphinx mapping |
57 | 82 | intersphinx_mapping = { |
|
0 commit comments