Skip to content

Commit

Permalink
fix admonitions specific to sphinx and docutils
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Jul 3, 2024
1 parent e53121c commit 2e14e4e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions sphinx_immaterial/custom_admonitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,16 @@ def get_directive_class(name, title, classes=None) -> Type[CustomAdmonitionDirec
if classes:
class_list.extend(classes)

# uncomment this block when we merge v9.x from upstream
# if name in ("caution", "attention"):
# class_list.append("warning")
# elif name == "error":
# class_list.append("danger")
# elif name in ("important", "hint"):
# class_list.append("tip")
# elif name == "todo":
# class_list.append("info")
# make sphinx/docutils admonitions compatible with changes in
# supported admonition types in upstream v9
if name in ("caution", "attention"):
class_list.append("warning")
elif name == "error":
class_list.append("danger")
elif name in ("important", "hint"):
class_list.append("tip")
elif name == "todo":
class_list.append("info")

class CustomizedAdmonition(CustomAdmonitionDirective):
default_title = title
Expand Down

0 comments on commit 2e14e4e

Please sign in to comment.