QuantEcon / QuantEcon/quantecon-book-theme

Theme static files not updated when using build cache

Open
#341 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
56
Forks
24
Avg merge
4h 33m
Merged PRs (30d)
4

Description

Problem

When using a build cache (e.g., caching the _build folder between CI runs), the theme's static files (quantecon-book-theme.js and quantecon-book-theme.css) are not regenerated even when the theme package is updated.

This causes new theme features (like git metadata headers, collapsible stderr warnings, etc.) to not appear in builds that use a cached _build folder.

Root Cause

The cached _build/html/_static/ folder contains:

  • scripts/quantecon-book-theme.js
  • styles/quantecon-book-theme.css

When Sphinx/Jupyter Book runs with an existing _build folder, it doesn't regenerate these static files if they already exist, even if a newer version of the theme is installed.

Affected Repositories

This affects all lecture repositories that use build caching:

  • lecture-jax
  • lecture-python.myst
  • lecture-python-programming.myst

Possible Solutions

  1. Version or hash the static filenames - Include version number or content hash in the filename (e.g., quantecon-book-theme-0.13.2.js or quantecon-book-theme.abc123.js)

  2. Add cache-busting query parameters - Append version to URL (e.g., quantecon-book-theme.js?v=0.13.2)

  3. Force regeneration in theme - Have the theme check its version against cached files and regenerate if needed

Current Workaround

Rebuild the cache from scratch after theme updates, or manually delete the cached theme static files before building.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the cached _build/html/_static/scripts/quantecon-book-theme.js and _build/html/_static/styles/quantecon-book-theme.css paths, then compare how builds in lecture-jax, lecture-python.myst, and lecture-python-programming.myst handle cached assets. Decide which proposed cache invalidation approach fits the theme, and verify that a theme update causes the cached static files to be refreshed.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook
Domain
build-system
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.