Skip to content

Comments

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

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.
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