Skip to content

In theme witiko/diagrams, add parameter command for Mermaid (and other) diagrams #616

@Witiko

Description

@Witiko

In #613 and #614, we added support for specifying the command for producing Mermaid diagrams globally. To allow local redefinition from within Markdown, we should also add a parameter command with the same effect, potentially for other types of diagrams as well.

Here is a demonstration of the proposed interface and the expected output:

\documentclass{article}
\usepackage[import=witiko/diagrams@v2]{markdown}
\begin{document}
\begin{markdown}

``` mermaid {command = "mmdc --iconPacks '@iconify-json/logos'"}
architecture-beta
    group api(logos:aws-lambda)[API]

    service db(logos:aws-aurora)[Database] in api
    service disk1(logos:aws-glacier)[Storage] in api
    service disk2(logos:aws-s3)[Storage] in api
    service server(logos:aws-ec2)[Server] in api

    db:L -- R:server
    disk1:T -- B:server
    disk2:T -- B:db 
```

\end{markdown}
\end{document}
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    expl3Related to the high-level programming language expl3feature requestthemesRelated to Markdown themes

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions