diff options
author | David Robillard <d@drobilla.net> | 2022-12-04 11:02:02 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-12-04 11:02:02 -0500 |
commit | 9d652e28f4de41fe3280d6bd4a4b80270d1d655b (patch) | |
tree | f469d4c92a0ca8fb46961c9dcd0c4030ae407654 /doc/conf.py.in | |
parent | 94ee6538f7a7790854ce33a68adf0834a27a232b (diff) | |
download | zix-9d652e28f4de41fe3280d6bd4a4b80270d1d655b.tar.gz zix-9d652e28f4de41fe3280d6bd4a4b80270d1d655b.tar.bz2 zix-9d652e28f4de41fe3280d6bd4a4b80270d1d655b.zip |
Fall back to alabaster if sphinx_lv2_theme is unavailable
Diffstat (limited to 'doc/conf.py.in')
-rw-r--r-- | doc/conf.py.in | 108 |
1 files changed, 75 insertions, 33 deletions
diff --git a/doc/conf.py.in b/doc/conf.py.in index cefa9e9..1fa288f 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -17,6 +17,13 @@ language = "en" nitpicky = True pygments_style = "friendly" +try: + import sphinx_lv2_theme + + have_lv2_theme = True +except ModuleNotFoundError: + have_lv2_theme = False + # Ignore everything opaque or external for nitpicky mode _opaque = [ "FILE", @@ -56,38 +63,73 @@ nitpick_ignore = list(_c_nitpick_ignore) + list(_cpp_nitpick_ignore) html_copy_source = False html_secnumber_suffix = " " html_short_title = "@ZIX_TITLE@" -html_theme = "sphinx_lv2_theme" - -if tags.has("singlehtml"): - html_sidebars = { - "**": [ - "globaltoc.html", - ] - } - - html_theme_options = { - "body_max_width": "46em", - "body_min_width": "46em", - "description": desc, - "globaltoc_collapse": False, - "globaltoc_maxdepth": 3, - "logo_name": True, - "nosidebar": False, - "page_width": "80em", - "show_footer_version": True, - "show_logo_version": True, - "sidebar_width": "14em", - } +if have_lv2_theme: + html_theme = "sphinx_lv2_theme" + + if tags.has("singlehtml"): + html_sidebars = { + "**": [ + "globaltoc.html", + ] + } + + html_theme_options = { + "body_max_width": "46em", + "body_min_width": "46em", + "description": desc, + "globaltoc_collapse": False, + "globaltoc_maxdepth": 3, + "logo_name": True, + "nosidebar": False, + "page_width": "80em", + "show_footer_version": True, + "show_logo_version": True, + "sidebar_width": "14em", + } + + else: + html_theme_options = { + "body_max_width": "60em", + "body_min_width": "46em", + "description": desc, + "logo_name": True, + "nosidebar": True, + "page_width": "60em", + "show_footer_version": True, + "show_logo_version": True, + "sidebar_width": "14em", + } else: - html_theme_options = { - "body_max_width": "60em", - "body_min_width": "46em", - "description": desc, - "logo_name": True, - "nosidebar": True, - "page_width": "60em", - "show_footer_version": True, - "show_logo_version": True, - "sidebar_width": "14em", - } + html_theme = "alabaster" + html_static_path = ["@ZIX_SRCDIR@/doc/_static"] + + if tags.has("singlehtml"): + html_sidebars = { + "**": [ + "globaltoc.html", + ] + } + + html_theme_options = { + "body_max_width": "48em", + "body_min_width": "48em", + "description": desc, + "globaltoc_collapse": False, + "globaltoc_maxdepth": 3, + "logo_name": True, + "nosidebar": False, + "page_width": "80em", + "sidebar_width": "16em", + } + + else: + html_theme_options = { + "body_max_width": "60em", + "body_min_width": "40em", + "description": desc, + "logo_name": True, + "nosidebar": True, + "page_width": "60em", + "show_relbars": True, + } |