Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for mermaid containers #277

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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