Coder Social home page Coder Social logo

inkdrop-mermaid's Introduction

Mermaid plugin for Inkdrop

A plugin for drawing flowcharts and diagrams using mermaid.js in Markdown code block.

Install

Check out the docs on how to install plugins.

Command-line

ipm install mermaid

Usage

```mermaid
graph LR
    A --- B
    B-->C[fa:fa-ban forbidden]
    B-->D(fa:fa-spinner);
```

It will be rendered as:

Flowchart example

```mermaid
sequenceDiagram
    participant Alice
    participant Bob
    Alice->>John: Hello John, how are you?
    loop Healthcheck
        John->>John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail...
    John-->>Alice: Great!
    John->>Bob: How about you?
    Bob-->>John: Jolly gooda!
```

It will be rendered as:

Sequence diagram example

Customizations

You can configure mermaid options in Preferences.

Mermaid supports custom theme variables:

Options

Note: You have to reload the app to get the custom theme CSS and variables applied.

Inline theming

It is also possible to override theme settings locally, for a specific diagram, using directives %%init%% like so:

```mermaid
%%{init:{
  'theme':'base',
  'themeVariables': {
    'primaryColor':'#6A7FAB',
    'primaryTextColor':'#FAFBF9',
    'primaryBorderColor':'#6A7FAB',
    'lineColor':'#6A7FABCC',
    'textColor':'#6A7FABCC',
    'fontSize':'16px'
  }
}}%%

graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```

It yields:

Inline theming example

More details can be found on the Mermaid documentation.

Changelog

2.6.0 [Aug 28, 2023]

  • Support lazy loading

2.5.3 [Jun 2, 2023]

2.5.1 [Jul 7, 2022]

2.5.0 [May 21, 2022]

  • Bump up Mermaid to v9.1.1 (Thanks dkarter)

2.4.0 [Jan 30, 2022]

  • Update to the latest mermaid version (8.13.10)
  • Dropdown list for changing theme
  • Custom theme CSS
  • Custom theme variables
  • Allow disabling auto-scaling diagrams

2.3.0 [April 13, 2021]

Updated to the latest mermaid version (8.9.2)

2.2.0 [October 2, 2020]

Updated to the latest mermaid version (8.8.0)

2.1.0 [December 20, 2019]

Updated to the latest mermaid version

1.0.0 - First Release

inkdrop-mermaid's People

Contributors

aditdiqdpratama avatar craftzdog avatar dependabot[bot] avatar dkarter avatar seigel 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

Watchers

 avatar  avatar  avatar

inkdrop-mermaid's Issues

No arrow sign in Sequence Diagram

Using a code of sequence diagram, Alice/Bob/John example, the preview doesn't show the arrow while graph LP works fine. Inkdrop version 5.4.1 (Demo).

image

classDiagram Not working?

I seem to get this error with the latest plugin version:

Cannot read property 'members' of undefined

This is the code I am using:

classDiagram
  class BankAccount
  BankAccount : +String owner
  BankAccount : +Bigdecimal balance
  BankAccount : +deposit(amount)
  BankAccount : +withdrawl(amount)    

C4-PlantUML syntax support

mermaid version 9.1.2 includes experimental support for C4-PlantUML syntax. Is this gonna be supported in future by this plugin? Thanks in advance!

Theming support doesn't take export into account

  1. Set Inkdrop to Dark mode w/ Dark content
  2. When you use Mermaid, you'll end up wanting to use the Dark mode in it to match
  3. If you export as PDF, the page is not in dark mode so the mermaid diagram doesn't match the output

Recommendation would be to have a separate in-app theme setting vs print theme setting.

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.