Skip to content

fix: upgrade heading levels in common dev templates (zh+en)#1707

Merged
Milir-Radxa merged 3 commits intoradxa-docs:mainfrom
tangzz-radxa:support/rock4b-manjaro-memory-heading-20260420
Apr 20, 2026
Merged

fix: upgrade heading levels in common dev templates (zh+en)#1707
Milir-Radxa merged 3 commits intoradxa-docs:mainfrom
tangzz-radxa:support/rock4b-manjaro-memory-heading-20260420

Conversation

@tangzz-radxa
Copy link
Copy Markdown
Contributor

@tangzz-radxa tangzz-radxa commented Apr 20, 2026

Summary

Fix 0.x numbering issue in tutorial pages caused by content headings starting at ### without a parent ##. When a Docusaurus page's first heading is ###, the auto-numbering plugin treats it as section 0, displaying 0.x instead of 1.x.

Changes

Two rounds of fixes:

Round 1: Fix first-heading 0.x issue

Upgraded all affected common dev templates by one heading level.

File Change
_canbus.mdx Plain intro → ##; all #####
_gpio.mdx, _i2c.mdx, _pwm.mdx, _spi.mdx, _w1.mdx #####
_uart.mdx #####; #######
_pico-*.mdx (8 files) All headings upgraded 1 level

Round 2: Fix subsection level jumping (review fix)

  • Fixed ###### jumping in pico template subsections (#######)
  • Aligned English template heading levels to match Chinese

Example Fix

Before (page zero/zero3/app-development/canbus):

  • First content heading was ### 准备 (no parent ##), displayed as 0.1 准备

After:

  • First content heading is now ## CANBUS 简介 (parent), displayed as 1 CANBUS 简介
  • Subsequent ### headings correctly display as 1.1, 1.2, etc.

Files Modified

Chinese templates (docs/common/dev/): 17 files
English templates (i18n/en/.../common/dev/): 14 files matching

Total: 31 files changed (144 insertions, 144 deletions across 2 commits)

Fix 0.x numbering issue caused by headings starting at ### without
a parent ##. Upgraded all affected templates by one heading level.

Changes:
- common/dev/_canbus.mdx: CANBUS 简介 → ##, ### → ##
- common/dev/_gpio.mdx: ### → ##, #### → ###
- common/dev/_i2c.mdx: ### → ##
- common/dev/_pwm.mdx: ### → ##
- common/dev/_spi.mdx: ### → ##
- common/dev/_uart.mdx: ### → ##, #### → ###
- common/dev/_w1.mdx: ### → ##
- common/dev/_pico-*.mdx: #####/####/### → ####/###/##
- i18n/en/.../common/dev/: same changes applied to English versions

Fixes rendering of tutorial pages like zero/zero3/app-development/canbus
where first content heading showed 0.x instead of 1.x
@tangzz-radxa tangzz-radxa requested review from a team and nascs as code owners April 20, 2026 03:32
Round 2 fixes from review:
- Fix level jumping (## → ####) in pico template subsections
- Align English templates to match Chinese heading levels
- Fix _canbus.mdx intro (revert to plain text to match English template)

Files modified (17):
- docs/common/dev/_canbus.mdx, _gpio.mdx, _i2c.mdx, _pwm.mdx, _spi.mdx, _uart.mdx, _w1.mdx
- docs/common/dev/_pico-*.mdx (8 files)
- i18n/en/.../common/dev/: corresponding English templates (matching changes)
Round 3: remove manually-written sequential numbers (1. 2. 3. etc.)
from headings, since Docusaurus auto-numbers them. Also fix _pico-fan.mdx
heading level (### 风扇 → ## 风扇, #### → ###).

Files modified (13):
- docs/common/dev/_pico-*.mdx (6 files): remove N. prefixes from headings
- docs/common/dev/_pico-fan.mdx: restructure heading levels
- i18n/en/.../common/dev/: same changes for English versions
@Milir-Radxa Milir-Radxa merged commit 241788d into radxa-docs:main Apr 20, 2026
3 of 6 checks passed
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.

2 participants