Skip to content

Releases

v0.22.2

Choose a tag to compare

@mmcky mmcky released this 05 Nov 02:42
2deedb1

Fixed

  • Links that open in a new tab now carry rel="noopener" (#429) — the seven target="_blank" links in the page template had no rel hardening. Author and translator byline links get noopener (keeping rel="author" on authors), so the sites they point at still see referrer attribution; the toolbar's "View Source" links and the "Launch Notebook" button get noopener noreferrer. Browsers released since 2021 already imply noopener for target="_blank", so this is defence in depth and keeps the template consistent for security linters.
  • The dark-mode toolbar button's tooltip now says "Toggle dark mode" (#132) — it still said "Change contrast", the feature's pre-0.18.0 name, while the docs and the rest of the UI call it dark mode. The localStorage key is unchanged, so existing readers keep their setting.
  • The page header no longer shows "Author name not set" (#428) — a site that sets neither the theme's authors option nor Sphinx's author rendered that literal text on every page. Sphinx 7.4 changed its default author from unknown to Author name not set, and the guard in the theme only knew the old string. The theme now treats both placeholders as unset, removes the author key from the page context (so the same stale value written by sphinx_book_theme cannot leak through either), and leaves the authors paragraph out of the header altogether instead of rendering it empty.

Documentation

  • README links to the published docs and the developer guide (#9) — adds PyPI and documentation badges, and replaces a link to a docs/contributing/ path that no longer exists with the developer guide at docs/developer/.

v0.22.1

Choose a tag to compare

@mmcky mmcky released this 09 Oct 04:42
e8d04b6

Changed

  • Theme assets are now compiled on Node.js 24.21.0 — sphinx-theme-builder installs its own Node.js into .nodeenv/ at the version pinned under [tool.sphinx-theme-builder] in pyproject.toml, and that Node runs npm install and webpack for every wheel: the PyPI release, CI and local installs. The pin still read 20.18.0 after CI's setup-node steps and .nvmrc moved to Node 24 in #401, so the published assets were still being built on Node 20, which reached end-of-life in April 2026. It is now 24.21.0, the current Node 24 LTS, and .nvmrc names the same exact version so nvm use matches the build. The compiled CSS and JS are byte-identical to the Node 20 build. After pulling this change, a local checkout with an existing .nodeenv/ fails with nodeenv-version-mismatch until it is removed (rm -rf .nodeenv); see the troubleshooting section of the developer setup guide. With .nvmrc pinned exactly, run nvm install once after each bump, since nvm use only switches to a version already installed. Building from source (an sdist, pip install --no-binary, or a git install) now needs a platform that nodejs.org ships a Node 24 binary for, which excludes 32-bit ARM Linux (linux-armv7l) and 32-bit Windows; the py3-none-any wheel on PyPI is unaffected.

Fixed

  • "View Source" no longer links to None on generated pages (#384) — Sphinx's generated pages (genindex.html, search.html, and domain indices such as sphinx-proof's prf-prf.html) have no source document, so the theme has no repository URL for them, and the toolbar's GitHub button rendered as <a href="None">, which link checkers report as a missing file. The button is now left out on those pages; every other page keeps it, with the same link as before. A site that sets no repository_url had the same broken button on every page, and now shows none.
  • Pages no longer request the missing _static/scripts/sphinx-book-theme.js (#454) — the theme sets up sphinx_book_theme as an extension for its Python features, and that registers sphinx-book-theme's own script on every page. The file lives in sphinx-book-theme's static folder, which is only copied when sphinx-book-theme is the active theme, so the script has never loaded on a quantecon-book-theme site and every page 404'd on it. The theme now drops that registration straight after setting the extension up, so the request goes away and nothing else changes. This holds whether the theme sets sphinx-book-theme up itself or Jupyter Book 1 has already loaded it from its default extensions.

CI

  • /update-snapshots regenerates all baselines again — the workflow and npm run test:visual:update (used by tox -e visual-update) passed a bare --update-snapshots, which since Playwright 1.50 means changed: only snapshots that fail comparison are rewritten. A real change small enough to stay within the screenshot tolerance therefore left the baselines untouched, and the summary comment wrongly said the regenerated snapshots "came out identical". One example is the toolbar's GitHub icon disappearing from the fixtures site after #453. Both now pass --update-snapshots=all, which rewrites every baseline whose render differs, as the developer docs describe. The snapshot-update-diff artifact now holds only the regenerated images, so the docs and the summary comment point to the PR's Files changed view for before and after.

v0.22.0

Choose a tag to compare

@mmcky mmcky released this 25 Aug 04:35

Added

  • Dismissible announcement banner — a new announcement theme option renders a notice at the top of every page (HTML allowed, so you can include emphasis and a link to changelog notes). Readers dismiss it with a ×; the dismissal persists in localStorage and is keyed to a hash of the message, so editing the text re-shows the banner for everyone who dismissed the previous one. An optional announcement_expires ISO date (YYYY-MM-DD) auto-hides the banner after that day — enforced client-side (so it disappears for visitors even without a rebuild) and at build time (an already-expired notice is omitted from the HTML). An invalid expiry date logs a warning and fails open. Two looks are available via announcement_style: bar (default) — a thin full-width strip that scrolls away below the toolbar — or callout — a boxed in-column notice; both adapt to dark mode and RTL. The banner defaults to empty/off, so existing sites are unaffected. The renderer iterates a list of notices internally so per-page announcements can be added additively later (tracked in #403).
  • translators theme option (#426) — a new translators option, parallel to authors, takes a list of {name, url} entries and renders them in the page header behind a visible label, so translated editions can credit the people who produced them. Authors keep the line directly under the page title and translators sit one row lower, right-aligned on the "Last changed" line and sharing its accent rule, so crediting them costs the header no extra vertical space; on narrow screens the two stack. The label defaults to "Translated by" and is overridable via translators_label so each edition renders it in its own language; authors keep their current label-free rendering, and the matching authors_label defaults to empty, so a site that sets neither renders byte-identical HTML. Either list can also be overridden per page in MyST or notebook front matter, which is how a team-translated edition credits whoever produced each lecture: a page value replaces the project value rather than merging with it, an explicit empty list leaves the block out on that page, and an absent key inherits the project value. Only the documented list-of-mappings form counts as an override, because authors is shared ground — docutils treats it as a bibliographic field and nbformat defines it in the notebook schema — so a page already carrying one written for something else keeps the project credit instead of rendering it badly or losing the byline. Author links now carry rel="author"; translator links deliberately do not, and the two lines carry distinct classes so downstream CSS can tell them apart. Front matter is read from the source file rather than through Sphinx's document metadata, because docutils treats authors as a bibliographic field and returns it in a shape that varies with the language setting — unworkable for a feature whose whole purpose is non-English editions. Part of the cross-theme attribution work tracked in QuantEcon/meta#360.

Fixed

  • A malformed authors value no longer renders one empty link per character — authors given as a bare string (rather than the documented list of {name, url} entries) was iterated character by character, emitting an empty anchor for each. Both authors and translators now normalise a bare string, a list of strings, or a single mapping into the documented form, and drop entries with no usable name.

Documentation

  • Developer setup troubleshooting for stale .nodeenv — documented the nodeenv-version-mismatch error (an in-repo .nodeenv/ left over from an older pinned Node.js version) and its fix (rm -rf .nodeenv then rebuild), which otherwise blocks tox and editable installs locally. Also clarified that tox keeps the toolchain fully repo-local (.tox/, .nodeenv/, node_modules/ are all git-ignored and regenerated), so nothing is installed into the base/global environment.

CI

  • Regenerated visual baselines are now re-checked in the same run (#358) — the snapshot workflow wrote new baselines and committed them with nothing checking that they were any good. Both jobs now re-run the suite without --update-snapshots against the same built site and report the outcome in the summary comment (it reports rather than gates — the commit still happens, so the images are always there to inspect). The re-run writes to its own test-results-verify/ directory, since Playwright clears its output directory on every run and would otherwise erase the regeneration images that the snapshot-update-diff artifact carries. After /update-new-snapshots the comment deliberately does not attribute a failure to the snapshots just added — that job leaves existing baselines untouched, so the cause may be a baseline the PR legitimately invalidated.
  • The snapshot bot's commit can now trigger CI (#358) — commits pushed with GITHUB_TOKEN don't raise push/pull_request events, so regenerated baselines landed while the PR's visual check still showed its old failure, and the author had to push an empty commit. The workflow now pushes with an optional SNAPSHOT_BOT_TOKEN secret when one is set, falling back to GITHUB_TOKEN otherwise; the summary comment says which happened and what to do next. See docs/developer/visual-testing.md for how to add the secret.
  • /update-snapshots now reads the fixtures pin from the PR branch — GitHub always runs the default branch's copy of a workflow on issue_comment events, so update-snapshots.yml was resolving FIXTURES_SHA from main rather than from the PR under test. A PR that bumps the pin (because it needs a fixtures change to exercise a new feature) therefore regenerated against the old fixtures, produced byte-identical baselines, committed nothing — and still posted "✅ regenerated and committed", leaving the PR's visual job failing with no way to fix it. Both jobs now resolve the pin out of the checked-out branch's ci.yml, falling back to the workflow-level value. Both summary comments also report what actually happened (committed vs. unchanged, and which fixtures commit was built against) instead of unconditionally claiming success, and note that the bot's GITHUB_TOKEN commit does not itself trigger CI.
  • /update-snapshots is now restricted to trusted actors — both jobs check out the PR branch and execute its code (pip install . runs the PR's build backend) with a contents: write token, but had no author-association gate, so anyone able to comment on a PR could trigger that. Both now require OWNER, MEMBER, or COLLABORATOR.
  • CI Node bumped 20 → 24 — Node 20 reached end-of-life in April 2026, and the grouped npm updates in #400 raised engine floors (sass-loader 17 requires Node ≥22.11). Node 24 is the current active LTS (supported to April 2028). Applies to ci.yml, docs.yml, and update-snapshots.yml; .nvmrc and the contributor docs (CONTRIBUTING.md, docs/developer/setup.md) move to Node 24 in step so local dev matches CI.
  • Stabilized flaky mobile-chrome visual tests on math-heavy pages — after the Playwright 1.57→1.60 (Chromium) bump in #400, math/proofs/cross-references full-page screenshots intermittently rendered ~60px shorter than baseline, failing Playwright's dimension check before pixel tolerances apply. waitForReady now waits for document.fonts.ready and polls until the document height holds steady for 750ms, instead of a fixed 500ms sleep after MathJax typesetting.
  • Cleared open Dependabot security alerts via npm audit fix — webpack-dev-server 5.2.2→5.2.4 (GHSA-79cf-xcqc-c78w), shell-quote 1.8.1→1.8.4 (GHSA-w7jw-789q-3m8p, critical), qs 6.14.2→6.15.2 (GHSA-q8mj-m7cp-5q26), ws 8.18.0→8.21.0 (GHSA-58qx-3vcg-4xpx). All transitive dev/build-time only; built theme assets unchanged. The remaining uuid alert (GHSA-w5hq-g745-h8pq) was dismissed as not exploitable — sockjs only calls uuid.v4(), the advisory affects v3/v5/v6 with a caller-provided buf.
  • Dependabot now watches npm — added an npm ecosystem entry to dependabot.yml (monthly, grouped into a single PR) alongside the existing github-actions config.

v0.21.0

Choose a tag to compare

@mmcky mmcky released this 04 Jun 23:13

Changed

  • LHS sidebar / content overlap fixed at common laptop widths (#387, #388) — at viewports 1024–1499px (most laptops: 1280, 1366, 1440), .qe-main now pushes content right via a :has(.qe-sidebar:not(.inactive)) conditional padding-left so the centered 900px content column no longer slides underneath the fixed sidebar. At viewports ≥1500px there's natural room for the sidebar as a left rail with content centered in the viewport (the established three-column look). Below 1024px the sidebar remains a drawer overlay (toggle to open). The pre-existing box-shadow: ... 9999px white halo workaround at ≤1340px is removed — it was masking the overlap; no longer needed now that the layout handles it.
  • Toolbar repositioned sticky → fixed (#387, #388) — lets the LHS sidebar extend visually to the viewport top, anchoring it to the same top-left corner as the toolbar's toggle button. Content's toolbar clearance moves from .qe-main to .qe-page (no visible change to content position).
  • Books built with this theme will see a small layout shift at 1024–1499px viewports on upgrade — content gets a left margin in that zone instead of overlapping the sidebar. Downstream sites should re-verify their snapshots / visual review.

Fixed

  • RHS "On this page" TOC truncated on long lectures (#387) — .qe-page__toc .inner.sticky now has a bottom fade-mask hint and switches to overflow-y: auto with a discreet scrollbar on :hover / :focus-within, so overflowing TOC entries are reachable.

CI

  • Split visual regression CI into build / visual / preview jobs (#394) — the Netlify preview now deploys regardless of whether visual tests pass, since reviewers need the preview link to decide whether failing visual tests reflect intentional design changes (in which case they /update-snapshots) or genuine regressions. Previously the preview was a later step of a single job and got skipped on visual-test failure. visual and preview both consume the fixtures build artifact produced by build; visual failure no longer blocks preview deploy.
  • Visual regression tests migrated to the quantecon-book-theme-fixtures repo (#390, #392) — replaces the old lecture-python-programming dependency (cloned + conda-built per run, ~3–5 min) with the curated quantecon-book-theme-fixtures repo (pip-built in ~30–60s, pinned to a fixed SHA so test input doesn't drift between PRs). Adds first-ever <dl> / glossary coverage. #392 landed the update-snapshots.yml half early so the issue_comment-triggered workflow on main stayed consistent with the new fixture paths.
  • Cleared all open Dependabot security alerts (#385) — npm audit fix plus major bumps of two build-time devDependencies (css-minimizer-webpack-plugin 7→8, sass) to clear serialize-javascript advisories. Transitive dev/build-time only; no runtime or shipped theme code changed.
  • Bump actions/upload-pages-artifact from 4 to 5 (#382)
  • Bump conda-incubator/setup-miniconda from 3 to 4 (#383)
  • Bump codecov/codecov-action from 6.0.0 to 6.0.1 (#386)
  • Bump actions/download-artifact from 7 to 8 (#395)
  • Bump daun/playwright-report-summary from 3 to 4 (#396)

v0.20.3

Choose a tag to compare

@mmcky mmcky released this 13 Apr 23:33

Fix h5 heading size hierarchy

Fixed

  • h5 headings appearing larger than h4 (#381) — h5 had no dedicated CSS rule, so it inherited the browser default size and "PT Serif" (a visually larger serif font) while h4 used the more compact "Source Sans Pro" at 1.2rem. Added explicit h5 styling (1rem, Source Sans Pro, weight 900) to restore the correct heading size hierarchy.

CI

  • Bump actions/github-script from 8 to 9 (#380)
  • Bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0 (#379)

v0.20.2

Choose a tag to compare

@mmcky mmcky released this 06 Apr 02:59

Fix emphasis color on textual citation "et al." text

Fixed

  • Emphasis color on "et al." in textual citations (#378) — the v0.20.1 fix only targeted <em> inside <a class="reference"> links. With bibtex_reference_style: author_year, sphinxcontrib-bibtex places <em>et al.</em> as a sibling of the link, not a child. Added span:has(> a.reference) > em CSS selector to handle this structure across all theme variants (light, dark, gruvbox).

v0.20.1

Choose a tag to compare

@mmcky mmcky released this 06 Apr 01:39

Fix emphasis color on citation reference links

Fixed

  • Emphasis color applied to "et al." in citation links (#366) — added a.reference em CSS overrides so <em> tags inside sphinxcontrib-bibtex citation reference links inherit color and font-weight from the parent anchor instead of the theme's emphasis styling. Applied across light, dark, and gruvbox color schemes.

Changed

  • Relaxed sphinxcontrib-bibtex upper bound (#366) — updated docs dependency from <=2.5.0 to <3, allowing compatibility with the 2.6.x series (latest 2.6.5).

CI

  • Bump codecov/codecov-action from 5.5.2 to 6.0.0 (#377)
  • Bump actions/deploy-pages from 4 to 5 (#376)

v0.20.0

Choose a tag to compare

@mmcky mmcky released this 23 Mar 03:37

Language Switcher for Multilingual Site Support

What's New

Language Switcher for Multilingual Sites

A new globe icon dropdown in the bottom toolbar enables users to switch between translated versions of a lecture site. The switcher:

  • Only renders when 2+ languages are configured via html_theme_options
  • Supports keyboard navigation, click-outside-to-close, and dark mode
  • Is fully accessible with ARIA roles and labels
  • Has zero impact on existing sites (no configuration required)

SEO hreflang Tags

Automatically injects <link rel="alternate" hreflang="..."> meta tags in <head> for all configured languages, improving search engine discovery of translated content.

Configuration Example

sphinx:
  config:
    html_theme_options:
      languages:
        - code: en
          name: English
          url: https://python-programming.quantecon.org
        - code: fa
          name: فارسی
          url: https://quantecon.github.io/lecture-python-programming.fa
        - code: zh-cn
          name: 中文
          url: https://quantecon.github.io/lecture-python-programming.zh-cn
      current_language: en

Infrastructure Documentation

New developer guide covering three hosting options (GitHub Pages, subdomains, reverse proxy) for deploying translated lecture sites.

Other Changes

  • Renamed lecture-python-programming.myst to lecture-python-programming across CI workflows, tox config, Playwright config, and documentation.

Full Changelog: v0.19.0...v0.20.0

v0.19.0

Choose a tag to compare

@mmcky mmcky released this 08 Mar 05:04

myst-nb 1.4+ compatibility and inline code styling

What's Changed

Changed

  • sticky_contents now defaults to True (#371) — the sticky right-hand table of contents with scroll spy is now enabled by default. To revert, set sticky_contents: False in html_theme_options.
  • Increased CSS specificity for custom code highlighting (#373) — ensures custom token colors are not overridden by pydata-sphinx-theme's Pygments rules.

Added

  • data-theme attribute on <html> (#373) — sets the standard data-theme attribute for compatibility with myst-nb 1.4.0+. Resolves dark code cell backgrounds appearing on light-themed sites for users with OS dark mode enabled.
  • inline_literal_box theme option (#373) — controls whether inline code literals display with background box/border styling (default: False).
  • --qe-literal-color CSS variable (#373) — inline code literal color integrated into the text color scheme system:
    • Seoul256: #af5f5f (muted rust) / #d78787 (soft rose dark)
    • Gruvbox: #9d0006 (dark red) / #fb4934 (bright red dark)
    • None: inherits text color

Fixed

  • Dark code cells with myst-nb 1.4+ (#373) — fixed myst-nb 1.4.0 falling through to OS preference for dark mode detection.

CI

  • Bump actions/upload-pages-artifact from 3 to 4 (#370)
  • Bump actions/upload-artifact from 6 to 7 (#369)

Full Changelog: v0.18.0...v0.19.0

v0.18.0

Choose a tag to compare

@mmcky mmcky released this 23 Feb 22:20

Dark Theme Overhaul

What's Changed

Complete Dark Theme Overhaul (#365)

A ground-up rewrite of the dark theme for a modern, consistent, and readable experience.

Changed

  • Replaced ad-hoc grays (#222/#333/#444) with a cohesive navy-charcoal palette (#1a1a2e background, #252540 surfaces, #d4d4e4 text, #6cb6ff links)
  • Images now use subtle opacity reduction instead of aggressive CSS inversion
  • CSS custom properties — all 16 palette colors declared as overridable --qe-dark-* custom properties; downstream projects can now customize colors without duplicating selectors

Added

  • Dark mode syntax highlighting — complete token colors for all ~40 Pygments syntax classes using a VS Code Dark+ inspired palette
  • FOUC prevention — early inline script applies dark mode class before first paint, eliminating the flash of white on page load
  • Dark mode documentation — new "Dark Mode" section in configure.md covering palette, syntax highlighting, admonitions, image handling, and CSS customization with full reference table of all overridable custom properties
  • Dark mode coverage for unstyled elements — modals, admonitions (type-specific accents), homepage elements, collapse/toggle bars, tooltips, autodoc, footnotes, and non-QuantEcon project overrides

Fixed

  • Double logo in dark theme — when a dedicated dark logo is configured, both light and dark logos were shown
  • Page header unreadable in dark mode — title link, authors, "Last changed" button, and changelog dropdown used #444 text on dark backgrounds
  • Unreadable table text in dark mode — table rows used #333 text on dark backgrounds
  • Indistinguishable links in dark mode — all links were #fff, same as body text
  • Inline code light border in dark mode — code spans retained light-theme borders
  • Sidebar search white in dark mode — search input area remained white
  • Toolbar border in dark mode — toolbar border remained light gray
  • Syntax highlighting gaps — only 3 of ~40 token types had dark mode overrides
  • Stderr warnings in dark mode — updated to use amber accents matching the new palette

Full Changelog: v0.17.1...v0.18.0