Skip to content

Move check-headings docs to CONTRIBUTING.md #616

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

Merged
merged 2 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Table of contents:
- [Figures \& diagrams](#figures--diagrams)
- [Content style and formatting](#content-style-and-formatting)
- [Formatting / linting](#formatting--linting)
- [Headings CI tests](#headings-ci-tests)
- [Admonitions](#admonitions)
- [Known limitations](#known-limitations)
- [Code annotations](#code-annotations)
Expand Down Expand Up @@ -136,6 +137,33 @@ Doing that produces cleaner diffs for future code reviews.
The sentences will still be rendered as a continuous paragraph.
For an example, have a look at the code for this paragraph.

### Headings CI tests

This repository includes a Python tool to validate markdown heading numbering consistency across training materials.

The `check_headings.py` script ensures:

- Sequential numbering at each level (1., 1.1., 1.2., etc.)
- Trailing periods after heading numbers
- Heading levels match numbering depth (## for 1., ### for 1.1.)

The easiest way to run it is [with `uv`](https://docs.astral.sh/uv/), which handles dependencies for you automatically:

```bash
# Check files for issues
uv run .github/check_headings.py docs/**/*.md
```

```bash
# Auto-fix detected issues
uv run .github/check_headings.py --fix docs/**/*.md
```

Otherwise, run `pip install typer rich` then `python .github/check_headings.py`.

The script runs automatically in CI on markdown file changes via GitHub Actions,
and will cause a CI failure if any incorrect headings are found.

### Admonitions

We use admonitions extensively to make certain pieces of content stand out.
Expand Down
30 changes: 2 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,8 @@ We are excited to have you on the path to writing reproducible and scalable scie

We welcome fixes and improvements from the community. Please fork the repository and create pull-requests with any improvements you'd like to suggest to the docs.

You can find instructions about how to develop the training material code in [`CONTRIBUTING.md`](CONTRIBUTING.md). If you want to contribute with a translation instead, check [`TRANSLATING.md`](TRANSLATING.md).

### Headings CI tests

This repository includes a Python tool to validate markdown heading numbering consistency across training materials.

The `check_headings.py` script ensures:

- Sequential numbering at each level (1., 1.1., 1.2., etc.)
- Trailing periods after heading numbers
- Heading levels match numbering depth (## for 1., ### for 1.1.)

The easiest way to run it is [with `uv`](https://docs.astral.sh/uv/), which handles dependencies for you automatically:

```bash
# Check files for issues
uv run .github/check_headings.py docs/**/*.md
```

```bash
# Auto-fix detected issues
uv run .github/check_headings.py --fix docs/**/*.md
```

Otherwise, run `pip install typer rich` then `python .github/check_headings.py`.

The script runs automatically in CI on markdown file changes via GitHub Actions,
and will cause a CI failure if any incorrect headings are found.
> [!NOTE]
> You can find instructions about how to develop the training material code in [`CONTRIBUTING.md`](CONTRIBUTING.md). If you want to contribute with a translation instead, check [`TRANSLATING.md`](TRANSLATING.md).

## Credits & Copyright

Expand Down