From 5ce5ad8ce71a9481b2b4f03a596d6cf335ad73ca Mon Sep 17 00:00:00 2001
From: Chris Holdgraf
Date: Mon, 7 Nov 2022 11:22:05 +0100
Subject: [PATCH 01/65] Removing cruft for pydata theme
---
docs/customize/footer-content.md | 26 ++++
docs/customize/index.md | 1 +
src/sphinx_book_theme/__init__.py | 24 ++++
src/sphinx_book_theme/assets/scripts/index.js | 39 ------
.../assets/styles/abstracts/_variables.scss | 43 ++----
.../assets/styles/base/_base.scss | 5 -
.../assets/styles/base/_bootstrap.scss | 9 --
.../assets/styles/base/_typography.scss | 48 +------
.../assets/styles/components/_buttons.scss | 43 ++----
.../assets/styles/components/_search.scss | 18 ---
.../assets/styles/content/_code.scss | 47 -------
.../assets/styles/content/_field-lists.scss | 10 --
.../assets/styles/content/_footnotes.scss | 18 ---
.../assets/styles/content/_glossary.scss | 5 -
.../assets/styles/content/_math.scss | 43 ------
.../assets/styles/content/_quotes.scss | 13 +-
.../assets/styles/content/_sidebar.scss | 24 ----
.../styles/content/_tableofcontents.scss | 49 -------
.../assets/styles/extensions/_ablog.scss | 41 ------
.../{comments.scss => _comments.scss} | 0
.../assets/styles/extensions/_myst-nb.scss | 41 ------
.../styles/extensions/_readthedocs.scss | 64 ---------
.../styles/extensions/_sphinx-tabs.scss | 12 --
.../assets/styles/index.scss | 25 +---
.../assets/styles/pages/_search.scss | 57 --------
.../assets/styles/sections/_announcement.scss | 4 -
.../styles/sections/_article-container.scss | 8 ++
.../assets/styles/sections/_article.scss | 22 ---
.../styles/sections/_footer-article.scss | 17 ---
.../styles/sections/_footer-content.scss | 12 --
.../styles/sections/_header-article.scss | 10 +-
.../styles/sections/_header-primary.scss | 3 +
.../assets/styles/sections/_headers.scss | 22 ---
.../styles/sections/_sidebar-primary.scss | 125 +++--------------
.../styles/sections/_sidebar-secondary.scss | 132 +-----------------
.../styles/sections/_sidebars-toggle.scss | 77 ----------
.../sphinx_book_theme/components/author.html | 5 +
.../components/extra-footer.html | 5 +
.../sidebar-icons.html} | 0
.../components/toc-button.html | 4 -
.../theme/sphinx_book_theme/layout.html | 18 +--
.../sections/footer-content.html | 29 ++--
.../sections/sidebar-primary.html | 24 ----
.../sections/sidebar-secondary.html | 16 ---
.../sphinx_book_theme/sections/sidebar.html | 0
.../theme/sphinx_book_theme/theme.conf | 12 +-
46 files changed, 148 insertions(+), 1102 deletions(-)
create mode 100644 docs/customize/footer-content.md
delete mode 100644 src/sphinx_book_theme/assets/styles/base/_bootstrap.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/components/_search.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/content/_code.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/content/_field-lists.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/content/_footnotes.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/content/_glossary.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/content/_math.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/content/_sidebar.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/content/_tableofcontents.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/extensions/_ablog.scss
rename src/sphinx_book_theme/assets/styles/extensions/{comments.scss => _comments.scss} (100%)
delete mode 100644 src/sphinx_book_theme/assets/styles/extensions/_myst-nb.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/extensions/_readthedocs.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/extensions/_sphinx-tabs.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/pages/_search.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/sections/_announcement.scss
create mode 100644 src/sphinx_book_theme/assets/styles/sections/_article-container.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/sections/_article.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/sections/_footer-article.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
create mode 100644 src/sphinx_book_theme/assets/styles/sections/_header-primary.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/sections/_headers.scss
delete mode 100644 src/sphinx_book_theme/assets/styles/sections/_sidebars-toggle.scss
create mode 100644 src/sphinx_book_theme/theme/sphinx_book_theme/components/author.html
create mode 100644 src/sphinx_book_theme/theme/sphinx_book_theme/components/extra-footer.html
rename src/sphinx_book_theme/theme/sphinx_book_theme/{sections/header.html => components/sidebar-icons.html} (100%)
delete mode 100644 src/sphinx_book_theme/theme/sphinx_book_theme/components/toc-button.html
delete mode 100644 src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-primary.html
delete mode 100644 src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-secondary.html
delete mode 100644 src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar.html
diff --git a/docs/customize/footer-content.md b/docs/customize/footer-content.md
new file mode 100644
index 00000000..7e67d092
--- /dev/null
+++ b/docs/customize/footer-content.md
@@ -0,0 +1,26 @@
+# Customize the content footer
+
+There is a content footer that spans the wisth of the page, and is visibile when you scroll to the bottom of the content.
+
+By default, the content footer has the following items:
+
+- `author.html`: Display the author of the page, if present.
+- `copyright.html`: Display copyright information about the website.
+- `last-updated.html`: Display the latest date that the website was updated.
+- `extra-footer.html`: A placeholder for arbitrary HTML you may add (see [](content-footer:extra-footer)).
+
+(content-footer:extra-footer)=
+## Add extra HTML to your content footer
+
+You may add custom HTML to the content footer via `conf.py`.
+This is a shortcut in case you wish to avoid defining your own HTML template.
+
+To do so, use the `extra_footer` configuration and provide any HTML that you wish.
+For example:
+
+```python
+html_theme_options = {
+ ...
+ "extra_footer": "hi there!
",
+}
+```
diff --git a/docs/customize/index.md b/docs/customize/index.md
index d3c0f58a..74771041 100644
--- a/docs/customize/index.md
+++ b/docs/customize/index.md
@@ -66,6 +66,7 @@ The following sections describe a few ways to customize the theme in more depth.
```{toctree}
sidebar-primary.md
sidebar-secondary.md
+footer-content.md
announcements.md
header.md
download.md
diff --git a/src/sphinx_book_theme/__init__.py b/src/sphinx_book_theme/__init__.py
index 1e627e64..6c327c81 100644
--- a/src/sphinx_book_theme/__init__.py
+++ b/src/sphinx_book_theme/__init__.py
@@ -180,6 +180,29 @@ def update_general_config(app, config):
config.templates_path.append(os.path.join(theme_dir, "components"))
+
+def update_templates(app, pagename, templatename, context, doctree):
+ """Update template names and assets for page build.
+
+ This is a copy of what the pydata theme does here to include a new section
+ - https://github.com/pydata/pydata-sphinx-theme/blob/0a4894fab49befc59eb497811949a1d0ede626eb/src/pydata_sphinx_theme/__init__.py#L173
+ """
+ # Allow for more flexibility in template names
+ template_sections = ["theme_footer_content_items"]
+ for section in template_sections:
+ if context.get(section):
+ # Break apart `,` separated strings so we can use , in the defaults
+ if isinstance(context.get(section), str):
+ context[section] = [
+ ii.strip() for ii in context.get(section).split(",")
+ ]
+
+ # Add `.html` to templates with no suffix
+ for ii, template in enumerate(context.get(section)):
+ if not os.path.splitext(template)[1]:
+ context[section][ii] = template + ".html"
+
+
def setup(app: Sphinx):
# Register theme
theme_dir = get_html_theme_path()
@@ -195,6 +218,7 @@ def setup(app: Sphinx):
app.connect("config-inited", update_general_config)
app.connect("html-page-context", add_metadata_to_page)
app.connect("html-page-context", hash_html_assets)
+ app.connect("html-page-context", update_templates)
# Nodes
SideNoteNode.add_node(app)
diff --git a/src/sphinx_book_theme/assets/scripts/index.js b/src/sphinx_book_theme/assets/scripts/index.js
index eadafd0a..f1763676 100644
--- a/src/sphinx_book_theme/assets/scripts/index.js
+++ b/src/sphinx_book_theme/assets/scripts/index.js
@@ -159,43 +159,6 @@ var initThebeSBT = () => {
initThebe();
};
-/**
- * Use Bootstrap helper function to enable tooltips.
- */
-var initTooltips = () => {
- $(document).ready(function () {
- $('[data-toggle="tooltip"]').tooltip({
- trigger: "hover",
- delay: { show: 500, hide: 100 },
- });
- });
-};
-
-/**
- * MutationObserver to move the ReadTheDocs button
- */
-function initRTDObserver() {
- const mutatedCallback = (mutationList, observer) => {
- mutationList.forEach((mutation) => {
- // Check whether the mutation is for RTD, which will have a specific structure
- if (mutation.addedNodes.length === 0) {
- return;
- }
- if (mutation.addedNodes[0].data === undefined) {
- return;
- }
- if (mutation.addedNodes[0].data.search("Inserted RTD Footer") != -1) {
- mutation.addedNodes.forEach((node) => {
- document.getElementById("rtd-footer-container").append(node);
- });
- }
- });
- };
-
- const observer = new MutationObserver(mutatedCallback);
- const config = { childList: true };
- observer.observe(document.body, config);
-}
/**
* Add no print class to certain DOM elements
@@ -228,8 +191,6 @@ window.toggleFullScreen = toggleFullScreen;
/**
* Set up functions to load when the DOM is ready
*/
-sbRunWhenDOMLoaded(initTooltips);
sbRunWhenDOMLoaded(initTocHide);
-sbRunWhenDOMLoaded(initRTDObserver);
sbRunWhenDOMLoaded(addNoPrint);
sbRunWhenDOMLoaded(setMode);
diff --git a/src/sphinx_book_theme/assets/styles/abstracts/_variables.scss b/src/sphinx_book_theme/assets/styles/abstracts/_variables.scss
index b046618b..c70e7b7c 100644
--- a/src/sphinx_book_theme/assets/styles/abstracts/_variables.scss
+++ b/src/sphinx_book_theme/assets/styles/abstracts/_variables.scss
@@ -7,12 +7,6 @@ $breakpoint-lg: 992px;
$breakpoint-md: 768px;
$breakpoint-sm: 576px;
-// Colors
-$grey--dark: #5a5a5a;
-$grey--medium: #aaa;
-$grey--light: #ccc;
-$non-content-grey: $grey--dark;
-
// Z-index stacking (from Bootstrap)
// ref: https://getbootstrap.com/docs/5.0/layout/z-index/
$zindex-sticky: 1020;
@@ -31,34 +25,21 @@ $box-border-radius: 0.4em;
$animation-time: 0.25s;
-$border-thin: 1px solid rgba(0, 0, 0, 0.1);
-
-// Overrides for pydata sphinx theme.
-// See https://github.com/pydata/pydata-sphinx-theme/blob/master/pydata_sphinx_theme/static/css/theme.css
-:root[data-theme="light"] {
+/**
+ * Variables that aren't impacted by light/dark
+ */
+html {
// Over-ride the pydata theme so that readers can use their system base
--pst-font-size-base: none;
+ --pst-header-height: 0px;
+}
+// Overrides for pydata sphinx theme.
+// See https://github.com/pydata/pydata-sphinx-theme/blob/master/pydata_sphinx_theme/static/css/theme.css
+html[data-theme="light"] {
--pst-color-primary: rgb(87, 154, 202);
- --pst-color-link: rgb(0, 113, 188);
- --pst-color-border: rgb(238, 238, 238);
-
- // Font sizes
- --sbt-font-size-regular: 100%;
- --sbt-font-size-large: 112.5%;
- --sbt-font-size-small-1: 87.5%;
- --sbt-font-size-small-2: 70%;
-
- // Variables for this theme
- --sbt-sidebar-font-size: var(--sbt-font-size-small-1);
- --sbt-header-article-font-size: var(--sbt-font-size-small-1);
- --sbt-prevnext-font-size: var(--sbt-font-size-small-1);
- --sbt-footer-font-size: var(--sbt-font-size-small-1);
-
- // Search variables
- --sbt-color-search-highlighted: rgb(243, 119, 38);
- --sbt-color-search-icon: rgb(164, 166, 167);
+}
- // Announcement
- --sbt-color-announcement: rgb(97, 97, 97);
+html[data-theme="dark"] {
+ --pst-color-primary: rgb(87, 154, 202);
}
diff --git a/src/sphinx_book_theme/assets/styles/base/_base.scss b/src/sphinx_book_theme/assets/styles/base/_base.scss
index b80896e6..75653d23 100644
--- a/src/sphinx_book_theme/assets/styles/base/_base.scss
+++ b/src/sphinx_book_theme/assets/styles/base/_base.scss
@@ -28,11 +28,6 @@
display: none;
}
-// default color for all the links
-a {
- color: var(--pst-color-link);
-}
-
// Print-specific utility classes
.onlyprint {
display: none;
diff --git a/src/sphinx_book_theme/assets/styles/base/_bootstrap.scss b/src/sphinx_book_theme/assets/styles/base/_bootstrap.scss
deleted file mode 100644
index 5d79176e..00000000
--- a/src/sphinx_book_theme/assets/styles/base/_bootstrap.scss
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
-* Bootstrap-specific hacks
-*/
-
-// Prevent columns w/ wide content from breaking the grid
-// ref: https://github.com/twbs/bootstrap/pull/30049/files
-.col {
- min-width: 0;
-}
diff --git a/src/sphinx_book_theme/assets/styles/base/_typography.scss b/src/sphinx_book_theme/assets/styles/base/_typography.scss
index 41b0bf0f..93a29f8a 100644
--- a/src/sphinx_book_theme/assets/styles/base/_typography.scss
+++ b/src/sphinx_book_theme/assets/styles/base/_typography.scss
@@ -3,57 +3,11 @@
*********************************************/
.bd-article-container {
- // Content links and link color
- a.headerlink {
- opacity: 0;
- margin-left: 0.2em;
-
- &:hover {
- background-color: transparent;
- color: var(--pst-color-link);
- opacity: 1 !important;
- }
- }
-
- a,
- a.nav-link, // to be more specific, so that pst style doesn't override
- a:visited {
- color: var(--pst-color-link);
- }
-
h1,
h2,
h3,
h4,
h5 {
- color: black;
- &:hover a.headerlink {
- opacity: 0.5;
- }
- // Make sure titles don't become hyperlink color when there are labels
- a.toc-backref {
- color: inherit;
- }
- }
-
- // Over-rides the pydata theme's large margins
- h3,
- h4,
- h5,
- h6 {
- margin-top: 1em;
- }
-
- // Lists
- ul,
- ol {
- p {
- margin-bottom: 0;
- }
- }
-
- // Misc text and directives
- p.centered {
- text-align: center;
+ color: var(--pst-color-text-muted);
}
}
diff --git a/src/sphinx_book_theme/assets/styles/components/_buttons.scss b/src/sphinx_book_theme/assets/styles/components/_buttons.scss
index ab7acdb6..d6620e01 100644
--- a/src/sphinx_book_theme/assets/styles/components/_buttons.scss
+++ b/src/sphinx_book_theme/assets/styles/components/_buttons.scss
@@ -9,9 +9,15 @@
align-items: center;
justify-content: center;
- background-color: white;
- color: $non-content-grey;
+ // Color should be more muted than pydata theme
+ color: var(--pst-color-text-muted);
+ &:hover {
+ color: var(--pst-color-text-base);
+ text-decoration: none;
+ }
+ background-color: var(--pst-color-background);
cursor: pointer;
+
border: none;
padding: 0.1rem 0.5rem; // Horizontal padding since labels have none
margin: 0 0.1rem;
@@ -55,7 +61,7 @@
padding: 0.5em;
// Style
- background-color: white;
+ background-color: var(--pst-color-background);
.headerbtn {
justify-content: left;
@@ -86,34 +92,3 @@
font-size: 1.2em; // Slightly smaller icons in a dropdown
}
}
-
-// HACK: Need this to be extra-selective to over-ride some too-specific PST CSS
-div.header-article-main {
- .header-article__left,
- .header-article__right {
- a,
- button,
- label {
- color: $non-content-grey;
-
- // Over-ride bootstrap defaults for clicking
- &:hover,
- &:focus {
- color: black;
- box-shadow: none;
- text-decoration: none;
- }
- }
- }
-}
-
-/**
- * In-page table of contents
- */
-.headerbtn-secondary {
- // Hide the button on wide screens since we display the TOC.
- display: block;
- @media (min-width: $breakpoint-md) {
- display: none;
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/components/_search.scss b/src/sphinx_book_theme/assets/styles/components/_search.scss
deleted file mode 100644
index 2ecf07aa..00000000
--- a/src/sphinx_book_theme/assets/styles/components/_search.scss
+++ /dev/null
@@ -1,18 +0,0 @@
-/*********************************************
-* Search bar and text styling from searches *
-*********************************************/
-
-// Highlighted search items are a slightly lighter version of Jupyter orange
-dt:target,
-span.highlighted {
- background-color: var(--sbt-color-search-highlighted);
-}
-
-.bd-search {
- .icon {
- color: var(--sbt-color-search-icon);
- }
- .search-button__kbd-shortcut {
- display: none;
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/content/_code.scss b/src/sphinx_book_theme/assets/styles/content/_code.scss
deleted file mode 100644
index d0484b9d..00000000
--- a/src/sphinx_book_theme/assets/styles/content/_code.scss
+++ /dev/null
@@ -1,47 +0,0 @@
-/*********************************************
-* Code and pre styling *
-*********************************************/
-
-code {
- font-size: 87.5% !important;
-}
-
-pre {
- border-radius: $box-border-radius;
- @include scrollbar-style();
-}
-
-// Over-ride Sphinx default so that content fills whitespace w/ margin content
-pre,
-div[class*="highlight-"] {
- clear: none;
-}
-
-.highlighttable {
- .linenos {
- vertical-align: baseline;
- }
-}
-
-// Code blocks should have a margin, but code *cells* get margin from a parent
-div.highlight {
- background: none;
- margin-bottom: 1em;
-}
-
-// CodeMirror styles for live thebe cells.
-.cm-s-default {
- font-family: var(--jp-code-font-family);
- font-size: var(--jp-code-font-size);
- line-height: var(--jp-code-line-height);
-}
-
-.CodeMirror-focused {
- background-color: var(--jp-cell-editor-active-background) !important;
- border: var(--jp-border-width) solid var(--jp-cell-editor-active-border-color);
- margin: -1px;
-}
-
-div.literal-block-wrapper {
- border: none;
-}
diff --git a/src/sphinx_book_theme/assets/styles/content/_field-lists.scss b/src/sphinx_book_theme/assets/styles/content/_field-lists.scss
deleted file mode 100644
index 88a9637c..00000000
--- a/src/sphinx_book_theme/assets/styles/content/_field-lists.scss
+++ /dev/null
@@ -1,10 +0,0 @@
-// Field lists
-// See: https://docutils.sourceforge.io/docs/user/rst/quickref.html#definition-lists
-// TODO the field list should be a different format,
-// but be wary of issues like https://github.com/pandas-dev/pydata-sphinx-theme/issues/193
-dl.simple,
-dl.field-list {
- & dd {
- margin-left: 1.5em;
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/content/_footnotes.scss b/src/sphinx_book_theme/assets/styles/content/_footnotes.scss
deleted file mode 100644
index 196572e2..00000000
--- a/src/sphinx_book_theme/assets/styles/content/_footnotes.scss
+++ /dev/null
@@ -1,18 +0,0 @@
-dl.footnote {
- span.fn-backref {
- font-size: 1em;
- padding-left: 0.1em;
- }
-
- // To ensure that the footnote text is aligned across lines
- dd {
- font-size: 0.9em;
- margin-left: 3em;
- }
-}
-
-// Footnotes and Citations
-.footnote-reference,
-a.bibtex.internal {
- font-size: 1em;
-}
diff --git a/src/sphinx_book_theme/assets/styles/content/_glossary.scss b/src/sphinx_book_theme/assets/styles/content/_glossary.scss
deleted file mode 100644
index e51f375a..00000000
--- a/src/sphinx_book_theme/assets/styles/content/_glossary.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-dl.glossary {
- dd {
- margin-left: 1.5em;
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/content/_math.scss b/src/sphinx_book_theme/assets/styles/content/_math.scss
deleted file mode 100644
index 900d9faa..00000000
--- a/src/sphinx_book_theme/assets/styles/content/_math.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-// Math and equations
-div.math {
- position: relative;
- display: flex;
- flex-direction: row-reverse;
- align-items: center;
-
- .headerlink {
- font-size: 1em;
- padding: 0 0.2em;
- margin-left: 0;
-
- &:hover {
- opacity: 1;
- }
- }
-
- &:hover .headerlink {
- opacity: 0.5;
- }
-}
-
-// Equation labels to the right
-span.eqno {
- font-size: 1.2em;
- margin-left: 0.5em;
-}
-
-.MathJax {
- overflow-x: auto;
- margin-right: auto !important; // HACK: to over-ride MathJax default behavior
- margin-left: auto !important;
- @include scrollbar-style();
-
- // HACK: Prevents vertical scroll-bar due to tiny padding bug
- // The div should be high enough to fit all math anyway, so no vertical scroll needed
- overflow-y: hidden;
-}
-
-// Compensate for the extra bottom margin of a preceding paragraph
-p ~ div.math {
- margin-top: -1.15rem;
-}
diff --git a/src/sphinx_book_theme/assets/styles/content/_quotes.scss b/src/sphinx_book_theme/assets/styles/content/_quotes.scss
index 229993f2..2e9f06a0 100644
--- a/src/sphinx_book_theme/assets/styles/content/_quotes.scss
+++ b/src/sphinx_book_theme/assets/styles/content/_quotes.scss
@@ -1,17 +1,14 @@
+/**
+ * Epigraphs and other "special" quote blocks
+ */
+
blockquote {
- margin: 1em;
- padding: 0.2em 1.5em;
- border-left: 4px solid #ccc;
-
&.pull-quote,
&.epigraph,
&.highlights {
font-size: 1.25em;
border-left: none;
- }
-
- div > p {
- margin-bottom: 0.5em;
+ background-color: var(--pst-color-background);
}
div > p + p.attribution {
diff --git a/src/sphinx_book_theme/assets/styles/content/_sidebar.scss b/src/sphinx_book_theme/assets/styles/content/_sidebar.scss
deleted file mode 100644
index 97c08b4c..00000000
--- a/src/sphinx_book_theme/assets/styles/content/_sidebar.scss
+++ /dev/null
@@ -1,24 +0,0 @@
-// Sidebar-specific CSS
-div.sidebar,
-aside.sidebar {
- &:not(.margin) {
- background-color: unset;
- padding: 1em;
- border-radius: $box-border-radius;
- border-color: $grey--medium;
-
- // On wide screens, the sidebar straddles margin and content
- @media (min-width: $breakpoint-lg) {
- width: 65%;
- margin: 0 -35% 0 $content-margin-gutter;
- }
- }
- .admonition {
- padding-left: 0.6rem;
- padding-right: 0.8rem;
- }
- > p {
- padding-left: 0rem;
- padding-right: 0rem;
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/content/_tableofcontents.scss b/src/sphinx_book_theme/assets/styles/content/_tableofcontents.scss
deleted file mode 100644
index f34f49e3..00000000
--- a/src/sphinx_book_theme/assets/styles/content/_tableofcontents.scss
+++ /dev/null
@@ -1,49 +0,0 @@
-// Table of Contents in the UI
-div.tableofcontents-wrapper p.caption {
- font-weight: 600 !important;
- margin-bottom: 0em !important;
-}
-
-// Table of Contents wrapper in page content
-div.toctree-wrapper {
- p.caption {
- font-size: 1.4em;
- }
-
- > ul {
- padding-left: 1.5em;
-
- // Top-level links should be a bit bigger
- > li > a {
- font-size: 1.1em;
- }
- }
-}
-
-// In-page contents
-div.contents {
- border-radius: $box-border-radius;
- padding: 1em 1em 2em 1em; // More padding on bottom to match whitespace from title
- p.topic-title {
- font-size: 1.5em;
- padding: 0 0 0 0.5em;
- margin-bottom: 0;
- }
-
- // Style the first few levels of this so it looks nice
- > ul {
- list-style: none;
- padding-left: 1em;
-
- > li {
- > ul {
- padding-left: 1.5em;
- }
-
- > p > a {
- font-size: 1.2em;
- margin-bottom: 0.5em;
- }
- }
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/extensions/_ablog.scss b/src/sphinx_book_theme/assets/styles/extensions/_ablog.scss
deleted file mode 100644
index b8856560..00000000
--- a/src/sphinx_book_theme/assets/styles/extensions/_ablog.scss
+++ /dev/null
@@ -1,41 +0,0 @@
-/*********************************************
-* ABlog *
-*********************************************/
-ul.ablog-archive {
- padding-left: 0px;
-}
-
-/* In-page post lists */
-ul.postlist {
- padding-left: 0;
-
- > li > p:first-child {
- font-size: 1.5em;
- }
-
- li {
- + li {
- margin-top: 2em;
- }
-
- > p > a {
- font-style: normal;
- font-size: 1.3em;
- }
- }
-}
-
-// Sidebar rules specifically for ABlog
-div.bd-sidebar {
- h2 {
- font-size: 1.5em;
- }
- h3 {
- font-size: 1.4em;
- }
-
- > ul {
- list-style: none;
- padding-left: 0;
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/extensions/comments.scss b/src/sphinx_book_theme/assets/styles/extensions/_comments.scss
similarity index 100%
rename from src/sphinx_book_theme/assets/styles/extensions/comments.scss
rename to src/sphinx_book_theme/assets/styles/extensions/_comments.scss
diff --git a/src/sphinx_book_theme/assets/styles/extensions/_myst-nb.scss b/src/sphinx_book_theme/assets/styles/extensions/_myst-nb.scss
deleted file mode 100644
index ca94928d..00000000
--- a/src/sphinx_book_theme/assets/styles/extensions/_myst-nb.scss
+++ /dev/null
@@ -1,41 +0,0 @@
-/*********************************************
-* MyST NB and Jupyter Notebooks *
-* ref: https://github.com/executablebooks/myst-nb
-*********************************************/
-div.cell {
- div.highlight {
- margin-bottom: 0em;
- }
-
- div.cell_input,
- div.cell_output pre {
- border-radius: $box-border-radius;
- border: 1px #ccc solid;
- }
-
- div.cell_output {
- padding-right: 0;
- }
-
- // On screens, we want to scoll, but on print show all
- @mixin cell-scroll {
- @include scrollbar-style();
- max-height: 24em;
- overflow-y: auto;
- @media print {
- max-height: unset;
- overflow-y: visible;
- }
- }
- &.tag_output_scroll,
- &.tag_scroll-output {
- div.cell_output {
- @include cell-scroll;
- }
- }
- &.tag_scroll-input {
- div.cell_input {
- @include cell-scroll;
- }
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/extensions/_readthedocs.scss b/src/sphinx_book_theme/assets/styles/extensions/_readthedocs.scss
deleted file mode 100644
index 82059ad9..00000000
--- a/src/sphinx_book_theme/assets/styles/extensions/_readthedocs.scss
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * ReadTheDocs pop-up menu over-rides.
- * We nest everything under `.bd-sidebar-primary` so that we use more selective
- * selectors than what RTD CSS uses.
- */
-.bd-sidebar-primary {
- // Parent container for everything else
- div#rtd-footer-container {
- position: sticky;
- bottom: 0;
- }
- // Extra selective selector to over-ride RTD
- .rst-versions.rst-badge {
- position: unset;
- font-size: 0.9em;
-
- // This is the top part of the dropdown, lists the current versions
- .rst-current-version {
- display: flex;
- align-items: center;
- gap: 0.2rem;
- height: 2.5rem;
- transition: background-color 0.2s ease-out;
- background-color: white;
- color: $non-content-grey;
- border-top: $border-thin;
-
- @media (max-width: $breakpoint-md) {
- // Slightly bigger on mobile so the button is more noticeable.
- height: 3rem;
- }
-
- &:hover {
- background-color: rgba(
- var(--pst-color-sidebar-expander-background-hover),
- 1
- );
- cursor: pointer;
- }
-
- .fa {
- color: $non-content-grey;
- }
-
- .fa-book {
- float: unset;
- margin-right: auto;
-
- &:after {
- content: "Read the Docs";
- font-family: sans-serif;
- font-weight: bold;
- margin-left: 0.2em;
- }
- }
- }
-
- .rst-other-versions {
- dt {
- color: #ccc;
- }
- }
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/extensions/_sphinx-tabs.scss b/src/sphinx_book_theme/assets/styles/extensions/_sphinx-tabs.scss
deleted file mode 100644
index 8d036838..00000000
--- a/src/sphinx_book_theme/assets/styles/extensions/_sphinx-tabs.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-/*********************************************
-* Sphinx Tabs *
-* ref: https://github.com/executablebooks/sphinx-tabs
-*********************************************/
-div.sphinx-tabs > div.sphinx-menu {
- padding: 0;
-}
-
-div.sphinx-tabs > div.sphinx-menu > a.item {
- width: auto;
- margin: 0px 0px -1px 0px;
-}
diff --git a/src/sphinx_book_theme/assets/styles/index.scss b/src/sphinx_book_theme/assets/styles/index.scss
index ea51490b..333bef44 100644
--- a/src/sphinx_book_theme/assets/styles/index.scss
+++ b/src/sphinx_book_theme/assets/styles/index.scss
@@ -12,44 +12,25 @@
// Basic styling applied throughout site
@import "base/base";
-@import "base/bootstrap";
@import "base/typography";
@import "base/print";
// Major theme layout, skeleton, and whitespace
-@import "sections/announcement";
-@import "sections/article";
-@import "sections/footer-article";
-@import "sections/footer-content";
+@import "sections/article-container";
@import "sections/header-article";
-@import "sections/headers";
+@import "sections/header-primary";
@import "sections/sidebar-primary";
@import "sections/sidebar-secondary";
-@import "sections/sidebars-toggle";
// Re-usable components across the theme
@import "components/buttons";
-@import "components/search.scss";
// Content blocks in standard Sphinx
-@import "content/code";
-@import "content/field-lists";
-@import "content/footnotes";
-@import "content/glossary";
@import "content/images";
@import "content/margin";
-@import "content/math";
@import "content/quotes";
-@import "content/sidebar";
-@import "content/tableofcontents";
// Content blocks from Sphinx extensions
-@import "extensions/ablog";
+
@import "extensions/comments";
-@import "extensions/myst-nb";
-@import "extensions/sphinx-tabs";
-@import "extensions/readthedocs";
@import "extensions/thebe";
-
-// Page-specific CSS
-@import "pages/search";
diff --git a/src/sphinx_book_theme/assets/styles/pages/_search.scss b/src/sphinx_book_theme/assets/styles/pages/_search.scss
deleted file mode 100644
index 5bfceb8b..00000000
--- a/src/sphinx_book_theme/assets/styles/pages/_search.scss
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Search page special-cases
- */
-
-#search-input::placeholder {
- color: var(--pst-color-text-muted);
-}
-
-// Turn off the extra search UI at the top of the page
-.bd-search-container {
- padding: 2rem;
- h1 {
- display: none;
- }
- form:first-of-type {
- display: none !important;
- }
-
- // Whitespace
- div#search-results {
- padding: 2rem;
- > h2 {
- margin-top: 0;
- }
- }
- // The results of a search
- ul.search {
- margin: 0;
- list-style: none;
-
- li {
- background-image: none;
- padding: 0;
- margin-bottom: 1em;
- padding-bottom: 1em;
- border-bottom: $border-thin;
- border-top: none;
-
- // First link is the page title, it should be a bit bigger
- > a {
- font-size: 1.2em;
- }
-
- div.context,
- p.context {
- margin: 0.5em 0 0 0;
-
- // Add a # before page section titles to make it clear they are sections
- a:before {
- content: "#";
- padding-right: 0.2em;
- color: $grey--medium;
- }
- }
- }
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_announcement.scss b/src/sphinx_book_theme/assets/styles/sections/_announcement.scss
deleted file mode 100644
index 5ff068f9..00000000
--- a/src/sphinx_book_theme/assets/styles/sections/_announcement.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-.bd-header-announcement {
- background-color: var(--sbt-color-announcement);
- color: #fff;
-}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_article-container.scss b/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
new file mode 100644
index 00000000..6edbdbc7
--- /dev/null
+++ b/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
@@ -0,0 +1,8 @@
+.bd-main .bd-content .bd-article-container {
+ // Re-adjust padding defaults to be flush on the top and right
+ padding-top: 0;
+ padding-right: 0;
+
+ // Unset overflow x so that sticky: top works for the article header
+ overflow-x: unset;
+}
\ No newline at end of file
diff --git a/src/sphinx_book_theme/assets/styles/sections/_article.scss b/src/sphinx_book_theme/assets/styles/sections/_article.scss
deleted file mode 100644
index 5e8ac3ae..00000000
--- a/src/sphinx_book_theme/assets/styles/sections/_article.scss
+++ /dev/null
@@ -1,22 +0,0 @@
-/*********************************************
-* Main content layout *
-*********************************************/
-.bd-main {
- .bd-content {
- padding: 0rem;
- justify-content: revert;
- .bd-article-container {
- position: relative; // needed for postion:sticky header-article
- overflow-x: unset; // needed for postion:sticky header-article
- padding: 0%;
- min-width: 0; // to prevent overflow in mobile website for flex containers
- }
- .bd-article {
- padding-right: 2rem;
- @media (max-width: $breakpoint-md) {
- padding-left: 1rem;
- padding-right: 1rem;
- }
- }
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_footer-article.scss b/src/sphinx_book_theme/assets/styles/sections/_footer-article.scss
deleted file mode 100644
index 77a1285a..00000000
--- a/src/sphinx_book_theme/assets/styles/sections/_footer-article.scss
+++ /dev/null
@@ -1,17 +0,0 @@
-/*********************************************
-* Footer - article *
-*********************************************/
-
-// Previous and next area at the bottom
-footer.bd-footer-article {
- border-top: none;
- padding: 0;
-
- .prev-next-area {
- font-size: var(--sbt-prevnext-font-size);
-
- p.prev-next-title {
- color: var(--pst-color-link);
- }
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss b/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
deleted file mode 100644
index 24ea7d9c..00000000
--- a/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-/*********************************************
-* Footer - content *
-*********************************************/
-footer {
- font-size: var(--sbt-font-size-small-1);
- &.bd-footer-content {
- display: flex;
- flex-wrap: wrap;
- padding: 15px;
- border-top: 1px solid #ccc;
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_header-article.scss b/src/sphinx_book_theme/assets/styles/sections/_header-article.scss
index 1917bf46..98ee1094 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_header-article.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_header-article.scss
@@ -2,24 +2,28 @@
* Top Bar *
* TODO: Rename much of these to article-header to conform with sphinx-basic-ng
*********************************************/
+// Wrapper container
.bd-header-article {
height: $header-article-height; // Fix the height so the TOC doesn't grow it
- background-color: white;
+ background-color: var(--pst-color-background);
transition: left 0.2s;
- font-size: var(--sbt-header-article-font-size);
+ font-size: .9em;
position: sticky;
top: 0;
+ padding-top: 0;
z-index: 1018;
-
+
@include header-height-mobile;
.scrolled & {
box-shadow: 0 6px 6px -6px rgba(0, 0, 0, 0.3);
}
+ // Inner container with content
.header-article-main {
height: $header-article-height;
@include header-height-mobile;
+ padding: 0 !important; // Override bootstrap default
.header-article__left,
.header-article__right {
diff --git a/src/sphinx_book_theme/assets/styles/sections/_header-primary.scss b/src/sphinx_book_theme/assets/styles/sections/_header-primary.scss
new file mode 100644
index 00000000..d6223106
--- /dev/null
+++ b/src/sphinx_book_theme/assets/styles/sections/_header-primary.scss
@@ -0,0 +1,3 @@
+.bd-header {
+ display: none;
+}
\ No newline at end of file
diff --git a/src/sphinx_book_theme/assets/styles/sections/_headers.scss b/src/sphinx_book_theme/assets/styles/sections/_headers.scss
deleted file mode 100644
index e8504158..00000000
--- a/src/sphinx_book_theme/assets/styles/sections/_headers.scss
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * A few different header CSS rules
- */
-.header-item {
- width: 100%;
- text-align: center;
-
- &:empty {
- display: none;
- }
-
- &.announcement {
- background-color: #616161;
- color: white;
- padding: 0.4em 12.5%; // Horizontal padding so the width is 75%
-
- @media (max-width: $breakpoint-md) {
- // Announcements can take a bit more width on mobile
- padding: 0.4em 2%;
- }
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss b/src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss
index b0f054e1..a9f60fce 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss
@@ -1,122 +1,31 @@
/*********************************************
* Left Nav Bar *
*********************************************/
+
.bd-sidebar-primary {
- padding-top: 0;
- padding: 0em;
- flex-basis: $leftbar-width-wide;
- font-size: var(--sbt-sidebar-font-size);
- top: 0px !important;
- max-height: 100vh;
- max-width: 100%;
- background: white;
- border-right: $border-thin;
transition: margin-left $animation-time ease 0s,
- opacity $animation-time ease 0s, visibility $animation-time ease 0s;
- overflow-y: unset; // To over-ride the pydata theme and allow for sticky items
- @include fill-vertical-screen-space();
-
- // On mobile, behave like a slide-out drawer
- @media (max-width: $breakpoint-md) {
- position: fixed;
- width: $leftbar-width-mobile;
- max-width: 300px;
- font-size: 1.2em;
- z-index: $zindex-offcanvas;
- }
-
- // The container for the sidebar content (stuff that isn't the RTD button)
- .bd-sidebar__content {
- overflow-y: auto;
- flex-grow: 1;
- display: flex;
- flex-direction: column;
- @include scrollbar-style();
- @include scrollbar-on-hover();
- }
-
- // Apply some basic padding so the dropdown buttons don't overlap w/ scrollbar
- .sidebar-start-items,
- .sidebar-end-items {
- padding: 1rem 1rem 1rem 1.5rem;
- }
-
- // This should always snap to the bottom even if there's no sidebar content
- .sidebar-end-items {
- margin-top: auto;
- margin-bottom: 2em;
- }
-
- nav ul.nav {
- // Sidebar link color
- li a,
- ul li a {
- color: $non-content-grey;
- padding-right: 1.5rem;
- }
- a:hover,
- li.active > a,
- li.active > a:hover {
- color: var(--pst-color-link);
- }
+ opacity $animation-time ease 0s, visibility $animation-time ease 0s;
- // Adjust padding to be a bit tighter
- ul {
- padding-left: 1rem;
- }
+ .navbar-brand {
+ height: unset;
}
- h1.site-logo {
- margin: 0.5em 0 0 0;
- font-size: 1.1em;
- color: black;
- text-align: center;
+ // Remove the header items that pop into the sidebar in the pydata theme
+ .sidebar-header-items {
+ display: none;
}
-
- div.navbar_extra_footer {
- text-align: center;
- font-size: 0.9em;
- color: $non-content-grey;
- margin-bottom: 3em;
- }
-
- // Single page
- &.single-page {
- border-right: 0;
- }
-}
-
-div.navbar-brand-box {
- @media (min-width: $breakpoint-md) {
- padding-top: 2em;
- }
-
- a.navbar-brand {
- width: 100%;
- height: auto;
- flex-direction: column;
-
- img {
- display: block;
- height: auto;
- width: auto;
- max-height: 10vh;
- max-width: 100%;
- margin: 0 auto;
- @media (min-width: $breakpoint-md) {
- max-height: 15vh !important;
- }
- }
+
+ // Remove the top border since there's no header items above
+ .sidebar-start-items {
+ border-top: none;
}
}
-nav.bd-links {
- margin-left: 0px; // Because the PST adds margin by default
- p.caption,
- .toctree-l1 a {
- padding-left: 0em;
+// Default visibility for left sidebar is the reverse of what it is on mobile.
+// Mobile behavior is defined in the pydata sphinx theme
+@media (min-width: 960px) {
+ input#__primary:checked~.bd-container .bd-sidebar-primary {
+ margin-left: -$leftbar-width-wide;
+ visibility: hidden;
}
- // Overriding PyData Theme Defaults so the navigation is always visible
- overflow-y: visible;
- max-height: none;
}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
index 413e5afa..f655f725 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
@@ -3,131 +3,7 @@
*********************************************/
.bd-sidebar-secondary {
- padding: 0px !important;
- right: -1em;
- height: auto;
- position: static; // .toc-item is made sticky so that z-index works well, for margin content
- max-height: unset;
- overflow-y: unset;
- max-width: 25%;
- flex: 0 0 25%;
- transition: margin-right 0.25s ease 0s, opacity 0.25s ease 0s,
- visibility 0.25s ease 0s;
-
- .tocsection {
- padding: 0.5rem 1rem !important;
- .scrolled & {
- box-shadow: 0 6px 6px -6px rgba(0, 0, 0, 0.3);
- }
-
- &:after {
- content: "\f107";
- font-family: "Font Awesome 5 Free";
- font-weight: 900;
- padding-left: 0.5em;
- transition: opacity 0.3s ease;
- }
- }
-
- // Show / hide the in-page TOC items
- @mixin show-inpage-toc {
- nav {
- max-height: 90vh;
- opacity: 1;
- overflow-y: auto;
- }
-
- // Hide the arrow when we display the toc
- .tocsection:after {
- opacity: 0;
- }
- }
-
- .toc-item {
- padding: 0rem;
- position: sticky; // this is made sticky so that z-index works well, for margin content
- z-index: 3;
- top: 0;
- height: auto;
- background: white;
- // On wide screens, show the TOC with hover or w/ a show class
- &:hover {
- @include show-inpage-toc;
- }
- }
-
- &.show {
- @include show-inpage-toc;
- }
-
- .toc-h2 {
- font-size: 0.85rem;
- }
- // Colors
- div.onthispage,
- .toc-entry a {
- color: $non-content-grey;
- }
-
- // On narrow screens, this should be offset to the right side until button is clicked
- @media (max-width: $breakpoint-md) {
- z-index: $zindex-offcanvas;
- top: 0;
- right: 0;
- position: fixed;
- height: 100%;
- width: $toc-width-mobile;
- max-width: 300px;
- background-color: white;
- border-left: $border-thin;
-
- // Fonts are a bit bigger on mobile, and nested headers get smaller
- font-size: 1.4em;
-
- li {
- font-size: 0.8em;
- }
- }
-
- // By default the nav is hidden unless a few conditions are met
- nav {
- opacity: 1;
- max-height: 0;
- overflow-y: hidden;
- background: white;
- transition: opacity 0.4s ease, max-height 0.7s ease;
- @include scrollbar-style();
- @include scrollbar-on-hover();
- // TOC link color
- a:hover,
- li.active > a.active {
- color: var(--pst-color-link);
- }
-
- li.active > a.active {
- border-left: 2px solid var(--pst-color-link);
- }
- }
-
- // On narrow screens, it should always be shown because it's off to the right
- @media (max-width: $breakpoint-md) {
- @include show-inpage-toc;
- }
-
- @media (min-width: $breakpoint-md) {
- max-width: 25%; // taken from col-md-3 used in prev HTML
- .toc-item {
- border-left: 1px solid var(--pst-color-border);
- }
- }
-
- .toc-entry a.nav-link {
- padding: 0.125rem 1rem !important;
- margin-left: 0rem;
- }
-
- // Make sure the pydata sphinx theme edit button doesn't show up
- div.editthispage {
- display: none;
- }
-}
+ // Remove padding so that it's flush on the top and left
+ padding-top: 0;
+ padding-left: 0;
+}
\ No newline at end of file
diff --git a/src/sphinx_book_theme/assets/styles/sections/_sidebars-toggle.scss b/src/sphinx_book_theme/assets/styles/sections/_sidebars-toggle.scss
deleted file mode 100644
index 91bcb204..00000000
--- a/src/sphinx_book_theme/assets/styles/sections/_sidebars-toggle.scss
+++ /dev/null
@@ -1,77 +0,0 @@
-/**************************************************
-* Rules that are specific to toggling the sidebar *
-**************************************************/
-input.sidebar-toggle {
- display: none;
- position: absolute;
-}
-
-input#__primary {
- // On wide screens, checking will hide everything
- @media (min-width: $breakpoint-md) {
- &:checked {
- & ~ .bd-container .bd-sidebar {
- visibility: hidden;
- opacity: 0;
- margin-left: -$leftbar-width-wide;
- }
-
- // When we hide the sidebar on widescreen, add some padding to content
- & ~ .bd-container .bd-main {
- padding-left: 4rem;
- padding-right: 4rem;
- }
- }
- }
-
- // On narrow screens, *unchecking* will hide everything, so it's hidden by default
- @media (max-width: $breakpoint-md) {
- &:not(:checked) ~ .bd-container .bd-sidebar {
- visibility: hidden;
- opacity: 0;
- margin-left: -$leftbar-width-mobile;
- }
- }
-}
-
-input#__secondary {
- // On narrow screens, it's hidden by default
- @media (max-width: $breakpoint-md) {
- &:not(:checked) ~ .bd-container .bd-toc {
- visibility: hidden;
- opacity: 0;
- margin-right: -$leftbar-width-mobile;
- }
- }
-}
-
-// **** Utility functions ****
-// Label at the top of the page
-label.overlay {
- &.overlay-primary,
- &.overlay-secondary {
- background-color: rgba(0, 0, 0, 0.54);
- }
- height: 0;
- opacity: 0;
- position: fixed;
- top: 0;
- transition: width 0ms, height 0ms, opacity $animation-time ease-out;
- width: 0;
-}
-
-// On narrow screens, we use this overlay to close the sidebar
-@media (max-width: $breakpoint-md) {
- input:checked + label.overlay {
- &.overlay-primary {
- z-index: $zindex-offcanvas - 1; // This puts it just below the primary sidebar
- }
-
- &.overlay-secondary {
- z-index: $zindex-sticky - 1; // This puts it just below the header
- }
- height: 100%;
- opacity: 1;
- width: 100%;
- }
-}
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/components/author.html b/src/sphinx_book_theme/theme/sphinx_book_theme/components/author.html
new file mode 100644
index 00000000..c92f5642
--- /dev/null
+++ b/src/sphinx_book_theme/theme/sphinx_book_theme/components/author.html
@@ -0,0 +1,5 @@
+{% if author %}
+
+{{ translate('By') }} {{ author }}
+
+{% endif %}
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/components/extra-footer.html b/src/sphinx_book_theme/theme/sphinx_book_theme/components/extra-footer.html
new file mode 100644
index 00000000..d6c1d90b
--- /dev/null
+++ b/src/sphinx_book_theme/theme/sphinx_book_theme/components/extra-footer.html
@@ -0,0 +1,5 @@
+{%- if theme_extra_footer %}
+
+{%- endif %}
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/header.html b/src/sphinx_book_theme/theme/sphinx_book_theme/components/sidebar-icons.html
similarity index 100%
rename from src/sphinx_book_theme/theme/sphinx_book_theme/sections/header.html
rename to src/sphinx_book_theme/theme/sphinx_book_theme/components/sidebar-icons.html
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/components/toc-button.html b/src/sphinx_book_theme/theme/sphinx_book_theme/components/toc-button.html
deleted file mode 100644
index 950a0d06..00000000
--- a/src/sphinx_book_theme/theme/sphinx_book_theme/components/toc-button.html
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html b/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html
index ade964cf..0d56fc1f 100644
--- a/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html
+++ b/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html
@@ -1,23 +1,15 @@
{% extends "pydata_sphinx_theme/layout.html" %}
{# ref: https://github.com/pydata/pydata-sphinx-theme/blob/master/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/layout.html #}
-{% set is_single_page = (theme_single_page == True) or (theme_single_page == "True") %}
-
{% block docs_main %}
-
+{# A tiny helper pixel to detect if we've scrolled #}
{{ super() }}
{% endblock %}
-{# Secondary sidebar #}
-{% block docs_toc %}
-{% if not remove_sidebar_secondary %}
- {% include "sections/sidebar-secondary.html" %}
-{% endif %}
-{% endblock %}
{% block docs_body %}
-
+{# Table of contents that is only displayed when printing the page #}
{{ pagetitle }}
@@ -37,9 +29,3 @@ {{ translate(theme_toc_title) }}
{{ super() }}
{% endblock %}
-
-{% block docs_navbar %}
-{% endblock %}
-
-{%- block footer %}
-{%- endblock %}
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-content.html b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-content.html
index c6d94894..1f7140d3 100644
--- a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-content.html
+++ b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-content.html
@@ -1,20 +1,9 @@
-
- {% if author %}
- {{ translate('By') }} {{ author }}
- {% endif %}
- {%- if show_copyright %}
- {%- if hasdoc('copyright') %}
- {% trans prefix=translate('Copyright'), path=pathto('copyright'), copyright=copyright|e %}© {{ prefix }} {{ copyright }}.{% endtrans %}
- {%- else %}
- {% trans prefix=translate('Copyright'), copyright=copyright|e %}© {{ prefix }} {{ copyright }}.{% endtrans %}
- {%- endif %}
- {%- endif %}
- {%- if last_updated %}
- {% trans prefix=translate('Last updated on'), last_updated=last_updated|e %}{{ prefix }} {{ last_updated }}.{% endtrans %}
- {%- endif %}
- {%- if theme_extra_footer %}
-
- {%- endif %}
-
+{#- This is essentially sections/footer.html but in the content footer #}
+{# because we don't have a full-width footer in this theme-#}
+
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-primary.html b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-primary.html
deleted file mode 100644
index 4fbed576..00000000
--- a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-primary.html
+++ /dev/null
@@ -1,24 +0,0 @@
-{% block docs_sidebar %}
-
-{% if sidebars and not is_single_page%}
-
-
-{% endif %}
-{% endblock %}
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-secondary.html b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-secondary.html
deleted file mode 100644
index e083adaf..00000000
--- a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar-secondary.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-{% set page_toc = generate_toc_html() %}
-{% block docs_toc %}
-
-{% endblock %}
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar.html b/src/sphinx_book_theme/theme/sphinx_book_theme/sections/sidebar.html
deleted file mode 100644
index e69de29b..00000000
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf b/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
index 122d36ba..97fec3bc 100644
--- a/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
+++ b/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
@@ -1,22 +1,20 @@
[theme]
inherit = pydata_sphinx_theme
pygments_style = tango
-sidebars = sidebar-logo.html, search-field.html, sbt-sidebar-nav.html
+sidebars = navbar-logo.html, search-field.html, sbt-sidebar-nav.html
stylesheet = styles/sphinx-book-theme.css
[options]
announcement =
single_page = False
-# DEPRECATE after a few release cycles
-expand_toc_sections = []
+secondary_sidebar_items = page-toc # Removes the extra page-specific links from sidebar
+footer_content_items = author.html, copyright.html, last-updated.html, extra-footer.html
path_to_docs =
repository_url =
repository_branch =
launch_buttons = {}
home_page_in_toc = False
logo_only =
-# DEPRECATE after a few release cycles
-navbar_footer_text =
show_navbar_depth = 1
toc_title = Contents
extra_navbar = Theme by the Executable Book Project
@@ -28,3 +26,7 @@ use_issues_button = False
use_repository_button = False
use_sidenotes = False
# Note: We also inherit use_edit_page_button from the PyData theme
+
+# DEPRECATE after a few release cycles
+expand_toc_sections = []
+navbar_footer_text =
From 26b350815865b6cd8f5a8e1084eca3a472e7f114 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Mon, 7 Nov 2022 10:23:50 +0000
Subject: [PATCH 02/65] [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---
src/sphinx_book_theme/__init__.py | 3 +--
src/sphinx_book_theme/assets/scripts/index.js | 1 -
src/sphinx_book_theme/assets/styles/content/_quotes.scss | 2 +-
.../assets/styles/sections/_article-container.scss | 2 +-
.../assets/styles/sections/_header-article.scss | 6 +++---
.../assets/styles/sections/_header-primary.scss | 2 +-
.../assets/styles/sections/_sidebar-primary.scss | 6 +++---
.../assets/styles/sections/_sidebar-secondary.scss | 2 +-
8 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/src/sphinx_book_theme/__init__.py b/src/sphinx_book_theme/__init__.py
index 6c327c81..d1d65f5a 100644
--- a/src/sphinx_book_theme/__init__.py
+++ b/src/sphinx_book_theme/__init__.py
@@ -180,10 +180,9 @@ def update_general_config(app, config):
config.templates_path.append(os.path.join(theme_dir, "components"))
-
def update_templates(app, pagename, templatename, context, doctree):
"""Update template names and assets for page build.
-
+
This is a copy of what the pydata theme does here to include a new section
- https://github.com/pydata/pydata-sphinx-theme/blob/0a4894fab49befc59eb497811949a1d0ede626eb/src/pydata_sphinx_theme/__init__.py#L173
"""
diff --git a/src/sphinx_book_theme/assets/scripts/index.js b/src/sphinx_book_theme/assets/scripts/index.js
index f1763676..32df18af 100644
--- a/src/sphinx_book_theme/assets/scripts/index.js
+++ b/src/sphinx_book_theme/assets/scripts/index.js
@@ -159,7 +159,6 @@ var initThebeSBT = () => {
initThebe();
};
-
/**
* Add no print class to certain DOM elements
*/
diff --git a/src/sphinx_book_theme/assets/styles/content/_quotes.scss b/src/sphinx_book_theme/assets/styles/content/_quotes.scss
index 2e9f06a0..f203aed5 100644
--- a/src/sphinx_book_theme/assets/styles/content/_quotes.scss
+++ b/src/sphinx_book_theme/assets/styles/content/_quotes.scss
@@ -1,7 +1,7 @@
/**
* Epigraphs and other "special" quote blocks
*/
-
+
blockquote {
&.pull-quote,
&.epigraph,
diff --git a/src/sphinx_book_theme/assets/styles/sections/_article-container.scss b/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
index 6edbdbc7..6c189d49 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
@@ -5,4 +5,4 @@
// Unset overflow x so that sticky: top works for the article header
overflow-x: unset;
-}
\ No newline at end of file
+}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_header-article.scss b/src/sphinx_book_theme/assets/styles/sections/_header-article.scss
index 98ee1094..fb880649 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_header-article.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_header-article.scss
@@ -7,12 +7,12 @@
height: $header-article-height; // Fix the height so the TOC doesn't grow it
background-color: var(--pst-color-background);
transition: left 0.2s;
- font-size: .9em;
+ font-size: 0.9em;
position: sticky;
top: 0;
padding-top: 0;
z-index: 1018;
-
+
@include header-height-mobile;
.scrolled & {
@@ -23,7 +23,7 @@
.header-article-main {
height: $header-article-height;
@include header-height-mobile;
- padding: 0 !important; // Override bootstrap default
+ padding: 0 !important; // Override bootstrap default
.header-article__left,
.header-article__right {
diff --git a/src/sphinx_book_theme/assets/styles/sections/_header-primary.scss b/src/sphinx_book_theme/assets/styles/sections/_header-primary.scss
index d6223106..94fd454d 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_header-primary.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_header-primary.scss
@@ -1,3 +1,3 @@
.bd-header {
display: none;
-}
\ No newline at end of file
+}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss b/src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss
index a9f60fce..8e0dc02c 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss
@@ -4,7 +4,7 @@
.bd-sidebar-primary {
transition: margin-left $animation-time ease 0s,
- opacity $animation-time ease 0s, visibility $animation-time ease 0s;
+ opacity $animation-time ease 0s, visibility $animation-time ease 0s;
.navbar-brand {
height: unset;
@@ -14,7 +14,7 @@
.sidebar-header-items {
display: none;
}
-
+
// Remove the top border since there's no header items above
.sidebar-start-items {
border-top: none;
@@ -24,7 +24,7 @@
// Default visibility for left sidebar is the reverse of what it is on mobile.
// Mobile behavior is defined in the pydata sphinx theme
@media (min-width: 960px) {
- input#__primary:checked~.bd-container .bd-sidebar-primary {
+ input#__primary:checked ~ .bd-container .bd-sidebar-primary {
margin-left: -$leftbar-width-wide;
visibility: hidden;
}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
index f655f725..eb7e196b 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
@@ -6,4 +6,4 @@
// Remove padding so that it's flush on the top and left
padding-top: 0;
padding-left: 0;
-}
\ No newline at end of file
+}
From 27250880c75920cd14a4fb7ba02a8d42cb96a73c Mon Sep 17 00:00:00 2001
From: Chris Holdgraf
Date: Mon, 7 Nov 2022 11:29:14 +0100
Subject: [PATCH 03/65] Fixing tox
---
src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf | 3 ++-
tox.ini | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf b/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
index 97fec3bc..40502132 100644
--- a/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
+++ b/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
@@ -7,7 +7,8 @@ stylesheet = styles/sphinx-book-theme.css
[options]
announcement =
single_page = False
-secondary_sidebar_items = page-toc # Removes the extra page-specific links from sidebar
+# Removes the extra page-specific links from sidebar
+secondary_sidebar_items = page-toc
footer_content_items = author.html, copyright.html, last-updated.html, extra-footer.html
path_to_docs =
repository_url =
diff --git a/tox.ini b/tox.ini
index 75757c5b..c21b5375 100644
--- a/tox.ini
+++ b/tox.ini
@@ -41,6 +41,10 @@ extras =
deps =
sphinx-theme-builder[cli]
commands =
+ ###### REMOVE THIS BEFORE MERGING PR
+ ###### OR WHEN NEW PYDATA THEME IS RELEASED
+ pip install git+https://github.com/pydata/pydata-sphinx-theme
+ ######
stb serve docs --open-browser
[testenv:py{37,38,39}-sphinx{3,4}]
From b9570fbd702714cfb4b81a6e6cecfe444808f032 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Tue, 15 Nov 2022 15:17:08 +1100
Subject: [PATCH 04/65] typo
---
docs/customize/footer-content.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/customize/footer-content.md b/docs/customize/footer-content.md
index 7e67d092..80ef2efc 100644
--- a/docs/customize/footer-content.md
+++ b/docs/customize/footer-content.md
@@ -1,6 +1,6 @@
# Customize the content footer
-There is a content footer that spans the wisth of the page, and is visibile when you scroll to the bottom of the content.
+There is a content footer that spans the width of the page, and is visibile when you scroll to the bottom of the content.
By default, the content footer has the following items:
From d12b6091354bb5c5e17b133d8607eb77faf2e0f3 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Sat, 19 Nov 2022 19:31:50 +1100
Subject: [PATCH 05/65] bd article p-r-2
---
.../assets/styles/sections/_article-container.scss | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/sphinx_book_theme/assets/styles/sections/_article-container.scss b/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
index 6c189d49..e2d49bb2 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
@@ -5,4 +5,7 @@
// Unset overflow x so that sticky: top works for the article header
overflow-x: unset;
+ .bd-article {
+ padding-right: 2rem;
+ }
}
From 7ea4c08432f8f639b22c3bdae2f1caffc48461fd Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Mon, 21 Nov 2022 01:51:06 +1100
Subject: [PATCH 06/65] footer and secondary sidebar
---
src/sphinx_book_theme/assets/scripts/index.js | 4 +-
.../assets/styles/content/_margin.scss | 2 +
.../styles/sections/_article-container.scss | 1 +
.../styles/sections/_sidebar-secondary.scss | 85 +++++++++++++++++++
.../theme/sphinx_book_theme/layout.html | 3 +
5 files changed, 93 insertions(+), 2 deletions(-)
diff --git a/src/sphinx_book_theme/assets/scripts/index.js b/src/sphinx_book_theme/assets/scripts/index.js
index 32df18af..04e29c39 100644
--- a/src/sphinx_book_theme/assets/scripts/index.js
+++ b/src/sphinx_book_theme/assets/scripts/index.js
@@ -97,9 +97,9 @@ var initTocHide = () => {
// Hide the TOC if any margin content is displayed on the screen
if (onScreenItems.length > 0) {
- $("div.bd-sidebar-secondary").removeClass("show");
+ $("div.bd-sidebar-secondary").addClass("hide");
} else {
- $("div.bd-sidebar-secondary").addClass("show");
+ $("div.bd-sidebar-secondary").removeClass("hide");
}
};
let manageScrolledClassOnBody = (entries, observer) => {
diff --git a/src/sphinx_book_theme/assets/styles/content/_margin.scss b/src/sphinx_book_theme/assets/styles/content/_margin.scss
index dc4b40d3..c5e9950d 100644
--- a/src/sphinx_book_theme/assets/styles/content/_margin.scss
+++ b/src/sphinx_book_theme/assets/styles/content/_margin.scss
@@ -91,6 +91,8 @@ aside.margin,
figure.margin,
.cell.tag_popout,
.cell.tag_margin {
+ z-index: 2;
+ position: relative;
@include margin-content();
// Make cell outputs take up more space if they're in the margin
diff --git a/src/sphinx_book_theme/assets/styles/sections/_article-container.scss b/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
index e2d49bb2..2a819b60 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
@@ -5,6 +5,7 @@
// Unset overflow x so that sticky: top works for the article header
overflow-x: unset;
+ min-width: 0; // prevent from overflowing the flex container
.bd-article {
padding-right: 2rem;
}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
index eb7e196b..1468cbe8 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
@@ -3,6 +3,91 @@
*********************************************/
.bd-sidebar-secondary {
+ position: static; // .toc-item is made sticky so that z-index works well, for margin content
+ max-height: unset;
+ overflow-y: unset;
+
+ .tocsection {
+ padding: 0.5rem 1rem !important;
+ .scrolled & {
+ box-shadow: 0 6px 6px -6px rgba(0, 0, 0, 0.3);
+ }
+
+ &:after {
+ opacity: 0;
+ }
+ }
+
+ // Show / hide the in-page TOC items
+ @mixin hide-inpage-toc {
+ nav {
+ opacity: 1;
+ max-height: 0;
+ overflow-y: hidden;
+ margin-bottom: 0rem;
+ }
+
+ // Hide the arrow when we display the toc
+ .tocsection:after {
+ opacity: 1;
+ content: "\f107";
+ font-family: "Font Awesome 5 Free";
+ font-weight: 900;
+ padding-left: 0.5em;
+ transition: opacity 0.3s ease;
+ }
+ }
+
+ .toc-item {
+ padding: 0rem;
+ position: sticky; // this is made sticky so that z-index works well, for margin content
+ z-index: 3;
+ top: 0;
+ height: auto;
+ background: white;
+ }
+
+ &.hide {
+ @include hide-inpage-toc;
+ }
+
+ .toc-h2 {
+ font-size: 0.85rem;
+ }
+
+ // On narrow screens, this should be offset to the right side until button is clicked
+ @media (max-width: $breakpoint-md) {
+ z-index: $zindex-offcanvas;
+ top: 0;
+ right: 0;
+ position: fixed;
+ height: 100%;
+ width: $toc-width-mobile;
+ max-width: 300px;
+ background-color: white;
+
+ // Fonts are a bit bigger on mobile, and nested headers get smaller
+ font-size: 1.4em;
+
+ li {
+ font-size: 0.8em;
+ }
+ }
+
+ // By default the nav is shown
+ nav {
+ max-height: 90vh;
+ opacity: 1;
+ overflow-y: auto;
+ background: white;
+ transition: opacity 0.4s ease, max-height 0.7s ease;
+ @include scrollbar-style();
+ @include scrollbar-on-hover();
+ a.nav-link {
+ margin-left: 0rem;
+ }
+ }
+
// Remove padding so that it's flush on the top and left
padding-top: 0;
padding-left: 0;
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html b/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html
index 0d56fc1f..8ddb4944 100644
--- a/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html
+++ b/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html
@@ -29,3 +29,6 @@ {{ translate(theme_toc_title) }}
{{ super() }}
{% endblock %}
+
+{%- block footer %}
+{%- endblock %}
\ No newline at end of file
From 18d8788ba235ccfd6df318f085fcbf92347e7ee7 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Sun, 20 Nov 2022 14:51:19 +0000
Subject: [PATCH 07/65] [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---
src/sphinx_book_theme/theme/sphinx_book_theme/layout.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html b/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html
index 8ddb4944..29d9ee4d 100644
--- a/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html
+++ b/src/sphinx_book_theme/theme/sphinx_book_theme/layout.html
@@ -31,4 +31,4 @@ {{ translate(theme_toc_title) }}
{% endblock %}
{%- block footer %}
-{%- endblock %}
\ No newline at end of file
+{%- endblock %}
From 6fb24ee315b384f2869841834d35bfc1430d1e35 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Tue, 22 Nov 2022 23:11:30 +1100
Subject: [PATCH 08/65] had to add _footer-content.scss, as pydata does not
have any style
---
src/sphinx_book_theme/assets/styles/index.scss | 1 +
.../styles/sections/_footer-content.scss | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
diff --git a/src/sphinx_book_theme/assets/styles/index.scss b/src/sphinx_book_theme/assets/styles/index.scss
index 333bef44..5100d849 100644
--- a/src/sphinx_book_theme/assets/styles/index.scss
+++ b/src/sphinx_book_theme/assets/styles/index.scss
@@ -21,6 +21,7 @@
@import "sections/header-primary";
@import "sections/sidebar-primary";
@import "sections/sidebar-secondary";
+@import "sections/footer-content";
// Re-usable components across the theme
@import "components/buttons";
diff --git a/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss b/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
new file mode 100644
index 00000000..e1277eac
--- /dev/null
+++ b/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
@@ -0,0 +1,18 @@
+/*********************************************
+* Footer - content *
+*********************************************/
+footer {
+ font-size: var(--sbt-font-size-small-1);
+ &.bd-footer-content {
+ display: flex;
+ flex-wrap: wrap;
+ padding: 15px;
+ border-top: 1px solid #ccc;
+ .bd-footer-content__inner {
+ padding-left: 0px;
+ p {
+ margin-bottom: 0px;
+ }
+ }
+ }
+}
\ No newline at end of file
From cca9a25b01d681ba9b17e9d4d03e87226372cd9b Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Tue, 22 Nov 2022 12:11:46 +0000
Subject: [PATCH 09/65] [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---
.../styles/sections/_footer-content.scss | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss b/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
index e1277eac..52a55d5e 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
@@ -2,17 +2,17 @@
* Footer - content *
*********************************************/
footer {
- font-size: var(--sbt-font-size-small-1);
- &.bd-footer-content {
- display: flex;
- flex-wrap: wrap;
- padding: 15px;
- border-top: 1px solid #ccc;
- .bd-footer-content__inner {
- padding-left: 0px;
- p {
- margin-bottom: 0px;
- }
+ font-size: var(--sbt-font-size-small-1);
+ &.bd-footer-content {
+ display: flex;
+ flex-wrap: wrap;
+ padding: 15px;
+ border-top: 1px solid #ccc;
+ .bd-footer-content__inner {
+ padding-left: 0px;
+ p {
+ margin-bottom: 0px;
}
}
-}
\ No newline at end of file
+ }
+}
From 52be8714bee3e85c5bf8e1d2d6c073d8fd357f5f Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Tue, 22 Nov 2022 23:12:28 +1100
Subject: [PATCH 10/65] had to add _footer-content.scss, as pydata does not
have any style
---
.../styles/sections/_footer-content.scss | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss b/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
index e1277eac..52a55d5e 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_footer-content.scss
@@ -2,17 +2,17 @@
* Footer - content *
*********************************************/
footer {
- font-size: var(--sbt-font-size-small-1);
- &.bd-footer-content {
- display: flex;
- flex-wrap: wrap;
- padding: 15px;
- border-top: 1px solid #ccc;
- .bd-footer-content__inner {
- padding-left: 0px;
- p {
- margin-bottom: 0px;
- }
+ font-size: var(--sbt-font-size-small-1);
+ &.bd-footer-content {
+ display: flex;
+ flex-wrap: wrap;
+ padding: 15px;
+ border-top: 1px solid #ccc;
+ .bd-footer-content__inner {
+ padding-left: 0px;
+ p {
+ margin-bottom: 0px;
}
}
-}
\ No newline at end of file
+ }
+}
From 5ef980ef15c785fe1fc2e0bd93ded104e0675675 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Wed, 23 Nov 2022 11:44:44 +1100
Subject: [PATCH 11/65] hide the header btn on wide screens
---
.../assets/styles/components/_buttons.scss | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/sphinx_book_theme/assets/styles/components/_buttons.scss b/src/sphinx_book_theme/assets/styles/components/_buttons.scss
index d6620e01..78e16225 100644
--- a/src/sphinx_book_theme/assets/styles/components/_buttons.scss
+++ b/src/sphinx_book_theme/assets/styles/components/_buttons.scss
@@ -92,3 +92,14 @@
font-size: 1.2em; // Slightly smaller icons in a dropdown
}
}
+
+/**
+ * In-page table of contents
+ */
+.headerbtn-secondary {
+ // Hide the button on wide screens since we display the TOC.
+ display: block;
+ @media (min-width: $breakpoint-md) {
+ display: none;
+ }
+}
From 3631c067e7819f6096d1dfd2212549a9746d99b8 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Thu, 24 Nov 2022 11:14:36 +1100
Subject: [PATCH 12/65] bd-main flex-grow is not necessary in sbt
---
src/sphinx_book_theme/assets/styles/index.scss | 1 +
src/sphinx_book_theme/assets/styles/sections/_article.scss | 3 +++
2 files changed, 4 insertions(+)
create mode 100644 src/sphinx_book_theme/assets/styles/sections/_article.scss
diff --git a/src/sphinx_book_theme/assets/styles/index.scss b/src/sphinx_book_theme/assets/styles/index.scss
index 5100d849..03f04790 100644
--- a/src/sphinx_book_theme/assets/styles/index.scss
+++ b/src/sphinx_book_theme/assets/styles/index.scss
@@ -16,6 +16,7 @@
@import "base/print";
// Major theme layout, skeleton, and whitespace
+@import "sections/article";
@import "sections/article-container";
@import "sections/header-article";
@import "sections/header-primary";
diff --git a/src/sphinx_book_theme/assets/styles/sections/_article.scss b/src/sphinx_book_theme/assets/styles/sections/_article.scss
new file mode 100644
index 00000000..7d5ee93d
--- /dev/null
+++ b/src/sphinx_book_theme/assets/styles/sections/_article.scss
@@ -0,0 +1,3 @@
+.bd-main {
+ flex-grow: 0;
+}
From aa2a93ac7da664cd8b1d290612a8752aa98666b3 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Thu, 24 Nov 2022 23:47:39 +1100
Subject: [PATCH 13/65] removing unnecessary style/mixins and adding some
---
.../assets/styles/abstracts/_mixins.scss | 41 -------
.../styles/sections/_article-container.scss | 4 +-
.../styles/sections/_header-article.scss | 2 +-
.../styles/sections/_sidebar-secondary.scss | 107 ++++++++----------
4 files changed, 48 insertions(+), 106 deletions(-)
diff --git a/src/sphinx_book_theme/assets/styles/abstracts/_mixins.scss b/src/sphinx_book_theme/assets/styles/abstracts/_mixins.scss
index 42eb45b8..d43358ee 100644
--- a/src/sphinx_book_theme/assets/styles/abstracts/_mixins.scss
+++ b/src/sphinx_book_theme/assets/styles/abstracts/_mixins.scss
@@ -1,35 +1,6 @@
/*********************************************
* SASS Mixins
*********************************************/
-/**
-* Scrollbars should be thinner and slightly rounded, with a grey background
-*/
-@mixin scrollbar-style() {
- &::-webkit-scrollbar {
- width: 0.3rem;
- height: 0.3rem;
- }
-
- &::-webkit-scrollbar-thumb {
- background: #c1c1c1;
- border-radius: 0.25rem;
-
- &:hover {
- background: #a0a0a0;
- }
- }
-}
-
-/**
-* Hide the scrollbar until the element is overed, so keep the page clean
-*/
-@mixin scrollbar-on-hover() {
- &:not(:hover) {
- &::-webkit-scrollbar-thumb {
- visibility: hidden;
- }
- }
-}
/**
* Header behavior on mobile
@@ -39,15 +10,3 @@
height: $header-article-height + 0.75em;
}
}
-
-/**
- * Forces an element to fill the vertical screen space,
- * but uses % on mobile because `vh` units behave weirdly on mobile.
- * ref: https://stackoverflow.com/questions/37112218/css3-100vh-not-constant-in-mobile-browser
- */
-@mixin fill-vertical-screen-space {
- height: 100vh; // On wide screens force this to take up the whole viewport
- @media (max-width: $breakpoint-md) {
- height: 100%; // So that height behaves properly on mobile
- }
-}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_article-container.scss b/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
index 2a819b60..7248e1bd 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_article-container.scss
@@ -1,12 +1,12 @@
.bd-main .bd-content .bd-article-container {
// Re-adjust padding defaults to be flush on the top and right
- padding-top: 0;
- padding-right: 0;
+ padding: 0rem;
// Unset overflow x so that sticky: top works for the article header
overflow-x: unset;
min-width: 0; // prevent from overflowing the flex container
.bd-article {
padding-right: 2rem;
+ padding-left: 2rem;
}
}
diff --git a/src/sphinx_book_theme/assets/styles/sections/_header-article.scss b/src/sphinx_book_theme/assets/styles/sections/_header-article.scss
index fb880649..1d828c02 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_header-article.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_header-article.scss
@@ -10,7 +10,7 @@
font-size: 0.9em;
position: sticky;
top: 0;
- padding-top: 0;
+ padding: 0 1rem;
z-index: 1018;
@include header-height-mobile;
diff --git a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
index 1468cbe8..508e2816 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
@@ -3,21 +3,6 @@
*********************************************/
.bd-sidebar-secondary {
- position: static; // .toc-item is made sticky so that z-index works well, for margin content
- max-height: unset;
- overflow-y: unset;
-
- .tocsection {
- padding: 0.5rem 1rem !important;
- .scrolled & {
- box-shadow: 0 6px 6px -6px rgba(0, 0, 0, 0.3);
- }
-
- &:after {
- opacity: 0;
- }
- }
-
// Show / hide the in-page TOC items
@mixin hide-inpage-toc {
nav {
@@ -28,64 +13,62 @@
}
// Hide the arrow when we display the toc
- .tocsection:after {
- opacity: 1;
- content: "\f107";
- font-family: "Font Awesome 5 Free";
- font-weight: 900;
- padding-left: 0.5em;
- transition: opacity 0.3s ease;
+ .tocsection {
+ .scrolled & {
+ box-shadow: 0 6px 6px -6px rgba(0, 0, 0, 0.3);
+ }
+ &:after {
+ opacity: 1;
+ content: "\f107";
+ font-family: "Font Awesome 5 Free";
+ font-weight: 900;
+ padding-left: 0.5em;
+ transition: opacity 0.3s ease;
+ }
}
}
- .toc-item {
- padding: 0rem;
- position: sticky; // this is made sticky so that z-index works well, for margin content
- z-index: 3;
- top: 0;
- height: auto;
- background: white;
- }
-
- &.hide {
- @include hide-inpage-toc;
- }
-
- .toc-h2 {
- font-size: 0.85rem;
+ @mixin show-inpage-toc {
+ nav {
+ max-height: 90vh;
+ opacity: 1;
+ overflow-y: auto;
+ background: white;
+ transition: opacity 0.4s ease, max-height 0.7s ease;
+ }
}
- // On narrow screens, this should be offset to the right side until button is clicked
- @media (max-width: $breakpoint-md) {
- z-index: $zindex-offcanvas;
- top: 0;
- right: 0;
- position: fixed;
- height: 100%;
- width: $toc-width-mobile;
- max-width: 300px;
- background-color: white;
-
- // Fonts are a bit bigger on mobile, and nested headers get smaller
- font-size: 1.4em;
+ @media (min-width: $breakpoint-md) {
+ position: static; // .toc-item is made sticky so that z-index works well, for margin content
+ max-height: unset;
+ overflow-y: unset;
+ .tocsection {
+ padding: 0.5rem 1rem !important;
+ }
+ .toc-item {
+ padding: 0rem;
+ position: sticky; // this is made sticky so that z-index works well, for margin content
+ z-index: 3;
+ top: 0;
+ height: auto;
+ background: white;
+ // On wide screens, show the TOC with hover or w/ a show class
+ &:hover {
+ @include show-inpage-toc;
+ }
+ }
+ a.nav-link {
+ margin-left: 0rem;
+ }
- li {
- font-size: 0.8em;
+ &.hide {
+ @include hide-inpage-toc;
}
}
// By default the nav is shown
nav {
- max-height: 90vh;
- opacity: 1;
- overflow-y: auto;
- background: white;
- transition: opacity 0.4s ease, max-height 0.7s ease;
- @include scrollbar-style();
- @include scrollbar-on-hover();
- a.nav-link {
- margin-left: 0rem;
- }
+ @include show-inpage-toc();
}
// Remove padding so that it's flush on the top and left
From fa16d07177b69b4e000b0c7b349df7efde5ed8e3 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Thu, 24 Nov 2022 23:51:26 +1100
Subject: [PATCH 14/65] adding noqa
---
src/sphinx_book_theme/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sphinx_book_theme/__init__.py b/src/sphinx_book_theme/__init__.py
index d1d65f5a..fff2c2be 100644
--- a/src/sphinx_book_theme/__init__.py
+++ b/src/sphinx_book_theme/__init__.py
@@ -184,7 +184,7 @@ def update_templates(app, pagename, templatename, context, doctree):
"""Update template names and assets for page build.
This is a copy of what the pydata theme does here to include a new section
- - https://github.com/pydata/pydata-sphinx-theme/blob/0a4894fab49befc59eb497811949a1d0ede626eb/src/pydata_sphinx_theme/__init__.py#L173
+ - https://github.com/pydata/pydata-sphinx-theme/blob/0a4894fab49befc59eb497811949a1d0ede626eb/src/pydata_sphinx_theme/__init__.py#L173 # noqa: E501
"""
# Allow for more flexibility in template names
template_sections = ["theme_footer_content_items"]
From fbf16bf085b8a4a641632f28b8edb039f2a3e8d4 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Fri, 25 Nov 2022 00:27:50 +1100
Subject: [PATCH 15/65] removing unnecessary class and editing sidebar
secondary option
---
src/sphinx_book_theme/assets/styles/base/_base.scss | 13 -------------
.../theme/sphinx_book_theme/theme.conf | 2 +-
2 files changed, 1 insertion(+), 14 deletions(-)
diff --git a/src/sphinx_book_theme/assets/styles/base/_base.scss b/src/sphinx_book_theme/assets/styles/base/_base.scss
index 75653d23..8a00b1c4 100644
--- a/src/sphinx_book_theme/assets/styles/base/_base.scss
+++ b/src/sphinx_book_theme/assets/styles/base/_base.scss
@@ -10,19 +10,6 @@
left: 0;
}
-// Hide an element without display: none but so that it takes no space
-.visually-hidden {
- clip: rect(0, 0, 0, 0) !important;
- border: 0 !important;
- height: 1px !important;
- margin: -1px !important;
- overflow: hidden !important;
- padding: 0 !important;
- position: absolute !important;
- white-space: nowrap !important;
- width: 1px !important;
-}
-
// We define our own display-none class since bootstrap uses !important and we want to be able to over-ride
.d-n {
display: none;
diff --git a/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf b/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
index 40502132..41253e7c 100644
--- a/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
+++ b/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
@@ -8,7 +8,7 @@ stylesheet = styles/sphinx-book-theme.css
announcement =
single_page = False
# Removes the extra page-specific links from sidebar
-secondary_sidebar_items = page-toc
+secondary_sidebar_items = page-toc.html
footer_content_items = author.html, copyright.html, last-updated.html, extra-footer.html
path_to_docs =
repository_url =
From a7d9b07c0d07639a4dd056bae1e4c4d5ec392ec7 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Fri, 25 Nov 2022 00:37:09 +1100
Subject: [PATCH 16/65] removing sidebar secondary buttons
---
.../assets/styles/sections/_sidebar-secondary.scss | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
index 508e2816..ac94a99a 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
@@ -71,6 +71,15 @@
@include show-inpage-toc();
}
+ // Make sure the pydata sphinx theme edit button doesn't show up
+ div.editthispage {
+ display: none;
+ }
+
+ div.sourceLink {
+ display: none;
+ }
+
// Remove padding so that it's flush on the top and left
padding-top: 0;
padding-left: 0;
From e3b5046bb52ff7a4a689e3776ebc3dd515be81c7 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Fri, 25 Nov 2022 00:43:58 +1100
Subject: [PATCH 17/65] hiding source link
---
.../assets/styles/sections/_sidebar-secondary.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
index ac94a99a..5d95ac8c 100644
--- a/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
+++ b/src/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
@@ -76,7 +76,7 @@
display: none;
}
- div.sourceLink {
+ div.sourcelink {
display: none;
}
From d2237ee2d8be28989f42a0acaf2a97124648286b Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Fri, 25 Nov 2022 13:54:48 +1100
Subject: [PATCH 18/65] pydata version
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 1d3ff833..2011aa5f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -23,7 +23,7 @@ readme = "README.md"
requires-python = ">=3.7"
dependencies = [
"sphinx>=4,<6",
- "pydata-sphinx-theme~=0.10.1",
+ "pydata-sphinx-theme~=0.12.0",
"pyyaml",
]
From bf3b8de81c72b3653a9627eac9ddd2475ebd3100 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Fri, 25 Nov 2022 14:41:03 +1100
Subject: [PATCH 19/65] span.sidenote and span.marginnote z-index
---
src/sphinx_book_theme/assets/styles/content/_margin.scss | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/sphinx_book_theme/assets/styles/content/_margin.scss b/src/sphinx_book_theme/assets/styles/content/_margin.scss
index c5e9950d..2402c121 100644
--- a/src/sphinx_book_theme/assets/styles/content/_margin.scss
+++ b/src/sphinx_book_theme/assets/styles/content/_margin.scss
@@ -76,6 +76,8 @@ input.margin-toggle {
span.sidenote,
span.marginnote {
+ z-index: 2;
+ position: relative;
sup {
user-select: none;
}
From f3ae6ff822d4817eb2e6ce2e7408b9ca80c3800e Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Fri, 25 Nov 2022 16:58:35 +1100
Subject: [PATCH 20/65] citation style
---
src/sphinx_book_theme/assets/styles/base/_typography.scss | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/sphinx_book_theme/assets/styles/base/_typography.scss b/src/sphinx_book_theme/assets/styles/base/_typography.scss
index 93a29f8a..29283c04 100644
--- a/src/sphinx_book_theme/assets/styles/base/_typography.scss
+++ b/src/sphinx_book_theme/assets/styles/base/_typography.scss
@@ -11,3 +11,10 @@
color: var(--pst-color-text-muted);
}
}
+
+// counteracting pydata style on a::before, for citation style
+a.brackets::before {
+ color: inherit;
+ font-family: inherit;
+ margin-right: 0rem;
+}
From bdf4a9d711fccd7629fdcf0727385550e55cb11c Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Sun, 27 Nov 2022 00:10:58 +1100
Subject: [PATCH 21/65] google link
---
tests/sites/base/index.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/sites/base/index.md b/tests/sites/base/index.md
index a1186b5b..c08e5daf 100644
--- a/tests/sites/base/index.md
+++ b/tests/sites/base/index.md
@@ -7,5 +7,5 @@ page1
page2
section1/index
titles/index
-https://google.com
+Google
```
From e9baa59415c3b55b95e69887bb5560f4d4ef63a6 Mon Sep 17 00:00:00 2001
From: AakashGC
Date: Sun, 27 Nov 2022 13:30:18 +1100
Subject: [PATCH 22/65] dependency changes
---
docs/conf.py | 2 +-
pyproject.toml | 6 +++---
tests/sites/base/conf.py | 2 +-
tests/test_build/build__sidebar-primary__nav.html | 4 ++--
tests/test_build/test_right_sidebar_title.html | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index 22bc47f5..2ff47caa 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -97,7 +97,7 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_css_files = ["custom.css"]
-jupyter_execute_notebooks = "cache"
+nb_execution_mode = "cache"
thebe_config = {
"repository_url": "https://github.com/binder-examples/jupyter-stacks-datascience",
"repository_branch": "master",
diff --git a/pyproject.toml b/pyproject.toml
index 2011aa5f..73f7f349 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -53,11 +53,11 @@ doc = [
"numpy",
"matplotlib",
"numpydoc",
- "myst-nb~=0.13.2",
+ "myst-nb~=0.16.0",
"nbclient",
"pandas",
"plotly",
- "sphinx~=4.0",
+ "sphinx>=4.0,<6",
"sphinx-design",
"sphinx-examples",
"sphinx-copybutton",
@@ -71,7 +71,7 @@ doc = [
test = [
"beautifulsoup4>=4.6.1,<5",
"coverage",
- "myst-nb~=0.13.2",
+ "myst-nb~=0.16.0",
"pytest~=7.1",
"pytest-cov>=3,<5",
"pytest-regressions>=2.0.1,<2.5.0",
diff --git a/tests/sites/base/conf.py b/tests/sites/base/conf.py
index c778039b..0bffb0c3 100644
--- a/tests/sites/base/conf.py
+++ b/tests/sites/base/conf.py
@@ -15,7 +15,7 @@
html_theme = "sphinx_book_theme"
html_copy_source = True
html_sourcelink_suffix = ""
-jupyter_execute_notebooks = "auto"
+nb_execution_mode = "auto"
# Base options, we can add other key/vals later
html_theme_options = {
diff --git a/tests/test_build/build__sidebar-primary__nav.html b/tests/test_build/build__sidebar-primary__nav.html
index 88298cb4..94e0b544 100644
--- a/tests/test_build/build__sidebar-primary__nav.html
+++ b/tests/test_build/build__sidebar-primary__nav.html
@@ -22,7 +22,7 @@
-
+