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

Support for per-toc settings #46

Open
dnaka91 opened this issue Aug 7, 2023 · 0 comments
Open

Support for per-toc settings #46

dnaka91 opened this issue Aug 7, 2023 · 0 comments

Comments

@dnaka91
Copy link
Contributor

dnaka91 commented Aug 7, 2023

Currently, I have some pages where I want to have a lower max level for the ToC content than on the other pages.

For that, it would be great to have some way of applying the max-level (and potent future settings) on a per-toc basis, that can override the global setting.

My idea is to use a comment like the following <!-- toc:max-level = 2 -->.

This could be parse fairly easy, as long as the setting value is limited to a single-line statement.

I saw in the readme that the basic toc marker can be replaced with a multi-line element. That would be very tricky to handle as we have to match the cmark-pulldown events, as well as matching substrings in case they don't fully match.

Maybe it's okay to start with a restriction to single-line elements first, and if anyone needs a multi-line version it could be added later?

@dnaka91 dnaka91 changed the title Support for _per-toc_ settings Support for per-toc settings Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant