raghur / mermaid-filter

Pandoc filter for creating diagrams in mermaid syntax blocks in markdown docs
413 stars 74 forks source link

can't specify options via pandoc #93

Closed kurokirasama closed 1 year ago

kurokirasama commented 1 year ago

Hello, I have this graph:

\`\`\`mermaid
graph LR
    date-->month & day & year 
    time-->hours & minutes & seconds
\`\`\`

that I run with

pandoc -F mermaid-filter ...

If I try to add some options,

\`\`\`mermaid{.mermaid width=300}
graph LR
    date-->month & day & year 
    time-->hours & minutes & seconds
\`\`\`

I just got the text in the pdf:

mermaid{.mermaid width=300 format=svg} graph LR
date-->month & day & year
time-->hours & minutes & seconds

Sorry about the "backslask backtip, I dont know how to keep the backtips.

moschmdt commented 1 year ago

I have the same problem. Is there a way to define settings for all mermaid diagrams?

kurokirasama commented 1 year ago

This doesn't work either (trying pandoc-crossref):

{.mermaid #fig:datos}
kurokirasama commented 1 year ago

I found my mistake: I tried:

mermaid{.mermaid width=300}

when it was

{.mermaid width=300}

The crossref still doesn't work for me though

kurokirasama commented 1 year ago

I found my mistake again, you have to set the caption explicitly:

{.mermaid #fig:datos caption="a caption"}