signalwerk / gatsby-remark-table-of-contents

gatsby remark plugin to generate table of contents
21 stars 10 forks source link

Use <ol> element instead of <ul> #8

Closed dimitrisraptis96 closed 4 years ago

dimitrisraptis96 commented 4 years ago

Hi! Thanks for this plugin. It's really handy for long blog posts.

While using your plugin, I had the need to change the root element of your toc markdown component from <ul> to <ol>.

Is this functionality somehow supported?

signalwerk commented 4 years ago

Would be nice to set it in the options. If you feel like send me a pull request.

thomasjungblut commented 4 years ago

@signalwerk any hints on how to do it? Seems to be in mdast-util-toc somewhat hardcoded.

signalwerk commented 4 years ago

@thomasjungblut thank you for taking on that challenge and already have a look where to start. I think it would make sense to have an additional Option in mdast-util-toc options.ordered. So if you could add an option to the mdast-util-toc we could pass on these options. Or what do you think would make sense?

signalwerk commented 4 years ago

@thomasjungblut awesome! love your PR Thank you for your effort!

thomasjungblut commented 4 years ago

@signalwerk let me know when you find the time to review #10 :)

signalwerk commented 4 years ago

🥳 super awesome. this is available from v0.2.0 on. I added now a new bundler (rollup) and some tests to have everything properly together. I also added you in the readme.md