diff --git a/_static/theme/theme_overrides.css b/_static/theme/theme_overrides.css index c8588ae0..e30c87f4 100644 --- a/_static/theme/theme_overrides.css +++ b/_static/theme/theme_overrides.css @@ -1,3 +1,7 @@ +.wy-side-nav-search { + background-color: #19191a; +} + .wy-table-responsive table td { white-space: normal !important; } @@ -74,3 +78,29 @@ gap: 10px; align-items: center; } + +/* + * Sphinx RTD theme compatibility layer + */ + +.wy-plain-list-disc li ul, +.rst-content .section ul li ul, +.rst-content .toctree-wrapper ul li ul, +article ul li ul { + margin-bottom: 12px; +} + +.wy-menu-vertical header, +.wy-menu-vertical p.caption { + color: #55a5d9; + font-weight: 700; + font-size: 85%; +} + +.wy-menu-vertical a { + color: #d9d9d9; +} + +.wy-menu-vertical li.current a { + color: #404040; +} diff --git a/conf.py b/conf.py index 22505e98..eec1b90a 100644 --- a/conf.py +++ b/conf.py @@ -26,40 +26,28 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_static_path = ['_static'] +html_css_files = [ + 'https://media.readthedocs.org/css/sphinx_rtd_theme.css', + 'https://media.readthedocs.org/css/readthedocs-doc-embed.css', + 'theme/theme_overrides.css' +] + # Suppress "WARNING: unknown mimetype for ..." during EPUB builds. # https://github.com/sphinx-doc/sphinx/issues/3214 suppress_warnings = ['epub.unknown_project_files'] on_rtd = os.environ.get('READTHEDOCS', None) == 'True' -if not on_rtd: # only import and set the theme if we're building docs locally - # Override default css to solve issues (e.g. width, overflows) - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - def setup(app): - app.add_css_file('theme/theme_overrides.css') - - # We're running outside of readthedocs and expect the compiled version to - # be a pre release - branch = 'pre-release' +if not on_rtd: + + # We're running outside of readthedocs and expect the compiled version to match the Git branch. + git_branch = os.environ.get('ZAMMAD_DOCS_GIT_BRANCH', None) + + if git_branch == 'main': + branch = 'latest' + else: + branch = 'pre-release' else: - # Override default css to solve issues (e.g. width, overflows) - # html context breaks sphinx tabs ~ - # html_context = { - # 'css_files': [ - # 'https://media.readthedocs.org/css/sphinx_rtd_theme.css', - # 'https://media.readthedocs.org/css/readthedocs-doc-embed.css', - # '_static/theme/theme_overrides.css', - # '_static/theme/tabs.css' - # ], - # } - - html_css_files = [ - 'https://media.readthedocs.org/css/sphinx_rtd_theme.css', - 'https://media.readthedocs.org/css/readthedocs-doc-embed.css', - 'theme/theme_overrides.css' - ] # Get current version we're on for possible version warning rtd_version = os.environ.get('READTHEDOCS_VERSION')