google / gitiles

A simple browser for Git repositories.
https://gerrit.googlesource.com/gitiles/
Other
582 stars 174 forks source link

Render graph using mermaid.js in .md files #274

Open CharlesLgn opened 1 year ago

CharlesLgn commented 1 year ago

Hello,

In Github, we can use mermaid.js to render graph with code block.

for instance, if I write,

flowchart LR

A ---> B

using ```mermaid at the begining of my code block, I can render a graph like below

flowchart LR

A ---> B

I search how to do it with gitiles markdown, but I don't think it' possible.

do someone have an idea how to do it ?

CharlesLgn commented 1 year ago

Okey, I found out why it is not currently possible.

Mermaid.js is used by the gitlab-flavoured-markdown (link to the doc)

the project currently is using commonmark-java 0.10 which don't provide gitlab-flavoured-markdown . A solution could be to change the dependance with com.vladsch.flexmark 0.64.0 (link to the project) which provide it and is also to the last version of the commonMark specification.

Is it possible ?