-
-
Notifications
You must be signed in to change notification settings - Fork 25
ENH: Implement sticky RHS table of contents with scroll highlighting #316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: mmcky <[email protected]>
Co-authored-by: mmcky <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #316 +/- ##
=======================================
Coverage ? 45.21%
=======================================
Files ? 2
Lines ? 387
Branches ? 0
=======================================
Hits ? 175
Misses ? 212
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:
|
…ebase - Resolved merge conflicts with modularized JavaScript and SCSS structure - Created new scrollspy.js module for sticky TOC functionality - Updated _page.scss with sticky positioning and active highlighting styles - Integrated scrollspy initialization into index.js - All sticky TOC features now compatible with v0.15.1 codebase
Updated for v0.15.1 CompatibilityThis PR has been updated to work with the latest main branch (v0.15.1) which includes the modernization refactoring from PR #335. Changes MadeAdapted to Modular Codebase:
Build & Tests:
Feature SummaryThe sticky RHS table of contents feature is now fully integrated with the modernized codebase:
Ready for review! 🚀 |
🎭 Visual Regression Test ResultsDetails
Flaky testsdesktop-chrome › theme.spec.ts › Theme Features › math equation rendering Skipped testsmobile-chrome › theme.spec.ts › Theme Features › f-string interpolation styling |
1. Fix scrollspy jQuery plugin timing issue: - Plugin IIFE was executing before jQuery was available - Caused silent JavaScript failure breaking author info rendering - Moved plugin definition inside initScrollSpy() function - Only define plugin when jQuery is available and needed 2. Enable Netlify preview deployment regardless of Playwright status: - Added if: always() condition to Netlify deploy step - Allows debugging HTML in browser even when visual tests fail - Deploy only runs for pull requests
|
Closing in favour of #350 |
This PR implements the sticky right-hand side (RHS) table of contents feature requested in #315, based on the original work in PR #144. The feature adds an optional sticky positioning behavior to the in-page TOC with automatic section highlighting as users scroll.
Key Features
sticky_contents = True, the RHS TOC remains visible while scrollingImplementation Details
Theme Configuration
Added new
sticky_contentsoption to theme configuration:Technical Changes
stickyclass when feature is enabledposition: sticky; top: 7remfor viewport-relative positioningAsset Sizes
Usage
To enable the sticky RHS TOC, add the following to your Sphinx configuration:
When enabled, the table of contents will:
The feature enhances navigation for long documents while preserving the existing user experience when disabled.
Fixes #315.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.