Skip to content

v2.3.1

Choose a tag to compare

@github-actions github-actions released this 26 Aug 01:33
· 51 commits to main since this release
b60457c

Headline: corrects two defects in what 2.3.0 shipped. Code cells nested inside a directive ({exercise}, {solution}, {note}) drew a run button that did nothing; they now register with the kernel and execute. Self-hosted stylesheet assets 404'd in myst build --html output, so every KaTeX font failed and maths fell back to system glyphs on statically built sites; asset URLs are now relative and resolve in every layout. Source Sans 3 is self-hosted too, removing the last third-party origin from the critical rendering path. Consumers upgrade by bumping the pinned release URL in site.template.

Added

  • Visual-fixture coverage for fancy ordered lists inside a directive. tests/visual/fixture/lists.md gains a prf:theorem-wrapped stamped list, and lists-markers asserts it renders with the same type, start, list-lower-roman delimiter-parens classes and drawn marker as the equivalent body-level list. Every fixture list previously sat in the page body, so LIST_RENDERERS reaching the prf:* subtree was accidental rather than asserted: it works because myst-to-react's proof renderer passes its children through the same <MyST/> dispatcher, and because nothing in styles/lists.css scopes a selector to body-vs-proof. Both are load-bearing and neither was pinned, so a change to either would silently return the ~330 list items across the dp books' 118 prf:* blocks to decimal markers — a regression far too small in area for the snapshot diff budget, which is why it is asserted against the DOM (#121).

Changed

  • Source Sans 3 is now self-hosted instead of @imported from fonts.googleapis.com. Google Fonts is blocked in mainland China, a significant share of the QuantEcon readership, and unlike the CDN stylesheets removed in 2.3.0 this one is the body font on every page rather than the maths on some of them. It also had the worst possible shape for a critical-path request: a CSS @import, discovered only after app.css had downloaded and parsed, so the browser could not preload it and the chain ran app.css → Google's CSS → fonts.gstatic.com woff2 across two extra origins. The font now ships from @fontsource-variable/source-sans-3 through the same Remix import route the KaTeX CSS uses, so its 14 .woff2 files are served from the site's own origin. The family is declared as Source Sans 3 Variable, so tailwind.config.js and the inlined critical CSS in app/root.tsx name it that way too, with plain Source Sans 3 kept next in the stack for a locally installed copy. Rendered text is unchanged in substance, but the @fontsource build's glyph metrics differ marginally from the Google-served static font, enough to re-wrap a line at the mobile viewport — so the linux mobile-chrome baselines were refreshed (#148); every desktop baseline is untouched (#131).

Fixed

  • Code cells nested inside a directive ({exercise}, {solution}, {note}, …) are now registered with the kernel, so their run button works and their outputs survive a kernel connection. @myst-theme/jupyter's notebookFromMdast walked only the mdast root's direct children, so a cell at root > block > exercise > block[kind=notebook-code] never entered notebook.cells or the idkmap — while the renderer matches block[kind=notebook-code] at any depth and drew a run button anyway. Clicking it logged no cell found on execute and did nothing, with no error visible to the reader; on a live-compute page the cell's pre-baked outputs also blanked as soon as the kernel attached, because the active output renderer could not find a cell to bind to. Fixed by a third patches/ entry (@myst-theme+jupyter+1.3.0.patch) that walks nested blocks depth-first and appends them in document order — which is execution order — while skipping {embed} subtrees, whose cells belong to another page's notebook and would otherwise collide in the shared key map. The existing block > container > code figure case and the markdown-cell fallback are unchanged. Note that nested cells now participate in Run all, so solution and exercise cells execute along with the rest of the page. (#117)
  • Self-hosted stylesheet assets no longer 404 in static builds. Remix rewrites every url() in a bundled stylesheet to an absolute /myst_assets_folder/… path, which resolves under myst start — the theme's own server mounts public/build there — but not in myst build --html output, where the assets land under build/_assets/ and mystmd's rewriter only fixes up .html, .js and .json, never .css. So the KaTeX stylesheet self-hosted in #125 loaded while all 60 of its font references failed, and maths fell back to system glyphs on every statically built site — the degradation that change set out to prevent. The build now rewrites those references to be relative to the stylesheet, which resolves identically under myst start, in a static build, and under a baseurl (where the absolute path was also wrong, affecting the per-PR preview deployments). Every rewritten target is checked to exist beside its stylesheet, so a wrong assumption fails the build instead of shipping silent 404s (#138).