From 8803c49e85569e6df2ace80c9dc43c80308b9b9d Mon Sep 17 00:00:00 2001 From: Graham Gower Date: Thu, 4 May 2023 19:12:21 +0100 Subject: [PATCH 1/2] Switch from sphinx-book-theme to piccolo-theme Closes #506. --- .github/workflows/docs.yaml | 2 +- docs/Makefile | 5 ----- docs/_config.yml | 31 ++++++++++++++++--------------- docs/_static/custom.css | 26 ++++++++++++++++++++++++++ docs/_toc.yml | 3 ++- docs/index.md | 1 + requirements/docs.txt | 1 + 7 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 docs/_static/custom.css create mode 100644 docs/index.md diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index d23dc478..2e998ff2 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 11071316..2ba8e27c 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 7e05dd4a..58264708 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 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/docs/_toc.yml b/docs/_toc.yml index 18e22afa..2d48c495 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 00000000..4c53d1f2 --- /dev/null +++ b/docs/index.md @@ -0,0 +1 @@ + diff --git a/requirements/docs.txt b/requirements/docs.txt index 66df4993..d5a50644 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 From 02d4b56ed07a9e5274f7032c669c297fed133760 Mon Sep 17 00:00:00 2001 From: Graham Gower Date: Thu, 4 May 2023 19:44:50 +0100 Subject: [PATCH 2/2] Update changelog for release --- CHANGELOG.md | 7 +++++++ setup.cfg | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffa4a773..f002300c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.2.3 - 2023-05-04 + +- Fixed the use of numpy strings for deme names. + ({user}`terhorst`, {user}`grahamgower`, {issue}`495`, {pr}`505`) +- Added `Graph.rename_demes()` method to return a graph with renamed demes. + ({user}`aabiddanda`, {pr}`499`) + ## 0.2.2 - 2022-04-28 Better conformance to the spec. Minor discrepancies between diff --git a/setup.cfg b/setup.cfg index a7b652b2..0b36e725 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,11 +12,6 @@ classifiers = Operating System :: OS Independent Intended Audience :: Science/Research Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 Topic :: Scientific/Engineering Topic :: Scientific/Engineering :: Bio-Informatics project_urls =