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

Add support for kramdown's no_toc #15

Closed
allejo opened this issue Oct 4, 2018 · 3 comments
Closed

Add support for kramdown's no_toc #15

allejo opened this issue Oct 4, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@allejo
Copy link
Owner

allejo commented Oct 4, 2018

Description

Kramdown's official method of hiding a heading from their auto-TOC is to use the no_toc class. I already have the capability of extracting IDs, so I'm thinking to extract classes and check for no_toc there.

Let's see how performance hungry this feature would be.

Sample Usage

# Contents header
{:.no_toc}

* A markdown unordered list which will be replaced with the ToC, excluding the "Contents header" from above
{:toc}

# H1 header

## H2 header

Expected TOC

- H1 header
  - H2 header
@allejo allejo added the enhancement New feature or request label Oct 4, 2018
@stale
Copy link

stale bot commented Oct 18, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 18, 2018
@allejo allejo added pinned and removed wontfix This will not be worked on labels Oct 18, 2018
@m5o
Copy link

m5o commented Oct 22, 2018

Do you think something similar to this would also possible?

https://github.com/toshimaru/jekyll-toc#skip-toc-section
Headings are ignored inside the element which has no_toc_section class.

Use case: Skip the headings for certain sections e.g. html code examples or callouts
🔗 https://github.com/twbs/bootstrap/pull/27417/files

@allejo
Copy link
Owner Author

allejo commented Oct 22, 2018

Do you think something similar to this would also possible?

toshimaru/jekyll-toc#skip-toc-section
Headings are ignored inside the element which has no_toc_section class.

Not in a simple and sane manner; see the discussion in #3. I'd prefer to keep this project as simple and lightweight as possible. But if you can come up with a robust solution, I'm open to exploring it.

allejo added a commit that referenced this issue Apr 11, 2019
allejo added a commit that referenced this issue Apr 11, 2019
@allejo allejo removed the pinned label Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants