yzane / vscode-markdown-pdf

Markdown converter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=yzane.markdown-pdf
Other
990 stars 203 forks source link

Mermaid not in PDF #204

Open stefanhuber opened 4 years ago

stefanhuber commented 4 years ago

I successfully generate HTML from markdown. It includes Mermaid and plantuml. However, inside the PDF, jpg and png there is only the source code. I checked all settings and couldn't find anything about it.

My setup: Windows 10 markdown-pdf: 1.4.4 VS Code: 1.46.1

CaBazaga commented 2 years ago

This markdown, taken directly from the plugin Readme.

# mermaid test

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


Does render on HTML but not on any other format, instead I get a "syntax error" image.
![Excel validation report](https://user-images.githubusercontent.com/86959571/168138821-bba5ef20-83a3-48af-ace6-1a33446668c6.png)

Sidenote: PlantUML works fine on all formats.
lsondakh commented 2 years ago

Hi @CaBazaga I have the same problem, have you been able to solve it?

CaBazaga commented 2 years ago

Nope, I switched to use plantUML to move forward.

nnawata commented 2 years ago

Here is my workaround.

  1. Install "markdown Preview Enhanced" on VSC.
  2. Right click on the markdown text file, and then, "Open Preview to the Slide"
  3. Now you have the preview with mermaid diagram.
  4. Right click on the preview, then select "Chrome (Pupperteer) - PDF" $^1$ or "Open in Browser"$^2$

$^1$ PDF will be directly created to your folder. $^2$ The output image will be shown on your browser, and use Print to PDF function.