-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Suppport auto generating toc content for the [TOC] tag #3173
Conversation
@hikerpig thanks for the cool PR, can you add a setting to disable this feature? Some people may not need auto generated toc |
@ZeroX-DG I don't see your worry here, maybe I misunderstand it. Let's assume if someone typed this Say if there is a config and it is turned off, what is the expected behavior for the placholder? |
@hikerpig You can totally ignore my comment, I didn't see the |
Code review could be exhausting sometimes 😆 , thank you for your work. Let me know if there is anything else that needs to be updated. |
looks nice. However we should remove current implementation of TOC feature before add this new one. |
@amedora can you share your thought on this? Why can't they both exist? |
@hikerpig it seem that your markdownItTocAndAnchor lib doesn't support heading with uppercase letter. Can you fix it please? |
@ZeroX-DG ,Technically both can exist together. |
@amedora I think we should also keep the old TOC too, because user will have more control/customization of the TOC with the old feature. |
@ZeroX-DG, I see. Thank you for your clarification 👍 |
@hikerpig ping! |
@Flexo013 What needs to be changed? Should I add anything ? |
There was this comment by Zero:
|
@ZeroX-DG I can't reproduce the bug what you described with Can you be more specific? Give me some example content so I can improve against. 😃 |
@hikerpig Here is a small example: |
@ZeroX-DG Oh I see, I will fix this in 48h. |
…o avoid default anchor lowercase casting
@ZeroX-DG I've updated the package to fix this annoying lowercase-casting thing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
@hikerpig I want to merge this very soon. Could you fix the conflicts? |
@hikerpig Could you fix CI error too? I think updating snapshot should be enough! Check https://travis-ci.org/BoostIO/Boostnote/builds/596037299#L394 |
Error fixed. BTW, I suggest that the npm 'test' script should contain jest tests. |
@hikerpig Thanks! ❤️ |
Description
This PR add a markdown-it plugin to support auto generating content for
[TOC]
or[toc]
tag.This feature was implemented in many Markdown editors, (Typora, Haroopad, MWeb, etc.).
Although there is already a command 'Generate/Update Markdown TOC' in Boostnote, but I think these two serve for different purposes, so they can both exist.
The demo goes:
Issue fixed
Type of changes
Checklist:
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
IssueHunt has been backed by the following sponsors. Become a sponsor