Skip to content

Conversation

@krajniks
Copy link

@krajniks krajniks commented Feb 4, 2022

This adds support for mermaid diagrams inside containers, for example:

::: mermaid
stateDiagram
    [*] --> First
    state First {
        [*] --> second
        second --> [*]
    }
:::

This is implemented on Azure wiki. https://docs.microsoft.com/en-us/azure/devops/project/wiki/wiki-markdown-guidance?view=azure-devops#add-mermaid-diagrams-to-a-wiki-page

Code was transfered from https://github.com/mjbvz/vscode-markdown-mermaid

I have also updated a mermaid.png, as it renders differently.

@yodapotatofly
Copy link

I don't quite see the benefits of that since mermaid is already supported in standard code blocks :

```mermaid
graph LR;
    A[Hard edge] -->|Link text| B(Round edge) --> C{Decision}
    C -->|One| D[Result one]
    C -->|Two| E[Result two]
```

will appear in the pdf as

graph LR;
    A[Hard edge] -->|Link text| B(Round edge) --> C{Decision}
    C -->|One| D[Result one]
    C -->|Two| E[Result two]
Loading

@krajniks
Copy link
Author

this was requested due to support for Azure DevOps Wiki, as there mermaid is supported only in containers, but not in code blocks. This would then allow markdown-pdf to also render these markdowns to pdf with correct mermaid rendering. Does that make more sense?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants