timvink/mkdocs-enumerate-headings-plugin

Feature request: Restart numbering across pages

ewels opened this issue · 1 comments

ewels commented

Thanks for the brilliant plugin! Just what I was looking for.

I'm building a site that has multiple tutorials within it. So far I'm just porting the first and increment_across_pages: true is working perfectly. However, when I add more I would like them each to have their own numbering system, across pages.

Would it be possible to add a new option to support this? I was thinking one way to approach could be to have a new restart_increment_after option that just resets the numbers back to 1 on any named page. For example, in my case it could look like this:

nav:
    - Home: index.md
    - Basic Training:
          - basic_training/index.md
          - basic_training/setup.md
          - basic_training/intro.md
    - Advanced Training:
          - advanced_training/index.md
          - advanced_training/setup.md
          - advanced_training/intro.md
plugins:
    - enumerate-headings:
        restart_increment_after:
          - advanced_training/index.md
        exclude:
          - index.md

Happy to take a look at a PR if you think it's a good idea..

Phil

Thanks for the brilliant plugin! Just what I was looking for.

You're welcome!

Happy to take a look at a PR if you think it's a good idea..

Thanks again, latest release now on pypi