Skip to content

Commit

Permalink
Maintenance: Fix styling issues in the documentation builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvuckovic authored Sep 19, 2023
1 parent b719bdd commit cb77782
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 27 deletions.
30 changes: 30 additions & 0 deletions _static/theme/theme_overrides.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.wy-side-nav-search {
background-color: #19191a;
}

.wy-table-responsive table td {
white-space: normal !important;
}
Expand Down Expand Up @@ -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;
}
42 changes: 15 additions & 27 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit cb77782

Please sign in to comment.