From b599426adf99d5be8a68b63147cdb30d935d421a Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Fri, 8 Nov 2024 11:34:09 +0100 Subject: [PATCH 1/3] Change to "furo" Sphinx HTML theme --- doc/_static/custom.css | 3 +++ doc/conf.py | 37 ++++++++++++++++++++++++++----------- pyproject.toml | 2 +- 3 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 doc/_static/custom.css diff --git a/doc/_static/custom.css b/doc/_static/custom.css new file mode 100644 index 00000000..1360ca97 --- /dev/null +++ b/doc/_static/custom.css @@ -0,0 +1,3 @@ +.sidebar-brand-text{ + text-align: center; +} diff --git a/doc/conf.py b/doc/conf.py index 1b833828..d039c188 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -47,21 +47,36 @@ # -- Options for HTML output ----------------------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for a list of -# builtin themes. -html_theme = "sphinx_book_theme" +html_css_files = ["custom.css"] +html_logo = "_static/hammer-duotone.svg" + +html_static_path = ["_static"] + +html_theme = "furo" + +GH_URL = "https://github.com/khaeru/genno" html_theme_options = dict( - navigation_with_keys=False, # Silence a warning - path_to_docs="doc", - repository_url="https://github.com/khaeru/genno", - show_navbar_depth=2, - use_edit_page_button=True, - use_issues_button=True, - use_repository_button=True, - use_source_button=True, + footer_icons=[ + { + "name": "GitHub", + "url": GH_URL, + "html": """ + + + + """, + "class": "", + }, + ], + top_of_page_buttons=["view", "edit"], + source_repository=GH_URL, + source_branch="main", + source_directory="doc/", ) +html_title = "genno" + # -- Options for genno.compat.sphinx.reference_alias ----------------------------------- # Mapping from expression → replacement. diff --git a/pyproject.toml b/pyproject.toml index 06c12ac5..7275eea8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ dependencies = [ [project.optional-dependencies] # Graphviz, for Computer.describe() graphviz = ["graphviz"] -docs = ["IPython", "sphinx-book-theme"] +docs = ["furo", "IPython"] # Specific packages for which compatibility is provided plotnine = ["plotnine"] pyam = ["pyam-iamc"] From 9aad007478ced51b8002ee96a8bd0154c61d80ef Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Fri, 8 Nov 2024 12:13:10 +0100 Subject: [PATCH 2/3] Copy hammer-duotone.svg from @phosphor-icons/core MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reused under the terms of the MIT license from https://github.com/phosphor-icons/core - Modified to add attributes. --- doc/_static/hammer-duotone.svg | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 doc/_static/hammer-duotone.svg diff --git a/doc/_static/hammer-duotone.svg b/doc/_static/hammer-duotone.svg new file mode 100644 index 00000000..5373d105 --- /dev/null +++ b/doc/_static/hammer-duotone.svg @@ -0,0 +1,4 @@ + + + + From 49d1265d7777c2ea518802acf1c9d7dc7f7ae515 Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Fri, 8 Nov 2024 12:24:59 +0100 Subject: [PATCH 3/3] Update RTD config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ubuntu-22.04 → ubuntu-24.04 (latest currently available). - Python 3.10 → 3.12 (latest currently available). - Drop pin of plotnine. --- .readthedocs.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index f9e1fc8d..72a2c758 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,12 +1,9 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: - python: "3.10" - jobs: - post_install: - - pip install "plotnine != 0.13.0" + python: "3.12" python: install: