MaxMelcher / AzureDevOps.WikiPDFExport

Export Azure DevOps Wiki to PDF
MIT License
187 stars 62 forks source link

Support mermaid diagrams #22

Closed jkanczler closed 3 years ago

jkanczler commented 3 years ago

It's a pull request to support mermaid custom containers as code blocks. See the issue #11 Mermaid not supported.

::: mermaid
 graph LR;
 A[Wiki supports Mermaid] --> B[Visit https://mermaidjs.github.io/ for Mermaid syntax];
:::

In Azure Devops Wiki, this is rendered to a diagram. To support mermaid diagrams in PDF, unfortunately a "real" browser is needed. That's why PuppeteerSharp is a new dependency. PuppeteerSharp needs a chromium or chrome in headless mode to be able to execute mermaid.js into the HTML converted from the markdown.

Unfortunately, Microsoft supports the mermaid diagrams as custom containers instead of code blocks. Therefore Markdig must be extended with functionality to be able to convert the :::mermaid custom container to be a code block instead.

MaxMelcher commented 3 years ago

Wow, thanks @jkanczler - I will check/merge your PR ASAP.

MaxMelcher commented 3 years ago

merged!