sphinx-external-toc
sphinx-external-toc copied to clipboard
Advanced section numbering customization
This pull request introduces section numbering styles and improved numbering control to the sphinx-external-toc extension, making it possible to customize section numbers (numerical, roman, alphabetic, etc.) and restart numbering per subtree. It also integrates the sphinx-multitoc-numbering extension directly, disables the built-in Sphinx toctree collector, and adds support for new configuration options. The documentation and codebase have been updated to reflect these enhancements.
Section Numbering Styles and Restart Control
- Added support for customizable section numbering styles (
numerical,romanupper,romanlower,alphaupper,alphalower) and the ability to restart numbering per subtree via newstyleandrestart_numberingoptions in the ToC configuration. [1] [2] [3] [4] [5] [6] [7] [8] - Implemented validation for allowed numbering styles and added corresponding fields to the
TocTreedataclass. [1] [2]
Integration and Collector Changes
- Integrated
sphinx-multitoc-numberingas a dependency and initialized it in the extension setup. [1] [2] - Disabled the built-in Sphinx toctree collector and replaced it with a custom collector (
TocTreeCollectorWithStyles) that applies the new numbering styles and logic. [1] [2]
Documentation Updates
- Updated the
README.mdand user guide to document the new features, configuration options, and clarify the default behaviors for Jupyter Book users. Deprecated references to the old multitoc-numbering extension and clarified numbering behavior. [1] [2] [3]
Versioning
- Bumped the extension version to
1.1.0-devto reflect these major enhancements.