Skip to content

Commit

Permalink
Docs: Translate myst warning admonition to mdbook
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorak-mmk committed Jan 23, 2024
1 parent 68b87bb commit ef17f3d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/sphinx_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ def remove_sphinx_markdown(md_file_text, name):
in_eval_rst = True
continue

# mdbook doesn't support other types of admonitions
if line == ":::{warning}":
line = '<div class="warning">'
elif line == ":::":
line = '</div>'

if line.startswith(':::'):
print(f"Unknown admonition marker in chapter {name}: {line}", file=sys.stderr)
sys.exit(1)


output_lines.append(line)

if len(rst_section_content) > 0:
Expand Down

0 comments on commit ef17f3d

Please sign in to comment.