Skip to content

Commit

Permalink
Update documentation to pydata.
Browse files Browse the repository at this point in the history
  • Loading branch information
isaksamsten committed Jan 29, 2024
1 parent 49f203b commit e47f410
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 55 deletions.
3 changes: 2 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
_build
api/
api/
_static/fig/
19 changes: 0 additions & 19 deletions docs/_templates/brand.html

This file was deleted.

19 changes: 0 additions & 19 deletions docs/_templates/page.html

This file was deleted.

41 changes: 27 additions & 14 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import sys

from pkg_resources import get_distribution, parse_version
from sphinx_simpleversion import get_current_branch
from sphinx.util.logging import getLogger

sys.path.insert(0, os.path.abspath("_gen_figures"))
Expand All @@ -23,6 +22,7 @@
current_release = parse_version(get_distribution("wildboar").version)
release = current_release.public
version = f"{current_release.major}.{current_release.minor}.{current_release.micro}"
major_version = f"{current_release.major}.{current_release.minor}"

# -- Project information -----------------------------------------------------

Expand All @@ -31,6 +31,16 @@
copyright = "2023, Isak Samsten"
author = "Isak Samsten"


def get_current_branch():
return (
subprocess.run("git branch --show-current", stdout=subprocess.PIPE, shell=True)
.stdout.decode()
.strip()
)


current_branch_name = get_current_branch()
# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
Expand Down Expand Up @@ -92,28 +102,31 @@
"inherited-members",
]

html_theme = "furo"
html_theme = "pydata_sphinx_theme"
html_theme_options = {
"light_logo": "logo.png",
"dark_logo": "logo.png",
"logo": {
"text": "Wildboar",
"image_light": "logo.png",
"image_dark": "logo.png",
},
"show_version_warning_banner": True,
"navbar_start": ["navbar-logo", "version-switcher"],
"switcher": {
"json_url": "https://wildboar.dev/_versions.json",
"version_match": "dev" if current_branch_name == "master" else major_version,
},
"check_switcher": False,
}
html_sidebars = {
"**": [
"sidebar/scroll-start.html",
"brand.html",
"sidebar/search.html",
"sidebar/navigation.html",
"versions.html",
"sidebar/scroll-end.html",
],

html_context = {
"default_mode": "auto",
}

html_static_path = ["_static"]
html_css_files = [
"css/custom.css",
"css/pygments-override.css",
]
current_branch_name = get_current_branch()

rst_prolog = """
.. role:: python(code)
Expand Down
3 changes: 1 addition & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
accessible-pygments>=0.0.4
furo>=2023.9.10
pydata-sphinx-theme>=0.15.2
matplotlib>=3.6.0
numpydoc>=1.5.0
sphinx>=6.2.0
Expand All @@ -8,6 +8,5 @@ sphinx-copybutton>=0.5.0
sphinx-design>=0.5.0
sphinx-inline-tabs>=2023.4.21
sphinx-toggleprompt>=0.4.0
sphinx_simpleversion @ git+https://github.com/isaksamsten/sphinx_simpleversion.git@main
nbsphinx>=0.9.0
jupyter>=1.0.0

0 comments on commit e47f410

Please sign in to comment.