diff --git a/hooks/kroki.py b/hooks/kroki.py index 05ebf0e..be93514 100644 --- a/hooks/kroki.py +++ b/hooks/kroki.py @@ -13,6 +13,11 @@ from scour.scour import scourString logger = get_plugin_logger("kroki") +DIAGRAM_TYPES = { + "blockdiag", + "mermaid" +} + DIAGRAM_CACHE_TIME = timedelta(days=7) def get_kroki_diagram(source, language): @@ -49,15 +54,11 @@ def on_config(config): custom_fences = [ { - "name": "blockdiag", - "class": "blockdiag", - "format": partial(fence_div_format, config["site_dir"]) - }, - { - "name": "mermaid", - "class": "mermaid", + "name": diagram, + "class": diagram, "format": partial(fence_div_format, config["site_dir"]) } + for diagram in DIAGRAM_TYPES ] config.mdx_configs["pymdownx.superfences"] = {