Extract out diagram types
This commit is contained in:
parent
b501c34afb
commit
d0fea7851a
1 changed files with 8 additions and 7 deletions
|
@ -13,6 +13,11 @@ from scour.scour import scourString
|
||||||
|
|
||||||
logger = get_plugin_logger("kroki")
|
logger = get_plugin_logger("kroki")
|
||||||
|
|
||||||
|
DIAGRAM_TYPES = {
|
||||||
|
"blockdiag",
|
||||||
|
"mermaid"
|
||||||
|
}
|
||||||
|
|
||||||
DIAGRAM_CACHE_TIME = timedelta(days=7)
|
DIAGRAM_CACHE_TIME = timedelta(days=7)
|
||||||
|
|
||||||
def get_kroki_diagram(source, language):
|
def get_kroki_diagram(source, language):
|
||||||
|
@ -49,15 +54,11 @@ def on_config(config):
|
||||||
|
|
||||||
custom_fences = [
|
custom_fences = [
|
||||||
{
|
{
|
||||||
"name": "blockdiag",
|
"name": diagram,
|
||||||
"class": "blockdiag",
|
"class": diagram,
|
||||||
"format": partial(fence_div_format, config["site_dir"])
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mermaid",
|
|
||||||
"class": "mermaid",
|
|
||||||
"format": partial(fence_div_format, config["site_dir"])
|
"format": partial(fence_div_format, config["site_dir"])
|
||||||
}
|
}
|
||||||
|
for diagram in DIAGRAM_TYPES
|
||||||
]
|
]
|
||||||
|
|
||||||
config.mdx_configs["pymdownx.superfences"] = {
|
config.mdx_configs["pymdownx.superfences"] = {
|
||||||
|
|
Loading…
Reference in a new issue