Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add language: Mermaid Diagram Support #5578

Closed
Yash-Singh1 opened this issue Sep 28, 2021 · 8 comments
Closed

Add language: Mermaid Diagram Support #5578

Yash-Singh1 opened this issue Sep 28, 2021 · 8 comments
Assignees
Labels
Add Language Good First Issue This is a great opportunity to start contributing to Linguist

Comments

@Yash-Singh1
Copy link

Yash-Singh1 commented Sep 28, 2021

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)

@Yash-Singh1 Yash-Singh1 added Add Language Good First Issue This is a great opportunity to start contributing to Linguist labels Sep 28, 2021
@lildude
Copy link
Member

lildude commented Sep 29, 2021

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.

@Yash-Singh1
Copy link
Author

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.

@lildude lildude changed the title Proposal: Mermaid Diagram Support Add language: Mermaid Diagram Support Sep 1, 2022
@lildude
Copy link
Member

lildude commented Sep 1, 2022

I think https://github.com/bpruitt-goddard/vscode-mermaid-syntax-highlight should do the trick for syntax highlighting

@lildude lildude self-assigned this Sep 1, 2022
@Alhadis
Copy link
Collaborator

Alhadis commented Sep 1, 2022

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…

@lildude
Copy link
Member

lildude commented Sep 1, 2022

🤦 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 😁

@Alhadis
Copy link
Collaborator

Alhadis commented Sep 1, 2022

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. 😅

@lildude
Copy link
Member

lildude commented Sep 2, 2022

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 😁

@Alhadis
Copy link
Collaborator

Alhadis commented Oct 20, 2022

Track progress here: https://github.com/Alhadis/language-mermaid

I'll submit a PR once I've finished splattering mermaids.

Alhadis added a commit that referenced this issue Oct 25, 2022
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Add Language Good First Issue This is a great opportunity to start contributing to Linguist
Projects
None yet
Development

No branches or pull requests

3 participants