Repository navigation
Releases
Releases · QuantEcon/quantecon-book-theme
v0.22.2
Fixed
- Links that open in a new tab now carry
rel="noopener"(#429) — the seventarget="_blank"links in the page template had norelhardening. Author and translator byline links getnoopener(keepingrel="author"on authors), so the sites they point at still see referrer attribution; the toolbar's "View Source" links and the "Launch Notebook" button getnoopener noreferrer. Browsers released since 2021 already implynoopenerfortarget="_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
localStoragekey 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
authorsoption nor Sphinx'sauthorrendered that literal text on every page. Sphinx 7.4 changed its defaultauthorfromunknowntoAuthor name not set, and the guard in the theme only knew the old string. The theme now treats both placeholders as unset, removes theauthorkey from the page context (so the same stale value written bysphinx_book_themecannot 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 atdocs/developer/.
v0.22.1
Changed
- Theme assets are now compiled on Node.js 24.21.0 —
sphinx-theme-builderinstalls its own Node.js into.nodeenv/at the version pinned under[tool.sphinx-theme-builder]inpyproject.toml, and that Node runsnpm installand webpack for every wheel: the PyPI release, CI and local installs. The pin still read20.18.0after CI'ssetup-nodesteps and.nvmrcmoved 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 now24.21.0, the current Node 24 LTS, and.nvmrcnames the same exact version sonvm usematches 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 withnodeenv-version-mismatchuntil it is removed (rm -rf .nodeenv); see the troubleshooting section of the developer setup guide. With.nvmrcpinned exactly, runnvm installonce after each bump, sincenvm useonly 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; thepy3-none-anywheel on PyPI is unaffected.
Fixed
- "View Source" no longer links to
Noneon generated pages (#384) — Sphinx's generated pages (genindex.html,search.html, and domain indices such as sphinx-proof'sprf-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 norepository_urlhad 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 upsphinx_book_themeas 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 defaultextensions.
CI
/update-snapshotsregenerates all baselines again — the workflow andnpm run test:visual:update(used bytox -e visual-update) passed a bare--update-snapshots, which since Playwright 1.50 meanschanged: 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. Thesnapshot-update-diffartifact 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
Added
- Dismissible announcement banner — a new
announcementtheme 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 inlocalStorageand is keyed to a hash of the message, so editing the text re-shows the banner for everyone who dismissed the previous one. An optionalannouncement_expiresISO 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 viaannouncement_style:bar(default) — a thin full-width strip that scrolls away below the toolbar — orcallout— 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). translatorstheme option (#426) — a newtranslatorsoption, parallel toauthors, 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 viatranslators_labelso each edition renders it in its own language; authors keep their current label-free rendering, and the matchingauthors_labeldefaults 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, becauseauthorsis 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 carryrel="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 treatsauthorsas a bibliographic field and returns it in a shape that varies with thelanguagesetting — 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
authorsvalue no longer renders one empty link per character —authorsgiven as a bare string (rather than the documented list of{name, url}entries) was iterated character by character, emitting an empty anchor for each. Bothauthorsandtranslatorsnow 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 thenodeenv-version-mismatcherror (an in-repo.nodeenv/left over from an older pinned Node.js version) and its fix (rm -rf .nodeenvthen rebuild), which otherwise blockstoxand editable installs locally. Also clarified thattoxkeeps 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-snapshotsagainst 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 owntest-results-verify/directory, since Playwright clears its output directory on every run and would otherwise erase the regeneration images that thesnapshot-update-diffartifact carries. After/update-new-snapshotsthe 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_TOKENdon't raisepush/pull_requestevents, so regenerated baselines landed while the PR'svisualcheck still showed its old failure, and the author had to push an empty commit. The workflow now pushes with an optionalSNAPSHOT_BOT_TOKENsecret when one is set, falling back toGITHUB_TOKENotherwise; the summary comment says which happened and what to do next. Seedocs/developer/visual-testing.mdfor how to add the secret. /update-snapshotsnow reads the fixtures pin from the PR branch — GitHub always runs the default branch's copy of a workflow onissue_commentevents, soupdate-snapshots.ymlwas resolvingFIXTURES_SHAfrom 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'sci.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'sGITHUB_TOKENcommit does not itself trigger CI./update-snapshotsis 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 acontents: writetoken, but had no author-association gate, so anyone able to comment on a PR could trigger that. Both now requireOWNER,MEMBER, orCOLLABORATOR.- 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-loader17 requires Node ≥22.11). Node 24 is the current active LTS (supported to April 2028). Applies toci.yml,docs.yml, andupdate-snapshots.yml;.nvmrcand 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-referencesfull-page screenshots intermittently rendered ~60px shorter than baseline, failing Playwright's dimension check before pixel tolerances apply.waitForReadynow waits fordocument.fonts.readyand 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-server5.2.2→5.2.4 (GHSA-79cf-xcqc-c78w),shell-quote1.8.1→1.8.4 (GHSA-w7jw-789q-3m8p, critical),qs6.14.2→6.15.2 (GHSA-q8mj-m7cp-5q26),ws8.18.0→8.21.0 (GHSA-58qx-3vcg-4xpx). All transitive dev/build-time only; built theme assets unchanged. The remaininguuidalert (GHSA-w5hq-g745-h8pq) was dismissed as not exploitable —sockjsonly callsuuid.v4(), the advisory affectsv3/v5/v6with a caller-providedbuf. - Dependabot now watches npm — added an
npmecosystem entry todependabot.yml(monthly, grouped into a single PR) alongside the existinggithub-actionsconfig.
v0.21.0
Changed
- LHS sidebar / content overlap fixed at common laptop widths (#387, #388) — at viewports 1024–1499px (most laptops: 1280, 1366, 1440),
.qe-mainnow pushes content right via a:has(.qe-sidebar:not(.inactive))conditionalpadding-leftso 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-existingbox-shadow: ... 9999pxwhite 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-mainto.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.stickynow has a bottom fade-mask hint and switches tooverflow-y: autowith a discreet scrollbar on:hover/:focus-within, so overflowing TOC entries are reachable.
CI
- Split visual regression CI into
build/visual/previewjobs (#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.visualandpreviewboth consume the fixtures build artifact produced bybuild; visual failure no longer blocks preview deploy. - Visual regression tests migrated to the
quantecon-book-theme-fixturesrepo (#390, #392) — replaces the oldlecture-python-programmingdependency (cloned + conda-built per run, ~3–5 min) with the curatedquantecon-book-theme-fixturesrepo (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 theupdate-snapshots.ymlhalf early so theissue_comment-triggered workflow onmainstayed consistent with the new fixture paths. - Cleared all open Dependabot security alerts (#385) —
npm audit fixplus major bumps of two build-timedevDependencies(css-minimizer-webpack-plugin7→8,sass) to clearserialize-javascriptadvisories. Transitive dev/build-time only; no runtime or shipped theme code changed. - Bump
actions/upload-pages-artifactfrom 4 to 5 (#382) - Bump
conda-incubator/setup-minicondafrom 3 to 4 (#383) - Bump
codecov/codecov-actionfrom 6.0.0 to 6.0.1 (#386) - Bump
actions/download-artifactfrom 7 to 8 (#395) - Bump
daun/playwright-report-summaryfrom 3 to 4 (#396)
v0.20.3
Fix h5 heading size hierarchy
Fixed
- h5 headings appearing larger than h4 (#381) —
h5had no dedicated CSS rule, so it inherited the browser default size and "PT Serif" (a visually larger serif font) whileh4used the more compact "Source Sans Pro" at1.2rem. Added explicith5styling (1rem, Source Sans Pro, weight 900) to restore the correct heading size hierarchy.
CI
v0.20.2
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. Withbibtex_reference_style: author_year, sphinxcontrib-bibtex places<em>et al.</em>as a sibling of the link, not a child. Addedspan:has(> a.reference) > emCSS selector to handle this structure across all theme variants (light, dark, gruvbox).
v0.20.1
Fix emphasis color on citation reference links
Fixed
- Emphasis color applied to "et al." in citation links (#366) — added
a.reference emCSS 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-bibtexupper bound (#366) — updated docs dependency from<=2.5.0to<3, allowing compatibility with the 2.6.x series (latest 2.6.5).
CI
v0.20.0
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: enInfrastructure Documentation
New developer guide covering three hosting options (GitHub Pages, subdomains, reverse proxy) for deploying translated lecture sites.
Other Changes
- Renamed
lecture-python-programming.mysttolecture-python-programmingacross CI workflows, tox config, Playwright config, and documentation.
Full Changelog: v0.19.0...v0.20.0
v0.19.0
myst-nb 1.4+ compatibility and inline code styling
What's Changed
Changed
sticky_contentsnow defaults toTrue(#371) — the sticky right-hand table of contents with scroll spy is now enabled by default. To revert, setsticky_contents: Falseinhtml_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-themeattribute on<html>(#373) — sets the standarddata-themeattribute for compatibility withmyst-nb1.4.0+. Resolves dark code cell backgrounds appearing on light-themed sites for users with OS dark mode enabled.inline_literal_boxtheme option (#373) — controls whether inline code literals display with background box/border styling (default:False).--qe-literal-colorCSS 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
- Seoul256:
Fixed
- Dark code cells with myst-nb 1.4+ (#373) — fixed
myst-nb1.4.0 falling through to OS preference for dark mode detection.
CI
- Bump
actions/upload-pages-artifactfrom 3 to 4 (#370) - Bump
actions/upload-artifactfrom 6 to 7 (#369)
Full Changelog: v0.18.0...v0.19.0
v0.18.0
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 (#1a1a2ebackground,#252540surfaces,#d4d4e4text,#6cb6fflinks) - 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.mdcovering 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
#444text on dark backgrounds - Unreadable table text in dark mode — table rows used
#333text 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