Skip to content

feat: auto-adjust markdown heading levels in design sections#26

Open
jeffutter wants to merge 1 commit intowedow:masterfrom
jeffutter:feature/adjust-design-headings
Open

feat: auto-adjust markdown heading levels in design sections#26
jeffutter wants to merge 1 commit intowedow:masterfrom
jeffutter:feature/adjust-design-headings

Conversation

@jeffutter
Copy link
Copy Markdown

Design documents are often written as standalone markdown with h1/h2 top-level headings. Since tk nests design under ## Design, these headings create improper structure (h1/h2 under h2 parent).

This adds automatic heading adjustment: h1 → h3, h2 → h4, etc.

Implementation:

  • New adjust_design_headings() function prepends ## to all headings
  • Applied in cmd_create() for --design flag
  • Applied in cmd_migrate_beads() during migration (awk tracks section)
  • Idempotent: already-adjusted or plain text content unchanged

Why: Ensures proper markdown structure, allows natural authoring of design docs as standalone documents, fixes Beads migration output.

All 114 test scenarios pass.

Design documents are often written as standalone markdown with h1/h2
top-level headings. Since tk nests design under `## Design`, these
headings create improper structure (h1/h2 under h2 parent).

This adds automatic heading adjustment: h1 → h3, h2 → h4, etc.

Implementation:
- New `adjust_design_headings()` function prepends ## to all headings
- Applied in `cmd_create()` for --design flag
- Applied in `cmd_migrate_beads()` during migration (awk tracks section)
- Idempotent: already-adjusted or plain text content unchanged

Why: Ensures proper markdown structure, allows natural authoring of
design docs as standalone documents, fixes Beads migration output.

All 114 test scenarios pass.
Nathan-Schwartz added a commit to Nathan-Schwartz/ticket that referenced this pull request Mar 26, 2026
Design documents written as standalone markdown have h1/h2 headings that
create improper nesting when placed under the ## Design section. This adds
automatic heading adjustment: h1 becomes h3, h2 becomes h4, etc.

Port of upstream PR wedow#26 (jeffutter).
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