mdbook-numbering
A mdBook preprocessor that adds numbering.
- Adds numbers prior to chapter titles.
- Configurable numbering formats (e.g., "1.", "1.1.", "I.", "A.", etc.).
- Adds numbers to lines in code blocks.
Configuration
Add the following to your book.toml:
[]
Then configure as needed (see NumberingConfig), for example:
[]
# Configuration for heading numbering
= {
enable = true,
= "consecutive", # "consecutive" or "top"
}
# Configuration for code block line numbering
= {
enable = true,
}
Updates
0.2.1
- Show a warning if this preprocessor is not set to run after
katexpreprocessor whenkatexis used. - Minor code cleanup and documentation improvements.
- Minify the JavaScript file and the CSS file before including them in the preprocessed markdown.
0.2.0
- Added support for adding line numbers to code blocks using
highlightjs-line-numbers.js.
0.1.0
- Initial release with support for adding numbers to chapter titles.
Note
-
Using
highlightjs-line-numbers.jsto add line numbers to code blocks in the rendered HTML. The license ofhighlightjs-line-numbers.jsis MIT License, and is copied to src/highlightjs/LICENSE.Some modifications have been made to the original code to fit into this project.