Skip to content

doc: demote repeated H1 headers#36833

Open
harahu wants to merge 2 commits intoleanprover-community:masterfrom
harahu:doc/headers-demotion-032026
Open

doc: demote repeated H1 headers#36833
harahu wants to merge 2 commits intoleanprover-community:masterfrom
harahu:doc/headers-demotion-032026

Conversation

@harahu
Copy link
Copy Markdown
Contributor

@harahu harahu commented Mar 18, 2026

Having more than one H1 header per file confuses search engines and thus makes documentation more difficult to find. Hence, we make sure that lean files only have a single H1 header in them.

In the case of Mathlib/Tactic/Common.lean, we achieve this by adding a new module header.


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 18, 2026

PR summary 35bf175a46

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

Copy link
Copy Markdown
Collaborator

@vihdzp vihdzp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all seems reasonable to me, as it matches what we do on most files. Perhaps we should document this somewhere? "Use H1 at the very beginning of the module docstring, use H2 afterwards within the module docstring, use H3-H6 elsewhere"

@harahu
Copy link
Copy Markdown
Contributor Author

harahu commented Mar 20, 2026

The style guide already more-or-less enforces this pattern:

The mandatory title of the file is a first level header. It is followed by a summary of the content of the file.

The other sections, with second level headers are (in this order):

  • ...

and

Third-level headers ### should be used for titles inside sectioning comments.

It isn't really clear on why this pattern is desirable, though, which one might want to do something about.

@Multramate Multramate added the documentation Improvements or additions to documentation label Apr 2, 2026
@harahu harahu force-pushed the doc/headers-demotion-032026 branch from a1c10b8 to be6ec2a Compare April 4, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants