Skip to content

Commit 02291d9

Browse files
committed
Add doctoc prek hook for long MD files
1 parent 686ab34 commit 02291d9

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,15 @@ repos:
163163
- id: mixed-line-ending
164164
- id: trailing-whitespace
165165
args: [--markdown-linebreak-ext=md]
166+
- repo: https://github.com/thlorenz/doctoc.git
167+
rev: 68f070c98b9a053eabfa7f8899d1f42b9919f98c # frozen: v2.2.0
168+
hooks:
169+
- id: doctoc
170+
name: Add TOC for Markdown and RST files
171+
files: |
172+
(?x)
173+
^sphinx_airflow_theme/README\.md$|
174+
^CONTRIBUTE\.md$
175+
args:
176+
- "--maxlevel"
177+
- "2"

CONTRIBUTE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3+
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
4+
5+
- [Contributor Guide](#contributor-guide)
6+
- [Working with the project](#working-with-the-project)
7+
- [How to release new documentation](#how-to-release-new-documentation)
8+
- [Publish site on Apache server (CI/CD)](#publish-site-on-apache-server-cicd)
9+
- [Publish site on Apache server (manual way)](#publish-site-on-apache-server-manual-way)
10+
- [Prerequisite tasks](#prerequisite-tasks)
11+
- [Instruction](#instruction)
12+
- [Release and publish documentation in one go](#release-and-publish-documentation-in-one-go)
13+
- [Additional tips:](#additional-tips)
14+
- [Using VM on GCP](#using-vm-on-gcp)
15+
- [Use RAM disk for build](#use-ram-disk-for-build)
16+
17+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
18+
119
<!--
220
Licensed to the Apache Software Foundation (ASF) under one
321
or more contributor license agreements. See the NOTICE file

sphinx_airflow_theme/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3+
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
4+
5+
- [Sphinx theme for Airflow](#sphinx-theme-for-airflow)
6+
- [Install from sources](#install-from-sources)
7+
- [Generate Airflow documentation with Sphinx theme changes](#generate-airflow-documentation-with-sphinx-theme-changes)
8+
- [Install developer version](#install-developer-version)
9+
- [Configuration](#configuration)
10+
- [`navbar_links`](#navbar_links)
11+
- [`hide_website_buttons`](#hide_website_buttons)
12+
- [`sidebar_collapse`](#sidebar_collapse)
13+
- [`sidebar_includehidden`](#sidebar_includehidden)
14+
- [Theme's source files](#themes-source-files)
15+
16+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
17+
118
<!--
219
Licensed to the Apache Software Foundation (ASF) under one
320
or more contributor license agreements. See the NOTICE file

0 commit comments

Comments
 (0)