Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MD043 - Required Heading Structure

Required heading structure not found.

Why This Rule Exists

Some documents must follow a specific heading structure for consistency across a project. This rule enforces a predefined heading pattern.

Examples

Configuration

[MD043]
headings = ["# Title", "## Introduction", "## Usage", "## API", "## License"]

Incorrect

# My Project

## Getting Started

## API Reference

Missing required "Introduction" and has different heading names.

Correct

# Title

## Introduction

## Usage

## API

## License

Configuration 2

[MD043]
headings = []          # Required headings in order
match_case = true      # Case-sensitive matching (default: true)

Wildcards

Use * to allow any heading at a position:

[MD043]
headings = ["# *", "## Introduction", "##*"]

When to Disable

  • Documents that don't follow a template
  • Creative content without structure requirements
  • Auto-generated files

Rule Details

  • Rule ID: MD043
  • Aliases: required-headings
  • Category: Structure
  • Severity: Warning
  • Auto-fix: No

Use Cases

  • README templates across repositories
  • Documentation standards
  • API documentation structure
  • Legal documents with required sections
  • MD001 - Heading increment
  • MD024 - Duplicate headings
  • MD025 - Single top-level heading