Skip to content

Commit

Permalink
Update Sphinx documentation theme (#7)
Browse files Browse the repository at this point in the history
* Add logo with light text for dark theme

* Update PyMC intersphinx URL to latest version

* Copy all of images to docs _static when building

* Change Sphinx documentation to pydata-sphinx-theme
  • Loading branch information
matt-graham authored Aug 16, 2023
1 parent 929cdf1 commit 7f607ca
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 155 deletions.
8 changes: 8 additions & 0 deletions docs/_static/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Workaround to allow tracking empty directory to avoid warning when
# running sphinx-build (source: https://stackoverflow.com/a/932982)

# Ignore everything in this directory
*
# Except this file
!.gitignore

126 changes: 0 additions & 126 deletions docs/_static/mici-logo-square.svg

This file was deleted.

23 changes: 18 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"pymc3": ("https://www.pymc.io/projects/docs/en/v3/", None),
"pymc": ("https://www.pymc.io/projects/docs/en/latest/", None),
"arviz": ("https://python.arviz.org/en/stable/", None),
"pystan": ("https://pystan.readthedocs.io/en/latest/", None)
}
Expand All @@ -46,10 +46,23 @@
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_logo = "_static/mici-logo-rectangular.svg"
html_theme_options = {"logo_only": True}
html_theme = "pydata_sphinx_theme"
html_static_path = ["_static", "../images"]

html_theme_options = {
"logo": {
"image_light": "../images/mici-logo-rectangular.svg",
"image_dark": "../images/mici-logo-rectangular-light-text.svg",
},
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/matt-graham/mici",
"icon": "fa-brands fa-square-github",
"type": "fontawesome",
},
],
}


# -- Post process ------------------------------------------------------------
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ legacy_tox_ini = """
sphinx-build -W -b html docs docs/_build/html
deps =
sphinx
sphinx_rtd_theme
pydata-sphinx-theme
[tox]
env_list =
Expand Down

0 comments on commit 7f607ca

Please sign in to comment.