diff --git a/docs/_config.yml b/docs/_config.yml index 7041cbc4..53ae4de9 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -3,7 +3,7 @@ title: DemesDraw author: Graham Gower -copyright: "2021" +copyright: "2021-2023" only_build_toc_files: true execute: @@ -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 @@ -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 @@ -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 diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 00000000..74548174 --- /dev/null +++ b/docs/_static/custom.css @@ -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; +} diff --git a/requirements/docs.txt b/requirements/docs.txt index 373c8fe1..c2dff8be 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -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