linguist
linguist copied to clipboard
Add language: Mermaid Diagram Support
Language name
MermaidJS
URL of example repository
https://github.com/lotusnprod/lotus-processor/blob/f46c20768fa80e8fe6c438424323734f547f6163/docs/flowchart.mmd
URL of syntax highlighting grammar
WIP
Most popular extensions
.mmd
Detected language
N/A
Popularity
https://github.com/search?p=1&q=extension%3Ammd&type=Code (6K Results)
Please note, Linguist can only add support for syntax highlighting of the files (I'm not sure how useful that would be) assuming a grammar can be found. Rendering to show the images would need to be implemented elsewhere.
assuming a grammar can be found
I am currently working on a text mate grammar, so Iβll create a PR after I am done with that.
I think https://github.com/bpruitt-goddard/vscode-mermaid-syntax-highlight should do the trick for syntax highlighting
I've never seen this syntax before. Is !!import/deep
a YAML thing?
repository:
mermaid:
patterns: !!import/deep
- diagrams/
Doesn't look like a valid TextMate-compatible grammar to me. It might rely on a build-step or somethingβ¦
π€¦ I completely missed that. Nope, that's not a YAML thing... it's a TypeScript module thing and yup, there's a build-step π
Ignore me π
Want me to write one? I'm already halfway through taking apart Mermaid's own Monaco-based highlighter to see how it works. I've reduced it to a list of keywords and patterns, so smashing something together shouldn't be too difficult.
All I ask in return is that GitHub support Pikchr so we can use pic(1) on GitHub. π
EDIT: Wait, Mermaid is, like, 10 different syntaxes hiding under a trench-coat pretending to be a single language. I can write a grammar for it, but I probably won't be done in time for the next Linguist release. π
Want me to write one? [...] EDIT: Wait, Mermaid is, like, 10 different syntaxes hiding under a trench-coat pretending to be a single language. I can write a grammar for it, but I probably won't be done in time for the next Linguist release. π
Go for it if you want the challenge and no rush. I thought it would be a quick addition when I found the grammar.
All I ask in return is that GitHub support Pikchr so we can use pic(1) on GitHub. π
Ask in the Product Feedback section of https://github.com/orgs/community/discussions/ and you never know, your wish may come true one day π
Track progress here: https://github.com/Alhadis/language-mermaid
I'll submit a PR once I've finished splattering mermaids.