Skip to content

Commit 43ae45e

Browse files
committed
check for missing headers in files
1 parent cc07d9c commit 43ae45e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

utils/push_to_zoho.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ def convert_md(path: str) -> tuple[str, str, str]:
5252
docs_url
5353
)
5454

55-
header, body = md_text.split("#", 1)
56-
body = "{}#{}".format(docs_url_warning, body)
55+
parts = md_text.split("---", 2)
56+
if len(parts) != 3:
57+
raise ValueError("Markdown file {} seems to miss an header".format(path))
58+
_, header, body = parts
59+
body = "{}{}".format(docs_url_warning, body)
5760

5861
# replace relative url with absolute
5962
body = body.replace("../assets/images/", "https://docs.qfield.org/assets/images/")

0 commit comments

Comments
 (0)