Skip to content

Commit

Permalink
modify docs style to work with pydate dark/light modes #136
Browse files Browse the repository at this point in the history
  • Loading branch information
DirkEilander committed Jul 19, 2022
1 parent 843ec28 commit 2f3aae8
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 38 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ jobs:
popd
- name: Set doc version
run: echo "DOC_VERSION=$(python -c 'from hydromt import __version__ as v; print("dev" if "dev" in v else "v"+v.replace(".dev",""))')" >> $GITHUB_ENV
run: echo "DOC_VERSION=preview" >> $GITHUB_ENV
# run: echo "DOC_VERSION=$(python -c 'from hydromt import __version__ as v; print("dev" if "dev" in v else "v"+v.replace(".dev",""))')" >> $GITHUB_ENV

- name: Upload to GitHub Pages
if: ${{ github.event_name != 'pull_request'}}
Expand Down
Binary file modified docs/_static/Architecture_model_data_input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/deltares_icon2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/hydromt-logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 9 additions & 30 deletions docs/_static/theme-deltares.css
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
/* Override the default color set in the original theme */

.navbar-light {
background: #080c80 !important;
}

.bg-light {
background-color: #080c80 !important;
}

.navbar-brand p {
color: #fff !important;
}
html[data-theme="light"] {
--pst-color-primary: #0057A5 !important;

img.icon-link-image {
height: 2.5em !important;
}

.navbar-toggler-icon {
filter: invert(100%) ;
/* sphinx design */
--sd-color-card-border-hover: #0057A5;
--sd-color-tabs-label-active: #0057A5;
--sd-color-tabs-label-hover: #0057A5;
--sd-color-tabs-underline-active: #0057A5;
}

:root {
/* sphinx design */
--sd-color-card-border-hover: #080c80;
--sd-color-tabs-label-active: #080c80;
--sd-color-tabs-label-hover: #080c80;
--sd-color-tabs-underline-active: #080c80;

/* hyperlinks */
--pst-color-link: 13, 56, 224;
--pst-color-navbar-link: 237, 237, 255;
--pst-color-navbar-link-hover: 255, 255, 255;
--pst-color-navbar-link-active: 255, 255, 255;
}
/* html[data-theme="dark"] {
} */
27 changes: 20 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ def write_nested_dropdown(name, data_cat, note="", categories=[]):


# # -- Copy notebooks to include in docs -------
if os.path.isdir("_examples"):
remove_dir_content("_examples")
os.makedirs("_examples")
copy_tree("../examples", "_examples")
# if os.path.isdir("_examples"):
# remove_dir_content("_examples")
# os.makedirs("_examples")
# copy_tree("../examples", "_examples")

# # -- Generate panels rst files from data catalogs to include in docs -------
if not os.path.isdir("_generated"):
Expand Down Expand Up @@ -193,6 +193,7 @@ def write_nested_dropdown(name, data_cat, note="", categories=[]):
# a list of builtin themes.
#
html_theme = "pydata_sphinx_theme"
html_logo = "_static/hydromt-logo.jpg"
autodoc_member_order = "bysource" # overwrite default alphabetical sort
autoclass_content = "both"

Expand All @@ -211,21 +212,33 @@ def write_nested_dropdown(name, data_cat, note="", categories=[]):
"navbar_align": "content",
"use_edit_page_button": True,
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/Deltares/hydromt", # required
"icon": "fab fa-github-square",
"type": "fontawesome",
},
{
"name": "Deltares",
"url": "https://deltares.nl/en/",
"icon": "_static/deltares-white.svg",
"url": "https://www.deltares.nl/en/",
"icon": "_static/deltares_icon2.jpg",
"type": "local",
},
],
"logo": {
"text": "HydroMT",
# "image_dark": "logo-dark.svg",
},
# "navbar_start": ["navbar-logo", "version-switcher"],
}

html_context = {
"github_url": "https://github.com", # or your GitHub Enterprise interprise
"github_user": "Deltares",
"github_repo": "hydromt",
"github_version": "docs", # FIXME
"github_version": "main", # FIXME
"doc_path": "docs",
"default_mode": "light",
}

remove_from_toctrees = ["_generated/*"]
Expand Down

0 comments on commit 2f3aae8

Please sign in to comment.