1
Fork 0

Extract out diagram types

This commit is contained in:
Jake Howard 2023-09-15 21:14:06 +01:00
parent b501c34afb
commit d0fea7851a
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -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"] = {