diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index d23dc47..2e998ff 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -37,7 +37,7 @@ jobs: - name: Build Docs run: | cd docs - make dist + make - name: Checkout docs site if: (!github.event.pull_request) diff --git a/docs/Makefile b/docs/Makefile index 1107131..2ba8e27 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -7,10 +7,5 @@ DEMES_VERSION:=$(shell PYTHONPATH=${PYTHONPATH} \ dev: ./build.sh -dist: - @echo Building distribution for demes version ${DEMES_VERSION} - sed -i s/__DEMES_VERSION__/${DEMES_VERSION}/g _config.yml - ./build.sh - clean: rm -fR _build diff --git a/docs/_config.yml b/docs/_config.yml index 7e05dd4..5826470 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -3,9 +3,8 @@ title: Demes manual author: PopSim Consortium -copyright: "2021" +copyright: "2021-2023" only_build_toc_files: true -# logo: logo.png execute: execute_notebooks: cache @@ -15,19 +14,6 @@ repository: branch: main path_to_book: docs -launch_buttons: - # Disable binder launch button on pages with python code. - binderhub_url: "" - -html: - use_issues_button: true - use_repository_button: true - use_edit_page_button: true - # Do not edit this - the version placeholder is replaced by the - # current version during a distribution build in the Makefile - extra_navbar: demes __DEMES_VERSION__ - extra_footer: demes __DEMES_VERSION__ - sphinx: extra_extensions: - sphinx.ext.autodoc @@ -49,3 +35,18 @@ sphinx: # Don't use fully-qualified type names. E.g. demes.demes.Graph autodoc_typehints: none + + 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 + source_url: https://github.com/popsim-consortium/demes-python diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000..7454817 --- /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/docs/_toc.yml b/docs/_toc.yml index 18e22af..2d48c49 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -1,6 +1,7 @@ format: jb-article -root: introduction +root: index sections: +- file: introduction - file: installation - file: quickstart - file: api diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..4c53d1f --- /dev/null +++ b/docs/index.md @@ -0,0 +1 @@ + diff --git a/requirements/docs.txt b/requirements/docs.txt index 66df499..d5a5064 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,4 +1,5 @@ demesdraw==0.3.1 jupyter-book==0.15.1 +piccolo_theme==0.15.0 sphinx_issues==3.0.1 sphinxcontrib-programoutput==0.17