timvink/mkdocs-enumerate-headings-plugin

Single page enumeration - restart enumeration for every page?

Closed this issue · 5 comments

I want to have my single pages enumerated, ie. every page should have the enumeration starting at 1.

So I googled and tried ignorantshr/mkdocs-add-number-plugin first, but noticed that it does not work when using things like {% include 'template.md' %} - headers that are included from files are not enumerated correctly. The headers are printed correctly, but are ignored in the enumeration.

Then I noticed that your plugin is a rewrite and gave it a try and it worked like a charm even when using include statements. Thank you very much for your work!

However, as I understood your plugin focuses on the enumeration of all the content on the page and from what I have read does not provide the possibility that the enumeration "re-starts" for every page.

Can you please confirm or deny if your plugin can be used to also have single pages enumerated?

It's not currently supported, but it's very easy to implement.

I'll try to release a new version somewhere this weekend.

Btw, I am curious, what's your use-case for this feature?

I don't use this plugin anymore (I use mkdocs-print-site-plugin), but maybe there are use cases I've missed.

I'll try to release a new version somewhere this weekend.

That would be great and I would really appreciate it.

Btw, I am curious, what's your use-case for this feature?

I am trying to slowly move documentation that existed as separate PDF documents to an online version using mkdocs.

Each document is in a separate sub-directory and is nicely rendered using mkdocs, however I'd like to have it enumerated to make look a little more like an ordinary PDF document. Also having it enumerated makes it easier to distinguish the different levels of "indentations" more easily, because you don't have to rely on the different visual representation of the headings.

New version released: https://github.com/timvink/mkdocs-enumerate-headings-plugin/releases/tag/v0.5

Thank you very much for the new release. I can confirm that it works as described.

Adding the "increment_across_pages: false" option makes the enumeration re-start with every page.