Implement a transformer that increments all heading levels by a configurable offset.
Scope
HeadingDemoter(offset: Int = 1) — increments every Heading node's level by offset
- H6 + any positive offset: clamp to H6 and emit a warning (H7+ is not valid Markdown)
- Negative offset (promotion) is also supported
Use case
When merging multiple documents into one, each source file's headings need to be relativised so they sit correctly under a top-level section heading.
Acceptance criteria
- All headings in a document are incremented by the specified offset
- H6 with offset > 0 is clamped to H6 with a warning logged
- offset = 0 produces no change
Implement a transformer that increments all heading levels by a configurable offset.
Scope
HeadingDemoter(offset: Int = 1)— increments everyHeadingnode's level byoffsetUse case
When merging multiple documents into one, each source file's headings need to be relativised so they sit correctly under a top-level section heading.
Acceptance criteria