Hi,
I like to propose two items to add to the spec
- Add the ability to number headers.
- Add the ability to add table of contents.
Perhaps, for auto-numbering headers, in the first few lines of a markdown text, we can add something like this: {auto-number-headers}.
Then, every time the header syntax appears (i.e #, ##, etc…), the render will auto number the sections like this: 1, 1.1, 1.2.4, 2.1.2 as it parses each level or header.
Here’s an example:
# My big topic
## My sub topic blah
### my sub sub topic foo foo
# My next big topic
## something
would render to this (other visual text effect typically rendered are not done here to convey the intent of this post.):
1. My big topic
1.1. My sub topic blah
1.1.1 my sub sub topic foo foo
2. My next big topic
2.1 something
For the table of content request, the raw markdown text would add {toc} and the render would know that this is where the table of content would be placed.
The render would first have to parse all headers (i.e. #, ##, etc…) then create a table of content that if a user clicks on it, it would bring the user to that part of the rendered markdown. Also, if both {auto-number-headers} and {toc}, the table of content would also include the number headers too.
This would be a nice addition to allow technical specs to be written easier. Additionally, it would make it a bit clearer in rendered markdown to know that something is at a different level header because size of text and other visual text effects do not always clearly convey the hierarchy of the document.