Skip to content
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

Request: Support checking if TOCs are up to date #131

Closed
adamtheturtle opened this issue Jun 12, 2017 · 3 comments
Closed

Request: Support checking if TOCs are up to date #131

adamtheturtle opened this issue Jun 12, 2017 · 3 comments

Comments

@adamtheturtle
Copy link

I would like to use the tool on CI to confirm that my TOCs are up to date.
One way I can think of to do this is to have a different exit code if the TOCs are not up to date.
Another is to include a --dry-run option and look for output.

@thlorenz
Copy link
Owner

thlorenz commented Jun 12, 2017

I like the idea.
It could work the following way:

  • generate a toc for the current file (save it in a string)
  • pull out the existing toc from the current file and save in another string
  • then compare both strings via a diff module and show the updates needed

PRs with tests welcome :)

@kamadorueda
Copy link

@adamtheturtle @thlorenz

If you want to run doctoc in the CI, ensuring tocs are up-to-date or fail the job if not, I highly suggest you this:

https://github.com/fluidattacks/makes#formatmarkdown

This is how a CI failure looks like:

fluidattacks/makes#190 (comment)

It can also be executed locally, which is nice

@AndrewSouthpaw
Copy link
Collaborator

Closing in favor of #188, keep the conversation going there. 😄

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

No branches or pull requests

4 participants