-
Notifications
You must be signed in to change notification settings - Fork 1.2k
pre-commit: auto add table of contents with doctoc
#11679
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
base: main
Are you sure you want to change the base?
Conversation
https://github.com/thlorenz/doctoc?tab=readme-ov-file#usage-as-a-git-hook https://github.com/thlorenz/doctoc/releases/tag/v2.2.0 Generates table of contents for Markdown files inside local git repository. Links are compatible with anchors generated by github or other sites. Added TOC to 3 Markdown files. Never have to create a TOC again just run: `pre-commit run doctoc --all-files` - CONTRIBUTING.md - INSTALL.md - README.md So both Apache Airflow and Apache Sedona use `doctoc`: https://github.com/apache/airflow/blob/eb4a8bc03c92d84e8238dcd76becb267ec8c3dd5/.pre-commit-config.yaml#L32 https://github.com/apache/sedona/blob/b0d86fda010e42f30b090aef1b2dbf06aa0a19d2/.pre-commit-config.yaml#L34
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11679 +/- ##
============================================
- Coverage 17.39% 17.39% -0.01%
+ Complexity 15285 15281 -4
============================================
Files 5889 5889
Lines 526183 526183
Branches 64242 64242
============================================
- Hits 91542 91532 -10
- Misses 424297 424307 +10
Partials 10344 10344
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
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.
Pull Request Overview
This PR adds automatic table of contents (TOC) generation for Markdown files using the doctoc
pre-commit hook. The change aims to keep documentation organized with automatically maintained TOCs that are compatible with GitHub anchor links.
- Added
doctoc
pre-commit hook configured to run on CONTRIBUTING.md, INSTALL.md, and README.md - Generated initial TOCs for the three target Markdown files with proper doctoc comment markers
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
.pre-commit-config.yaml | Added doctoc hook configuration to auto-generate TOCs for specific Markdown files |
README.md | Added auto-generated table of contents with doctoc markers |
INSTALL.md | Added auto-generated table of contents with doctoc markers |
CONTRIBUTING.md | Added auto-generated table of contents with doctoc markers |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
https://github.com/thlorenz/doctoc?tab=readme-ov-file#usage-as-a-git-hook
https://github.com/thlorenz/doctoc/releases/tag/v2.2.0
Generates table of contents for Markdown files inside local git repository.
Links are compatible with anchors generated by github or other sites.
Added TOC to 3 Markdown files.
Never have to create a TOC again just run:
pre-commit run doctoc --all-files
So both Apache Airflow and Apache Sedona use
doctoc
:https://github.com/apache/airflow/blob/eb4a8bc03c92d84e8238dcd76becb267ec8c3dd5/.pre-commit-config.yaml#L32
https://github.com/apache/sedona/blob/b0d86fda010e42f30b090aef1b2dbf06aa0a19d2/.pre-commit-config.yaml#L34
Description
This PR...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?