Skip to content

Commit

Permalink
docs: fix handling of "dropdown" admonition for base overview of core…
Browse files Browse the repository at this point in the history
… components
  • Loading branch information
sstroemer authored Nov 24, 2024
1 parent d40896a commit 6db2740
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/dynamic/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,19 @@ def _dyn_core_create_md(cc: str):
main_docstr = docs["docstr_main"]
final_main_docstr = ""
if '!!! details "Basic Examples"' in main_docstr:
within_example = False
for line in main_docstr.splitlines():
if line == '!!! details "Basic Examples"':
final_main_docstr += ":::{admonition} **Basic Examples**\n:class: dropdown\n\n"
if not within_example:
if line == '!!! details "Basic Examples"':
final_main_docstr += ":::{admonition} **Basic Examples**\n:class: dropdown\n\n"
within_example = True
else:
final_main_docstr += line + "\n"
else:
final_main_docstr += line[4:] + "\n"
final_main_docstr = final_main_docstr + ":::"
else:
final_main_docstr = main_docstr

with open(DYNAMIC / ".." / "pages" / "manual" / "yaml" / "core" / f"{cc.lower()}.md", "w") as f:
f.write(f"# {cc}\n\n")
Expand Down

0 comments on commit 6db2740

Please sign in to comment.