-
Notifications
You must be signed in to change notification settings - Fork 11
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
Table of contents cannot track headers with Raw Block #161
Comments
How would you like to implement it? Would you parse to fix this issue only or do you have some other issues or cases to parse on? Maybe I could help you but it depends on the effort |
Ideally, I would like to avoid adding external libraries altogether. That said, I've recently dabbled with templates in the library, and I think it would be possible to implement a 3rd-party template with external dependencies. In other words, someone could make their own library that could be imported separately as an extension of SnakeMD. I've written a little about how that would work here. Alternatively, we could write a parser in SnakeMD to parse markdown into Elements. The original idea for that was to be able to parse raw blocks, so we could import existing markdown files (e.g., headers, footers, etc.). I think it would have a lot of use cases regardless. A wild third option would be to create an alternative implementation of the Table of Contents objects, which just scans the rendered document for headings on each line ( |
In my specific case, to solve the problem, I'm going to develop a custom renderer from mistletoe library that I'm already using in the project. The idea is to inject the SnakeMd document in the custom renderer. I think the raw block in snake md is good as is because for example you can use it to avoid some headers from the table of contents (the opposite of my problem). I don't know if you could be interested in someway about this custom renderer. Maybe it can be considered as a plugin or something similar. In that case let me know. |
I'd be interested just to see what you're doing! I'm not sure how much collaboration we can do. |
As expected table of contents is rendered only before printing the document.
When rendering it is populated searching fow Heders block in document.
The problem is that using Raw block some headers can be set inside.
In my opinion the headers content should be track anyway even if inside the raw content.
The problem is that the content in Raw block should be parsed somehow.
The text was updated successfully, but these errors were encountered: