-
Notifications
You must be signed in to change notification settings - Fork 16
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
Possibility to put the TOC in a specific element #2
Comments
Currently the code specifically searches for the rehype-toc/src/find-main-node.ts Lines 5 to 22 in b0298c3
|
Hi, check #3 if you want this feature. |
If this plugin can be separated into |
I think this plays into the same vein of a feature request I was about to open for discussion. In my use case, I didn't actually want the TOC automatically inserted into my HTML because the from-markdown HTML was actually just a single part of a larger template. So, rather than creating too much customization into where the TOC is placed in the overall HTML document, perhaps the most flexible solution would be a secondary option to export JUST the TOC HTML and insert it wherever may be appropriate inside of the template? |
@jodylecompte do not know if it could fit your needs but I have already made a PR #3 as advertised in a previous comment of this issue. You can test it right now as described here: #3 (comment) Please read the full PR thread for more info, especially about the fallback behaviour that do not insert TOC at all (#3 (comment)). HTH |
I would like to see it merged as well :) |
Same here! |
Is there a way to specify a selector within which I can put the TOC?
I have a use-case where I want to make the TOC
position: sticky
. But because the sticky elements still remain in the flow of the document I have a weird spacing.This could be a good use-case where I'd like to place the TOC in a pre-determined position in the document.
Happy to elaborate more if needed.
The text was updated successfully, but these errors were encountered: