Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing a nesting_level range instead of integer #519

Closed
olivierlacan opened this issue Oct 6, 2015 · 8 comments
Closed

Passing a nesting_level range instead of integer #519

olivierlacan opened this issue Oct 6, 2015 · 8 comments

Comments

@olivierlacan
Copy link

I have an admittedly edgy case. I generate all of http://keepachangelog.com 's index.html from its GitHub-hosted README.md

This means I'd like to exclude the h1 and h2 from the TOC.

Would you mind if I added an option to pass a nesting_range to HTML_TOC as an alternative to the existing nesting_level?

@robin850
Copy link
Collaborator

robin850 commented Oct 7, 2015

Hi!

Thanks for the proposal! Yes, it seems to be a pretty good idea, it's pretty common to have an h1 as the page's title so you don't need it inside the table of contents.

You can ask for help if you struggle with the C code! :-)

@olivierlacan
Copy link
Author

Thanks for the offer to help. I delved into the code yesterday a bit and I'll admit I couldn't figure out how to store a range in C. So I switched to the idea of storing some sort of offset integer instead and skip outputting heading levels below that offset.

That's when I noticed level_offset and wondered if it had anything to do with that but it doesn't seem so. At least it's not exposed externally it seems.

@robin850
Copy link
Collaborator

robin850 commented Jun 5, 2016

Hi @olivierlacan,

I'm sorry this got out of my radar ; I'm still interested in implementing this feature. Do you want to give it a try or you gave up (I would understand actually 😅 ) ?

@axilleas
Copy link

Any news on this? This seems like a neat feature :) Thanks!

@robin850
Copy link
Collaborator

robin850 commented Jan 28, 2017

@axilleas @olivierlacan : This feature is now available, it will be available in the next version of Redcarpet. ❤️

@olivierlacan
Copy link
Author

Robin, you're the best maintainer. Thanks so much for all your work!

@robin850
Copy link
Collaborator

Thank you for the kind words ! ❤️ 💙 💛 💚 💜

@axilleas
Copy link

Aww yiss!!! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants