Skip to content

Update style guide: body H1 + wiki-URL internal links#812

Open
bharvey88 wants to merge 1 commit into
devfrom
style-guide-h1-and-internal-links
Open

Update style guide: body H1 + wiki-URL internal links#812
bharvey88 wants to merge 1 commit into
devfrom
style-guide-h1-and-internal-links

Conversation

@bharvey88
Copy link
Copy Markdown
Contributor

@bharvey88 bharvey88 commented May 15, 2026

What does this implement/fix?

Two style-guide adjustments that bring the written rules in line with how pages are actually authored in this repo.

Headings (§6.2, §6.3). The guide previously said the H1 came from the front matter title: and the body started at H2. In practice, every page has its H1 at the top of the body, which is what mkdocs-material renders as the page heading. The front matter title: mirrors it and feeds the nav, browser tab, and search snippets.

Internal links (§7.5). The guide previously prescribed .md paths. Pages on the wiki use the wiki-URL form (trailing slash, no extension), and that's what we want to keep. Updated the example accordingly and dropped the "let mkdocs catch broken targets at build time" line since it no longer applies to this link form.

No published pages are modified; this is a contributor-facing rules update only. Once merged, a follow-up PR will align casita-module.md, motion-module.md, and temperature-humidity-module.md to match button-module.md's style.

Types of changes

  • Typo / wording fix
  • Content update (correcting outdated info, adding missing steps, clarifications)
  • New page or new product section
  • Page move / rename (redirect added in mkdocs.yml)
  • Image / screenshot update
  • Nav / structure change
  • Site config or theme change
  • CI / workflows / dependencies — Does not publish

Checklist:

  • This PR targets the dev branch (not main)
  • Changes previewed locally with mkdocs serve
  • If pages were moved or renamed, redirects were added to mkdocs.yml
  • If new pages were added, nav was updated in mkdocs.yml

Summary by CodeRabbit

  • Documentation
    • Updated H1 heading conventions to appear as the first body line while mirroring the front matter title field
    • Revised internal link formatting requirements to use wiki-URL format with trailing slashes and exclude .md extensions
    • Clarified that external links should remain as absolute URLs

Review Change Stack

Two adjustments based on how pages are actually authored:

- Headings: the H1 lives at the top of the body (rendered by
  mkdocs-material as the page heading), with the front matter title
  mirroring it for nav, browser tab, and search snippets. Previously
  the guide said body content started at H2 and the H1 came from front
  matter.
- Internal links: use wiki-URL form (trailing slash, no .md) instead
  of .md paths. Removes the build-time validation claim since that no
  longer applies.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Walkthrough

This PR updates documentation style guide conventions in a single file. H1 heading placement is clarified to require the first body line mirrored in front matter title, and internal link formatting is changed to wiki-URL site-relative paths with trailing slash and no .md extension for internal links, while external links remain absolute URLs.

Changes

Heading and Link Conventions

Layer / File(s) Summary
H1 heading conventions
STYLE_GUIDE.md
H1 placement updated to require it as the first body line that mirrors the front matter title field, with exactly one H1 per page, replacing prior guidance where H1 derived from front matter and body started at H2.
Internal link formatting
STYLE_GUIDE.md
Internal link style rule rewritten to mandate wiki-URL form site-relative paths with trailing slash and no .md extension, contrasting with absolute URLs for external sites.

🎯 2 (Simple) | ⏱️ ~10 minutes

A doc's first line takes flight, 🐰
Mirrored in YAML, holding tight,
Links now wiki-shaped without the .md,
These conventions make docs look so fed!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes both main changes: updating H1 heading conventions and internal link formatting requirements in the style guide.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch style-guide-h1-and-internal-links

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
STYLE_GUIDE.md (1)

241-241: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Inconsistency with the new H1 guidance.

Line 241 states that title "shows in the browser tab, the nav, and the H1," which implies the H1 is derived from the front matter. This contradicts the new guidance introduced in lines 162-165 and 182-183, where the H1 is explicitly written as the first line of the body and the front matter title: mirrors it.

📝 Proposed fix to align with new H1 conventions
-- `title` shows in the browser tab, the nav, and the H1.
+- `title` shows in the browser tab and nav, and should mirror the H1 written as the first line of the body.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@STYLE_GUIDE.md` at line 241, The sentence claiming that the front-matter
`title` "shows in the browser tab, the nav, and the H1" conflicts with the newer
guidance that the H1 is explicitly written as the first line of the body and
`title:` should mirror it; update the wording to state that the front-matter
`title` controls the browser tab and nav, while the H1 must be the first line of
the document body and should match the `title:` value (i.e., remove the claim
that `title` directly produces the H1 and add a brief note that authors must
keep them in sync).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@STYLE_GUIDE.md`:
- Line 241: The sentence claiming that the front-matter `title` "shows in the
browser tab, the nav, and the H1" conflicts with the newer guidance that the H1
is explicitly written as the first line of the body and `title:` should mirror
it; update the wording to state that the front-matter `title` controls the
browser tab and nav, while the H1 must be the first line of the document body
and should match the `title:` value (i.e., remove the claim that `title`
directly produces the H1 and add a brief note that authors must keep them in
sync).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 295a524d-ae9e-42ba-a79e-812864cbb310

📥 Commits

Reviewing files that changed from the base of the PR and between e66e805 and 301e062.

📒 Files selected for processing (1)
  • STYLE_GUIDE.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant