Open zainimran opened 6 years ago
Hi @zainimran
Have you tried the bullets options? You can try setting that to '1.'
.
@doowb how would you increment the order number?
Markdown will do that automatically if all of the numbers are 1.
.
Edit: technically... a markdown renderer will create an ordered html list which will add the numbers.
Can you show me an example? I am trying to get an ordered table of content rendered for a project
Examples generating the TOC for a "README.md" file
$ markdown-toc README.md --bullets "1."
const toc = require('markdown-toc');
toc('# One\n\n## One A\n\n## One B\n\n# Two\n\n## Two A\n\n## Two B', { bullets: '1.' }).content;
// Results in:
// 1. [One](#one)
// 1. [One A](#one-a)
// 1. [One B](#one-b)
// 1. [Two](#two)
// 1. [Two A](#two-a)
// 1. [Tow B](#two-b)
Oh but I was looking for something like this:
@zainimran I think to get those results you'll have to set the option nobullet: true
so one isn't rendered, then use a custom linkify
option. This comment has an example. The tok
has additional properties to help know what level and index you're looking at to create the correct numbers.
If I find the time, I'll try to get an example working.
Request for an option for generating toc markdown in the form of an ordered list.