-
-
Notifications
You must be signed in to change notification settings - Fork 481
feat: add option to keep files with no toc inside untouched #181
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
Conversation
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.
I'd add some additional printout, clarifying that only existing TOC'ed files will be updated. Maybe here.
Also, I'd suggest a name like --update-existing
or --update-only
as that may carry more meaning than "preserve".
Thoughts?
add cli flag to prevent doctoc from adding toc to a file without toc. this is good for CI or a combination with lint-staged. with -p, doctoc will update toc if md has toc sectioon, otherwise doctoc keep it unmodified.
@AndrewSouthpaw Thank you for the suggestion. |
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.
Looks great! Just one minor word tweak.
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.
Thanks for your contribution!
add cli flag to prevent doctoc from adding toc to a file without toc.
this is good for CI or the combination with
lint-staged
.with -p, doctoc will update toc if md has toc sectioon, otherwise doctoc keep it unmodified.
I'm not sure
preserve
is the right name for it. so please change it if you have a better one.