Giter VIP home page Giter VIP logo

mermaid-mode's Introduction

Hi there 👋

mermaid-mode's People

Contributors

abrochard avatar bkhl avatar bricka avatar dergutemoritz avatar freesteph avatar jimeh avatar latavin243 avatar lgfang avatar meain avatar miyamotoakira avatar mjburling avatar nanjj avatar spicyriceball avatar taquangtrung avatar tshu-w avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mermaid-mode's Issues

auto-mode-alist regex error

(add-to-list 'auto-mode-alist '("\\.mmd\\" . mermaid-mode)) should be (add-to-list 'auto-mode-alist '("\\.mmd\\'" . mermaid-mode)).

\\' is used to end the string.

How to use it in org mode

The variable mermaid-mmdc-location is set as "~/node_modules/.bin/mmdc". Pressing C-c C-c in the code block generates the error error: option -i, --input ' argument missing. There is also a [ob-mermaid](https://github.com/arnm/ob-mermaid). I can use ob-mermaidwhenmermaid-modeis not installed. However, whenmermaid-modeis installed, pressingC-c C-c` in org mode generates the above error.

Error Handling/reporting of diagram errors

When using mermaid-compile-region, if the mermaid diagram has a syntax error and has been previously rendered, then it fails silently and displays the old version of the diagram.

It should be able to detect that the compiler gave an error and display a warning in the mini-buffer or the full error message in a new buffer (or logged to *Messages).

Specify mermaid.cli flags

Hello, thanks for a great package!

Do you think we could add a way to specify cli flags?
I run this in WSL (Windows subsystem for linux) and i have to be able to specify the "-p" flag for puppeteer-config.json, otherwise mermaid won't run.

Error with mermaid-open-browser

When I try to open in a browser (C-c C-o) i get:

mermaid-open-browser: Symbol’s function definition is void: browse-url-default-browser

Is there something I have to configure?

I'm using emacs 26.1 on Ubuntu 19.04.

Thanks in advance!

First line indentation issue

Probably the issue affects more than just the first line but that is easiest to demonstrate.

With emacs -Q, I get:

    classDiagram
    class A
    class B

Instead of

classDiagram
    class A
    class B

Melpa 20230905.1916.
GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8)

Comments not given correct face

Mermaid documentation says that any line beginning with %% is a comment (source). I don't believe this is reflected in mermaid-mode, resulting in comments not getting assigned the typically expected font face.

mermaid-mode redefines ob-mermaid org-babel-execute:mermaid

Both mermaid-mode and ob-mermaid defines the org-babel-execute:mermaid function who controls the evaluation of org-mode mermaid src blocks. When loading both packages, the loading order will determine which one will be applied. This can be confusing. For example, if the mermaid-mode one is the active and you use the :theme parameter (supported by ob-mermaid but not by mermaid-mode), it will be silently ignored.

I think the correct thing to do is to integrate ob-mermaid with mermaid-mode or remove org-babel-execute:mermaid from mermaid-mode.

Difference between mermaid-mode versus ob-mermaid?

Hi Abrochard,

So nice of you to make this. I'm looking forward to using mermaid on emacs. But which do I choose? Your mermaid-mode or op-mermaid?

I'm asking you because it seems you uploaded this in 2019 whereas the other was started in 2018 on github. You've updated your code more recently Mar 2020 versus Aug 2019.

So what was your motivation to write different code? What do you find missing in ob-mermaid? Does yours contain everything from ob-mermaid? What are the strengths and weaknesses of each?

Thankfully

Support for ER Diagram Syntax and Indentation

Thank you for this! Love using mermaid-mode with ob-mermaid.

Unfortunately at the moment it only seems to support Graphs and Sequence diagrams.

Creating this issue to discuss about adding support for ERDiagrams!

can mermaid-mode support chinese?

I tried chinese in mermaid liveeditor, it seems ok.
but when I use chinese in emacs mermaid-mode, and compile it, it cause syntax error.

how can i use chinese in mermaid-mode? or how to construct mermaid cli command to support chinese?

I am in win10, emacs 29.0.50, mermaid file encoding with GBK or UTF-8 cause same thing.

thanks.

Indentation appears after cursor on new line

Thanks for the package! I personally use Evil mode, but when I press Enter to go to the next line, the indentation appears after my cursor, so my cursor is not indented.

Screen.Recording.2023-01-26.at.13.18.07.mov

FYI: Configuration for running mmdc via mermaid-cli docker image

The following configuration will allow rendering mermaid charts without needing to install nodejs+mermaid-cli to the local OS. Instead it will execute mmdc via the mermaid-cli docker image. Figured it'd make sense to note this somewhere in case someone else found it useful:

(setq mermaid-mmdc-location "docker")
(setq mermaid-flags "run -u 1000 -v /tmp:/tmp ghcr.io/mermaid-js/mermaid-cli/mermaid-cli:9.1.6")

Some explanation of the docker run arguments:

  • -u 1000 ensures that the resulting output png file has a matching UID to the current user, avoiding permissions issues when deleting or overwriting the png. The 1000 is my UID on my machine. There might be a way to figure out the UID directly in emacs.
  • -v /tmp:/tmp mounts the host /tmp to /tmp inside the container. This ensures that mmdc inside the container will be reading/writing to the host /tmp when rendering.
  • 9.1.6: Latest stable version as of this writing. Can check available tags here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.