Workflow file: check-toc-task.yml
Check whether the generated table of contents in Markdown files matches their heading structure.
This should be used in repositories that generate the table of contents with markdown-toc.
This is the version of the workflow for projects using the Task task runner tool.
- [
Taskfile.yml
](assets/check-toc-task/Taskfile.yml] - Formatting task.- Install to: repository root (or add the
markdown:toc
task into the existingTaskfile.yml
)
- Install to: repository root (or add the
Markdown badge:
[](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/check-toc-task.yml)
Replace the REPO_OWNER
and REPO_NAME
placeholders in the URLs with the final repository owner and name (example).
Asciidoc badge:
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-toc-task.yml/badge.svg["Check ToC status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-toc-task.yml"]
Define the {repository-owner}
and {repository-name}
attributes and use them throughout the readme (example).
Add CI workflow to check for missed updates to readme ToC
On every push or pull request that affects the repository's README.md, check whether the table of contents matches the
content.
On every push or pull request that affects the repository's README.md, use [markdown-toc](https://github.com/jonschlinkert/markdown-toc) to check whether the table of contents matches the content.