QuantEcon / QuantEcon/quantecon-book-theme
Theme static files not updated when using build cache
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.jsstyles/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
-
Version or hash the static filenames - Include version number or content hash in the filename (e.g.,
quantecon-book-theme-0.13.2.jsorquantecon-book-theme.abc123.js) -
Add cache-busting query parameters - Append version to URL (e.g.,
quantecon-book-theme.js?v=0.13.2) -
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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