Skip to content

Commit

Permalink
change theme and fix some css issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildingAtom committed Feb 13, 2024
1 parent 4d88f2b commit ee2433a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
sphinx==7.1.2
# Theme
# furo==2024.1.29
pydata-sphinx-theme==0.15.2
# pydata-sphinx-theme==0.15.2
sphinx-book-theme==1.1.1
# Extensions
sphinxcontrib.katex==0.9.9
matplotlib==3.8.2
Expand Down
25 changes: 25 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* force a centered display math */
span.katex-display {
width: 100%;
}

/* fix the version dropdown button */
.version-switcher__button {
margin-bottom: unset !important;
}

/* fix dropdown menu position */
.bd-header-article .dropdown-menu {
position: absolute;
inset: 0px auto auto 0px;
margin: 0px;
transform: translate3d(0px, 28px, 0px);
}

/* fix dropdown menu hover */
.bd-header-article .dropdown-source-buttons:hover + .btn + .dropdown-menu {
display: block;
}
.bd-header-article .btn {
display: block;
}
29 changes: 25 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@
"sphinxcontrib.katex",
"sphinx.ext.autosectionlabel",
"sphinx_copybutton",
"sphinx_design",
"myst_parser",
"sphinx_design",
]
myst_enable_extensions = [
"colon_fence",
"deflist",
"substitution",
"html_image",
]

sd_fontawesome_latex = True

katex_prerender = True

templates_path = ['_templates']
Expand All @@ -36,8 +41,8 @@
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'pydata_sphinx_theme'
# html_static_path = ['_static']
html_theme = 'sphinx_book_theme'
html_static_path = ['_static']

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Expand Down Expand Up @@ -69,9 +74,25 @@
json_url = "https://roahmlab.github.io/zonopy/versions.json"

html_theme_options = {
"path_to_docs": version_match,
"repository_url": "https://github.com/roahmlab/zonopy",
"repository_branch": "gh-pages",
"use_repository_button": True,
"switcher": {
"json_url": json_url,
"version_match": version_match,
},
"navbar_center": ["version-switcher", "navbar-nav"],
"article_header_end": ["version-switcher", "article-header-buttons"],
}

html_css_files = [
"css/custom.css",
]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable", None),
"torch": ('https://pytorch.org/docs/master/', None),
}

0 comments on commit ee2433a

Please sign in to comment.