sinedied / hads

:books: Markdown superpowered documentation for Node.js
MIT License
167 stars 28 forks source link

Ordering in [[index]] #36

Closed atifsyedali closed 4 years ago

atifsyedali commented 5 years ago

Would be nice to define some ordering in [[toc]]. I saw one Markdown system (don't remember which) that allowed files to be prefixed with a number xyz- (e.g. 001-intro, 002-background), and then while injecting the ToC would strip that prefixes out. Ordering maintained without extra effort.

sinedied commented 5 years ago

Nice idea! But I think you are speaking about [[index]], since [[toc]] is for within a file and can already be ordered.

I don't have time to do it anytime soon, but that should be not too difficult to implement: https://github.com/sinedied/hads/blob/master/lib/renderer.js#L61

I you want to take a look at it I'll gladly accept a PR 😃

atifsyedali commented 5 years ago

Oh yes, I mean [[index]]. Will have a look next week.

atifsyedali commented 5 years ago

Also, the README.md file should always be the first one in the list of children.