Skip to content

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

Merged
merged 5 commits into from
Oct 22, 2020

Conversation

uetchy
Copy link
Contributor

@uetchy uetchy commented Jul 3, 2020

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.

@uetchy uetchy changed the title feat: option to keep files no toc inside untouched feat: add option to keep files with no toc inside untouched Jul 4, 2020
Copy link
Collaborator

@AndrewSouthpaw AndrewSouthpaw left a 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.
@uetchy
Copy link
Contributor Author

uetchy commented Oct 14, 2020

@AndrewSouthpaw Thank you for the suggestion. --update-only sounds nice.
Also, I've added the notice and help text for this option.

@uetchy uetchy requested a review from AndrewSouthpaw October 14, 2020 09:27
Copy link
Collaborator

@AndrewSouthpaw AndrewSouthpaw left a 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.

@uetchy uetchy requested a review from AndrewSouthpaw October 15, 2020 11:30
Copy link
Collaborator

@AndrewSouthpaw AndrewSouthpaw left a 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!

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

Successfully merging this pull request may close these issues.

2 participants