Skip to content

Commit ee56fe2

Browse files
authored
fix(docs): remove duplicate page titles after mystmd conversion (#805)
* fix(docs): remove duplicate page titles after mystmd conversion The mystmd migration (#792) gave every page a frontmatter `title:` and demoted the original `#` page heading to `##`. The book-theme renders the frontmatter title as a title-block H1, so each page showed its title twice and the landing page rendered a bare "Home" heading above the content. Drop the redundant frontmatter `title` and promote body headings back one level so MyST extracts the single `#` H1 as the page title. `short_title` still drives the nav on the GHA/style pages; the index keeps a `short_title: Home` nav label. The two packaging guides had a tip/cog block before the heading (which blocks title extraction), so their `#` heading moves to the top. Resolves the "extra Home header" and "duplicated headers" review notes from #801 Assisted-by: ClaudeCode:claude-opus-4.8 * fix(docs): demote headings in pyproject partial to nest under sections `_partials/pyproject.md` opened with an H1 that got inlined mid-page in the two packaging guides, which include it at the `##`-section level. Demote each heading one level so it nests correctly, and add a `rumdl-disable MD041` since the file now starts with an H2 (same pattern as footer.md). Assisted-by: ClaudeCode:claude-opus-4.8
1 parent 046ead5 commit ee56fe2

30 files changed

Lines changed: 230 additions & 328 deletions

docs/_partials/pyproject.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# pyproject.toml: project table
1+
<!-- rumdl-disable MD041 -->
2+
3+
## pyproject.toml: project table
24

35
<!-- [[[cog
46
from cog_helpers import code_fence, render_cookie, TOMLMatcher
@@ -64,7 +66,7 @@ special, and replaces the old url setting.
6466
If you use the above configuration, you need `README.md` and `LICENSE` files,
6567
since they are explicitly specified.
6668

67-
## License
69+
### License
6870

6971
The license can be done one of two ways.
7072

@@ -91,7 +93,7 @@ classifiers = [
9193
You should not include the `License ::` classifiers if you use the `license`
9294
field {rr}`PP007`.
9395

94-
### Extras
96+
#### Extras
9597

9698
Sometimes you want to ship a package with optional dependencies. For example,
9799
you might have extra requirements that are only needed for running a CLI, or for
@@ -113,7 +115,7 @@ mpl = [
113115
Self dependencies can be used by using the name of the package, such as
114116
`all = ["package[cli,mpl]"]`, (requires Pip 21.2+).
115117

116-
### Command line
118+
#### Command line
117119

118120
If you want to ship an "app" that a user can run from the command line, you need
119121
to add a `script` entry point. The form is:
@@ -128,7 +130,7 @@ function, followed by a colon, then the function to call. If you use
128130
`__main__.py` as the file, then `python -m` followed by the module will also
129131
work to call the app (`__name__` will be `"__main__"` in that case).
130132

131-
### Development dependencies
133+
#### Development dependencies
132134

133135
The proper way to specify dependencies exclusively used for development tasks
134136
(such as `pytest`, `ruff`, packages for generating documentation, etc.) is to

docs/pages/guides/coverage.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
---
2-
title: "Code coverage"
3-
---
4-
5-
## Code Coverage
1+
# Code Coverage
62

73
The "Code coverage" value of a codebase indicates how much of the
84
production/development code is covered by the running unit tests. Maintainers
@@ -32,7 +28,7 @@ adding weak tests just for coverage's sake is not a good idea. The tests
3228
should test your codebase thoroughly and should not be unreliable.
3329
:::
3430

35-
### Running your tests with coverage
31+
## Running your tests with coverage
3632

3733
There are two common ways to calculate coverage: using `coverage` or using
3834
`pytest-cov`. While `pytest-cov` is simpler on the command line, and it promises
@@ -92,7 +88,7 @@ shown below.
9288
:::
9389
::::
9490

95-
#### Configuring coverage
91+
### Configuring coverage
9692

9793
There is a configuration section in `pyproject.toml` for coverage. Here are some
9894
common options
@@ -126,7 +122,7 @@ There are also useful reporting options. `report.exclude_lines = [...]` allows
126122
you to exclude lines from coverage. `report.fail_under` can trigger a failure if
127123
coverage is below a percent (like 100).
128124

129-
#### Calculating code coverage in your workflows
125+
### Calculating code coverage in your workflows
130126

131127
Your workflows should produce a `.coverage` file as outlined above. This file
132128
can be uploaded to `Codecov` using the [codecov/codecov-action][] action.
@@ -135,7 +131,7 @@ If you would rather do it yourself, you should collect coverage files from all
135131
your jobs and combine them into one `.coverage` file before running
136132
`coverage report`, so that you get a combined score.
137133

138-
##### Manually combining coverage
134+
#### Manually combining coverage
139135

140136
If you are running in parallel, such as with `pytest-xdist`, you can set
141137
`run.parallel` to `true`, which will add a unique suffix to the coverage file(s)
@@ -199,7 +195,7 @@ def tests(session: nox.Session) -> None:
199195
:::
200196
::::
201197

202-
##### Merging and reporting
198+
#### Merging and reporting
203199

204200
If you are running in multiple jobs, you should use upload/download artifacts so
205201
they are all available in a single combine job at the end. Each one should have
@@ -219,7 +215,7 @@ def coverage(session: nox.Session) -> None:
219215
session.run("coverage", "erase")
220216
```
221217

222-
##### Configuring Codecov and uploading coverage reports
218+
#### Configuring Codecov and uploading coverage reports
223219

224220
Interestingly, `Codecov` does not require any initial configurations for your
225221
project, given that you have already signed up for the same using your GitHub
@@ -243,7 +239,7 @@ The lines above should be added after the step that runs your tests with the
243239
for all the optional options. You'll need to specify a `CODECOV_TOKEN` secret,
244240
as well.
245241

246-
##### Using codecov.yml
242+
#### Using codecov.yml
247243

248244
One can also configure `Codecov` and coverage reports passed to `Codecov` using
249245
`codecov.yml`. `codecov.yml` should be placed inside the `.github` folder, along

docs/pages/guides/docs.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
---
2-
title: Writing documentation
3-
---
4-
5-
## Writing documentation
1+
# Writing documentation
62

73
Documentation used to require learning reStructuredText (sometimes referred to
84
as reST / rST), but today we have great choices for documentation in markdown,
@@ -45,7 +41,7 @@ is uncertain, and mkdocs-material will be minimally maintained until
4541
late 2026.
4642
:::
4743

48-
### What to include
44+
## What to include
4945

5046
Ideally, software documentation should include:
5147

@@ -76,7 +72,7 @@ with render_cookie(backend="hatch", docs="mkdocs") as package:
7672
]]] -->
7773
<!-- [[[end]]] -->
7874

79-
### Hand-written docs
75+
## Hand-written docs
8076

8177
Create `docs/` directory within your project (next to `src/`). From here, Sphinx
8278
and MkDocs diverge.
@@ -85,7 +81,7 @@ and MkDocs diverge.
8581
:::{tab-item} Sphinx
8682
:sync: sphinx
8783

88-
#### pyproject.toml additions
84+
### pyproject.toml additions
8985

9086
Setting a `docs` dependency group looks like this:
9187

@@ -107,7 +103,7 @@ There is a sphinx-quickstart tool, but it creates unnecessary files (make/bat,
107103
we recommend a cross-platform noxfile instead), and uses rST instead of
108104
Markdown. Instead, this is our recommended starting point for `conf.py`:
109105

110-
#### conf.py
106+
### conf.py
111107

112108
<!-- [[[cog
113109
with code_fence("python"):
@@ -227,7 +223,7 @@ docstrings, even if the parameter isn't documented yet. Feel free to check
227223
[sphinx-autodoc-typehints](https://github.com/tox-dev/sphinx-autodoc-typehints)
228224
for more options.
229225

230-
#### index.md
226+
### index.md
231227

232228
Your `index.md` file can start out like this:
233229

@@ -471,7 +467,7 @@ nav:
471467
:::
472468
::::
473469

474-
#### .readthedocs.yaml
470+
### .readthedocs.yaml
475471

476472
In order to use <https://readthedocs.org> to build, host, and preview your
477473
documentation, you must have a `.readthedocs.yaml` file {rr}`RTD100` like
@@ -548,7 +544,7 @@ Python {rr}`RTD103`, several languages are supported here).
548544
Finally, we have a `commands` table which describes how to install our
549545
dependencies and build the documentation into the ReadTheDocs output directory.
550546

551-
#### noxfile.py additions
547+
### noxfile.py additions
552548

553549
Add a session to your `noxfile.py` to generate docs:
554550

@@ -642,7 +638,7 @@ documentation on how to configure what directories are watched for changes,
642638
:::
643639
::::
644640

645-
### API docs
641+
## API docs
646642

647643
::::{tab-set}
648644
:::{tab-item} Sphinx
@@ -651,7 +647,7 @@ To build API docs, you need to add the following Nox job. It will rerun
651647
`sphinx-apidoc` to generate the sphinx autodoc pages for each of your public
652648
modules.
653649

654-
#### noxfile.py additions
650+
### noxfile.py additions
655651

656652
<!-- [[[cog
657653
with code_fence("python"):
@@ -721,7 +717,7 @@ module by being more specific, like `::: my_package.my_module.MyClass`.
721717
:::
722718
::::
723719

724-
### Notebooks in docs
720+
## Notebooks in docs
725721

726722
::::{tab-set}
727723
:::{tab-item} Sphinx

docs/pages/guides/gha_basic.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
2-
title: "GHA: GitHub Actions intro"
32
short_title: GitHub Actions introduction
43
---
54

6-
## GitHub Actions: Intro
5+
# GitHub Actions: Intro
76

87
{rr}`GH100` The recommended CI for scientific Python projects is GitHub
98
Actions (GHA), although its predecessor Azure is also in heavy usage, and other
@@ -25,7 +24,7 @@ with render_cookie() as package:
2524
]]] -->
2625
<!-- [[[end]]] -->
2726

28-
### Header
27+
## Header
2928

3029
Your main CI workflow file should begin something like this:
3130

@@ -47,7 +46,7 @@ you use a develop branch, you probably will want to include that. You can also
4746
specify specific branches for pull requests instead of running on all PRs (will
4847
run on PRs targeting those branches only).
4948

50-
### Prek / Pre-commit
49+
## Prek / Pre-commit
5150

5251
If you use [prek][] or [pre-commit][] in CI, you can run it directly in GitHub
5352
Actions. Prek is a faster Rust rewrite of pre-commit that supports most real
@@ -91,7 +90,7 @@ run a manual check, like check-manifest, then you can keep it but just use
9190
this one check. You can also use `needs: lint` in your other jobs to keep them
9291
from running if the lint check does not pass.
9392

94-
### Unit tests
93+
## Unit tests
9594

9695
Implementing unit tests is also easy. Since you should be following best
9796
practices listed in the previous sections, this becomes an almost directly
@@ -158,7 +157,7 @@ Note that while versioned images are available, like `ubuntu-24.04`, these are
158157
all rolling images; selecting a specific image will not make your CI completely
159158
static. And old versioned images are decommissioned.
160159

161-
### Updating
160+
## Updating
162161

163162
{rr}`GH200` {rr}`GH210` If you use non-default actions in your repository
164163
(you will see some in the following pages), then it's a good idea to keep them
@@ -190,9 +189,9 @@ which is both cleaner and sometimes required for dependent actions, like
190189

191190
You can use this for other ecosystems too, including Python.
192191

193-
### Common needs
192+
## Common needs
194193

195-
#### Single OS steps
194+
### Single OS steps
196195

197196
If you need to have a step run only on a specific OS, use an if on that step
198197
with `runner.os`:
@@ -204,7 +203,7 @@ if: runner.os != 'Windows' # also 'macOS' and 'Linux'
204203
Using `runner.os` is better than `matrix.<something>`. You also have an
205204
environment variable `$RUNNER_OS` as well. Single quotes are required here.
206205

207-
#### Changing the environment in a step
206+
### Changing the environment in a step
208207

209208
If you need to change environment variables for later steps, such combining with
210209
an if condition for only for one OS, then you add it to a special file:
@@ -215,7 +214,7 @@ an if condition for only for one OS, then you add it to a special file:
215214

216215
Later steps will see this environment variable.
217216

218-
#### Communicating between steps
217+
### Communicating between steps
219218

220219
You can also directly communicate between steps, by setting `id:`'s. Some
221220
actions have outputs, and bash actions can manually write to output:
@@ -230,7 +229,7 @@ You can now refer to this step in a later step with
230229
using `${{ needs.<jobname>.outputs.something }}`. The `toJson()` function is
231230
useful for inputting JSON - you can even generate matrices dynamically this way!
232231

233-
#### Pretty output
232+
### Pretty output
234233

235234
You can write GitHub flavored markdown to `$GITHUB_STEP_SUMMARY`, and it will be
236235
shown on the summary page.
@@ -247,7 +246,7 @@ You can also do this
247246
which tell GitHub to look for certain patterns. Do keep in mind you can only see
248247
up to 10 matches per type per step, and a total of 50 matchers.
249248

250-
#### Common useful actions
249+
### Common useful actions
251250

252251
There are a variety of useful actions. There are GitHub supplied ones:
253252

@@ -325,11 +324,11 @@ You can also run GitHub Actions locally:
325324
- [act](https://github.com/nektos/act): Run GitHub Actions in a docker image
326325
locally.
327326

328-
### Advanced usage
327+
## Advanced usage
329328

330329
These are some things you might need.
331330

332-
#### Cancel existing runs
331+
### Cancel existing runs
333332

334333
{rr}`GH102` If you add the following, you can ensure only one run per
335334
PR/branch happens at a time, cancelling the old run when a new one starts:
@@ -345,7 +344,7 @@ the "from" name for the PR. If you want, you can replace `github.ref` with
345344
`github.event.pull_request.number || github.sha`; this will still cancel on PR
346345
pushes but will build each commit on `main`.
347346

348-
#### Pass job
347+
### Pass job
349348

350349
If you want support GitHub's "merge when pass" feature, you should set up a pass
351350
job instead of listing every job you wand to require. Besides making it much
@@ -382,7 +381,7 @@ allowed to be skipped (`allowed-skips:`) too.
382381
Just set this `pass` job in your required checks for your main branch. Then
383382
you'll be able to use GitHub's auto merge functionality.
384383

385-
#### Custom actions
384+
### Custom actions
386385

387386
You can
388387
[write your own actions](https://docs.github.com/en/actions/creating-actions)
@@ -453,7 +452,7 @@ Examples of custom composite actions include:
453452
(This repo)
454453
:::
455454

456-
#### Reusable workflows
455+
### Reusable workflows
457456

458457
You can also make reusable workflows. One reason to do this is it allows you to
459458
use `needs` or communicate values between workflows. It's an easy way to make
@@ -470,7 +469,7 @@ If you add a `outputs:` table to the workflow call table, you can specify
470469
outputs for other workflows to read. See other options
471470
[in the docs](https://docs.github.com/en/actions/using-workflows/reusing-workflows).
472471

473-
#### Conditional workflows
472+
### Conditional workflows
474473

475474
Sometimes you have jobs that depend on certain files in our repository. Maybe
476475
you only want to run tests if code or tests files are changed, docs if
@@ -620,7 +619,7 @@ Some examples of repos using this method are:
620619
(this repo)
621620
:::
622621

623-
#### GitHub pages
622+
### GitHub pages
624623

625624
GitHub has finished moving their pages build infrastructure to Actions, and they
626625
[now provide](https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/)
@@ -702,7 +701,7 @@ for examples. Some other examples include:
702701
- [iris-hep.org](https://github.com/iris-hep/iris-hep.github.io/blob/master/.github/workflows/deploy.yml)
703702
:::
704703

705-
#### Changelog generation
704+
### Changelog generation
706705

707706
Not directly part of Actions, but also in `.github` is `.github/release.yml`,
708707
which lets you [configure the changelog generation][gh-changelog] button when

0 commit comments

Comments
 (0)