Skip to content

Commit c4bf0bf

Browse files
committed
pre-commit: auto add table of contents with doctoc
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
1 parent 8eb6ddd commit c4bf0bf

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ repos:
2525
hooks:
2626
- id: identity
2727
- id: check-hooks-apply
28+
- repo: https://github.com/thlorenz/doctoc.git
29+
rev: v2.2.0
30+
hooks:
31+
- id: doctoc
32+
name: Add TOC for Markdown files
33+
files: ^CONTRIBUTING\.md$|^INSTALL\.md$|^README\.md$
2834
- repo: https://github.com/gitleaks/gitleaks
2935
rev: v8.27.2
3036
hooks:

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Contributing to Apache CloudStack (ACS)
22
=======================================
33

4+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
5+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
6+
7+
- [Summary](#summary)
8+
- [Bug fixes](#bug-fixes)
9+
- [Developing new features](#developing-new-features)
10+
- [PendingReleaseNotes file](#pendingreleasenotes-file)
11+
- [Fork the code](#fork-the-code)
12+
- [Making changes](#making-changes)
13+
- [Rebase `feature_x` to include updates from `upstream/main`](#rebase-feature_x-to-include-updates-from-upstreammain)
14+
- [Make a GitHub Pull Request to contribute your changes](#make-a-github-pull-request-to-contribute-your-changes)
15+
- [Cleaning up after a successful pull request](#cleaning-up-after-a-successful-pull-request)
16+
- [Release Principles](#release-principles)
17+
18+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
19+
420
Summary
521
-------
622
This document covers how to contribute to the ACS project. ACS uses GitHub PRs to manage code contributions.

INSTALL.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,21 @@ or the developer [wiki](https://cwiki.apache.org/confluence/display/CLOUDSTACK/H
77
Apache CloudStack developers use various platforms for development, this guide
88
was tested against a CentOS 7 x86_64 setup.
99

10-
* [Setting up development environment](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Setting+up+CloudStack+Development+Environment) for Apache CloudStack.
11-
* [Building](https://cwiki.apache.org/confluence/display/CLOUDSTACK/How+to+build+CloudStack) Apache CloudStack.
12-
* [Appliance based development](https://github.com/rhtyd/monkeybox)
10+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
11+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
12+
13+
- [Setting up Development Environment](#setting-up-development-environment)
14+
- [Using jenv and/or pyenv for Version Management](#using-jenv-andor-pyenv-for-version-management)
15+
- [Getting the Source Code](#getting-the-source-code)
16+
- [Building](#building)
17+
- [To bring up CloudStack UI](#to-bring-up-cloudstack-ui)
18+
- [Building with non-redistributable plugins](#building-with-non-redistributable-plugins)
19+
- [Packaging and Installation](#packaging-and-installation)
20+
- [Debian/Ubuntu](#debianubuntu)
21+
- [RHEL/CentOS](#rhelcentos)
22+
- [Notes](#notes)
23+
24+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1325

1426
## Setting up Development Environment
1527

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,24 @@
1212

1313
[![Apache CloudStack](tools/logo/apache_cloudstack.png)](https://cloudstack.apache.org/)
1414

15+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
16+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
17+
18+
- [Who Uses CloudStack?](#who-uses-cloudstack)
19+
- [Demo](#demo)
20+
- [Getting Started](#getting-started)
21+
- [Getting Source Repository](#getting-source-repository)
22+
- [Documentation](#documentation)
23+
- [News and Events](#news-and-events)
24+
- [Getting Involved and Contributing](#getting-involved-and-contributing)
25+
- [Reporting Security Vulnerabilities](#reporting-security-vulnerabilities)
26+
- [License](#license)
27+
- [Notice of Cryptographic Software](#notice-of-cryptographic-software)
28+
- [Star History](#star-history)
29+
- [Contributors](#contributors)
30+
31+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
32+
1533
Apache CloudStack is open source software designed to deploy and manage large
1634
networks of virtual machines, as a highly available, highly scalable
1735
Infrastructure as a Service (IaaS) cloud computing platform. CloudStack is used

0 commit comments

Comments
 (0)