File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff 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."
You can’t perform that action at this time.
0 commit comments