Add FAQs to Docs Datasets and Help sections (#14211)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
64862f1b69
commit
d5db9c916f
73 changed files with 3296 additions and 110 deletions
|
|
@ -128,6 +128,21 @@ def update_markdown_files(md_filepath: Path):
|
|||
header = "---\ncomments: true\ndescription: TODO ADD DESCRIPTION\nkeywords: TODO ADD KEYWORDS\n---\n\n"
|
||||
content = header + content
|
||||
|
||||
# Ensure MkDocs admonitions "=== " lines are preceded and followed by empty newlines
|
||||
lines = content.split("\n")
|
||||
new_lines = []
|
||||
for i, line in enumerate(lines):
|
||||
stripped_line = line.strip()
|
||||
if stripped_line.startswith("=== "):
|
||||
if i > 0 and new_lines[-1] != "":
|
||||
new_lines.append("")
|
||||
new_lines.append(line)
|
||||
if i < len(lines) - 1 and lines[i + 1].strip() != "":
|
||||
new_lines.append("")
|
||||
else:
|
||||
new_lines.append(line)
|
||||
content = "\n".join(new_lines)
|
||||
|
||||
# Add EOF newline if missing
|
||||
if not content.endswith("\n"):
|
||||
content += "\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue