Skip to content

Latest commit

 

History

History
106 lines (77 loc) · 1.99 KB

File metadata and controls

106 lines (77 loc) · 1.99 KB
id MDS004
name first-line-heading
status ready
description First line of the file should be a heading.

MDS004: first-line-heading

First line of the file should be a heading.

  • ID: MDS004
  • Name: first-line-heading
  • Status: ready
  • Default: enabled, level: 1
  • Fixable: no
  • Implementation: source
  • Category: heading

Settings

Setting Type Default Description
level int 1 Required heading level for the first line

Config

Enable (default):

rules:
  first-line-heading:
    level: 1

Disable:

rules:
  first-line-heading: false

Custom (require level 2):

rules:
  first-line-heading:
    level: 2

Examples

Bad — content before heading

Some content here.

# Title

Bad — blank line before heading

The file below has a blank line between the frontmatter closing --- and # Title. The blank line is not visible in the code block but triggers the diagnostic.

# Title

Good

# Title

Some content here.

Diagnostics

Message Condition
first line should be a level {level} heading Line 1 is missing or not a heading
first line should be a level {level} heading, found blank line First child is a heading but preceded by blank line
first heading should be level {level}, got {n} First heading on line 1 has the wrong level