mixu / markdown-styles

Markdown to static HTML generator and multiple CSS themes for Markdown
1.85k stars 250 forks source link

Add argument to number headings in table of contents #4

Closed XertroV closed 9 years ago

XertroV commented 10 years ago

Added --number-toc as an argument.

Normally {{toc}} will produce a list of headings without any indication as to their rank. By providing this argument the generated Table of Contents will include numerical hierarchical descriptors on the left of each heading in the Table of Contents only.

Example:

TitleA

## HeadingA
### HeadingB
## HeadingC
## HeadingD
# TitleB
## HeadingE
### HeadingF

Produces: TitleA 1 - HeadingA 1.1 - HeadingB 2 - HeadingC 3 - HeadingD TitleB 1 - HeadingE 1.1 - HeadingF

mixu commented 9 years ago

Sorry for not merging this at the time! This feature is now supported via the customizable {{toc}} partial, which in combination with helpers can achieve a similar effect.