Skip to content

Commit 44aa6d5

Browse files
committed
check if admonition is note
1 parent 48d48ae commit 44aa6d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/validate-headings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def validate_headers(path: Path) -> None:
2020

2121
title_count = 0
2222
admonition_count = 0
23+
admonition_is_note = False
2324
headings_count = dict.fromkeys(HEADINGS, 0)
2425
for cell in notebook.cells:
2526
if cell["cell_type"] != "markdown":
@@ -32,6 +33,9 @@ def validate_headers(path: Path) -> None:
3233
title_count += 1
3334
elif line == f"```{{admonition}} {ADMONITION_TITLE}":
3435
admonition_count += 1
36+
elif admonition_count and not admonition_is_note:
37+
admonition_is_note = line.startswith(":class: note")
38+
assert admonition_is_note, f"{path=!s}: The admonition is not a note"
3539

3640
if not path.name.startswith("template"):
3741
assert title_count, f"{path=!s}: The first line is not a title."

0 commit comments

Comments
 (0)