Conversation
The sticky right-hand table of contents with scroll spy was introduced in 0.17.0 and has proven to be the preferred experience. This change enables it by default for all projects using the theme. Users can opt out by setting sticky_contents: false in html_theme_options.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #371 +/- ##
=======================================
Coverage ? 45.92%
=======================================
Files ? 2
Lines ? 405
Branches ? 0
=======================================
Hits ? 186
Misses ? 219
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR changes the QuantEcon Book Theme’s default behavior to enable the sticky right-hand table of contents (“scroll spy” TOC) out of the box, aligning the default theme experience with the feature introduced in v0.17.0.
Changes:
- Switch
sticky_contentsdefault fromFalsetoTruein the theme’s default configuration. - Update user documentation to describe sticky TOC as the default and document how to opt out.
- Update build tests and changelog to reflect the new default behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/test_build.py |
Updates expectations so sticky TOC is enabled by default and adds coverage for explicitly disabling it. |
src/quantecon_book_theme/theme/quantecon_book_theme/theme.conf |
Sets sticky_contents = True as the theme default option. |
docs/user/configuration.md |
Reframes sticky TOC docs as default-enabled and provides opt-out instructions. |
CHANGELOG.md |
Adds an Unreleased entry noting the default change and how to revert. |
Comments suppressed due to low confidence (1)
docs/user/configuration.md:195
- The “Disable auto-expansion” section now shows only
"contents_autoexpand": False. Sincecontents_autoexpandonly affects the sticky TOC, it would be clearer to explicitly state that this option has an effect only whensticky_contentsis enabled (now the default), so readers don’t expect it to change the classic/non-sticky TOC.
### Disable auto-expansion
```python
html_theme_options = {
...
"contents_autoexpand": False,
...
}
When contents_autoexpand is False, only top-level section names are displayed.
</details>
---
You can also share your feedback on Copilot code review. [Take the survey](https://www.surveymonkey.com/r/XP6L3XJ).
🎭 Visual Regression Test ResultsDetails
Skipped testsmobile-chrome › theme.spec.ts › Theme Features › f-string interpolation styling |
- test: assert back-to-top and data-autoexpand absent when sticky disabled - docs: note contents_autoexpand only affects sticky TOC - changelog: clarify opt-out for both Python conf.py and YAML _config.yml
|
Also addressed in 51942cc (suppressed suggestion on Also confirming: |
|
Summary
Makes
sticky_contentsdefault toTrueso the sticky right-hand table of contents with scroll spy is enabled out of the box.The sticky TOC was introduced in v0.17.0 (#350) and has proven to be the preferred experience. This change makes it the default for all projects using the theme — no configuration needed.
Changes
theme.conf— changedsticky_contents = False→sticky_contents = Trueconfiguration.md— updated docs to describe sticky TOC as the default, with instructions on how to disable ittest_build.py— updated tests to expect sticky TOC enabled by default and added a test for explicitly disabling itCHANGELOG.md— added unreleased entryOpting out
Projects that prefer the classic TOC can set: