mkdocs-enumerate-headings-plugin icon indicating copy to clipboard operation
mkdocs-enumerate-headings-plugin copied to clipboard

added exclude_h1 option to remove highest layer of numbering

Open TimChaubet-I4U opened this issue 1 year ago • 1 comments

We've added the exclude_h1 boolean option to exclude the highest layer of numbering from output. In case you only have one (or a few) header level 1 titles, and you don't want this layer to be numbered, you can set this to true.

So if you set in the yaml:

plugins:
  - enumerate-headings: 
      toc_depth: 6
      strict: false
      increment_across_pages: false
      exclude_h1: true

These markdown titles ...

# Top Layer Title
## subA
### someother title
## subB

will translate to

Top Layer Title

1. subA

1.2 someother title

2. subB

TimChaubet-I4U avatar Nov 23 '23 16:11 TimChaubet-I4U

Actually this might be done simpler.. you can try using the on_post_page() event like here:

https://github.com/timvink/mkdocs-enumerate-headings-plugin/pull/36/files#r1403687795

timvink avatar Nov 23 '23 19:11 timvink