Skip to content

Commit

Permalink
Switch from sphinx-book-theme to piccolo
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamgower committed May 2, 2023
1 parent 918ab46 commit 23ed578
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 8 deletions.
26 changes: 19 additions & 7 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

title: DemesDraw
author: Graham Gower
copyright: "2021"
copyright: "2021-2023"
only_build_toc_files: true

execute:
Expand All @@ -15,11 +15,6 @@ repository:
path_to_book: docs
branch: main

html:
use_issues_button: true
use_repository_button: true
use_edit_page_button: true

sphinx:
extra_extensions:
- sphinx.ext.autodoc
Expand All @@ -30,7 +25,8 @@ sphinx:

local_extensions:
# Add version string to the navbar and footer.
inject_version: _ext
# Works with sphinx-book-theme, but not with piccolo_theme.
#inject_version: _ext

config:
autodoc_typehints: description
Expand All @@ -39,3 +35,19 @@ sphinx:
demes: ["https://popsim-consortium.github.io/demes-docs/stable/", null]
matplotlib: ["https://matplotlib.org/stable/", null]
issues_github_path: grahamgower/demesdraw

html_show_sphinx: false
# https://piccolo-theme.readthedocs.io/
html_theme: "piccolo_theme"
# some custom css to fix piccolo/notebook in dark modes
html_static_path: ["_static"]
html_css_files: ["custom.css"]

html_theme_options:
globaltoc_collapse: false
globaltoc_maxdepth: -1
globaltoc_includehidden: true

## piccolo_theme options
#dark_mode_code_blocks: false
source_url: https://github.com/grahamgower/demesdraw
26 changes: 26 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Fixes for images with transparent backgrounds and notebook output
* when using dark mode with piccolo_theme.
*/
.cell_output img {
background-color: white !important;
}
section img {
background-color: white !important;
}
div.cell summary {
background-color: #eeffcc !important;
color: #252630 !important;
}
div.cell_output,
div.cell_input
{
background: inherit !important;
}

.cell_output .output.text_plain,
.cell_output .output.traceback,
.cell_output .output.stream,
.cell_output .output.stderr {
background: inherit !important;
}
3 changes: 2 additions & 1 deletion requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
jupyter-book==0.13.2
jupyter-book==0.15.1
piccolo_theme==0.15.0
sphinx-issues==3.0.1
sphinxcontrib-programoutput==0.17

0 comments on commit 23ed578

Please sign in to comment.