Skip to content
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

Preprocessor for numbered section headings #2510

Open
StefanSalewski opened this issue Dec 21, 2024 · 0 comments
Open

Preprocessor for numbered section headings #2510

StefanSalewski opened this issue Dec 21, 2024 · 0 comments
Labels
C-enhancement Category: Enhancement or feature request

Comments

@StefanSalewski
Copy link

Problem

Section headings are not numbered automatically.

Manually numbering makes reordering chapters a bit difficult.

Proposed Solution

Use a mdbook preprocessor.

So I modified the provided example mdbook-remove-emphasis, resulting in https://github.com/StefanSalewski/mdbook-section-numbers

For me it seems to work, and it might help others who prefer numbered section headings as well.

Notes

I do not yet understand all the details of the provided example. This tools is more a tiny Rust exercise. Actually I do not assume that many people might be interested in this tool, as not that much people are writing mdbook online books and desire numbered sections. So, if you try this preprocessor, be carefully, make a backup of your book. You might have to adapt the program code or the Cargo.toml file. Actually I can not imagine that this tool can damage your books, as it does not modify the book's sources, but only the HTML output.

@StefanSalewski StefanSalewski added the C-enhancement Category: Enhancement or feature request label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement or feature request
Projects
None yet
Development

No branches or pull requests

1 participant