• Stars
    star
    277
  • Rank 148,875 (Top 3 %)
  • Language
  • License
    MIT License
  • Created over 2 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of cheatsheets for using Mermaid diagrams on GitHub and elsewhere

Mermaid syntax references

A rewrite of the Mermaid documentation as a learning aid and cheatsheet.

ExampleCode
flowchart LR
    A[Start] --> B{Should you?}
    B -- Yes --> C{{Do it}}
    B -- Maybe --> D[(Save for later)]
    B -- No --> E[Okay]
flowchart LR
    A[Start] --> B{Should you?}
    B -- Yes --> C{{Do it}}
    B -- Maybe --> D[(Save for later)]
    B -- No --> E[Okay]

Flowchart in Mermaid cheatsheet

sequenceDiagram
    Alice ->>+ Bob: Here's a message!
    Bob ->>- Alice: Hmm, ok, thanks.
sequenceDiagram
    Alice ->>+ Bob: Here's a message!
    Bob ->>- Alice: Hmm, ok, thanks.

Sequence diagram in Mermaid cheatsheet

classDiagram
    class ClassName {
        String stringName
        Long longName
        MyDatatype attributeName

        functionName(parameter) ReturnType
        functionName2(parameter2) ReturnType
    }
    class Interface {
        Int intName
    }
    ClassName --|> Interface
classDiagram
    class ClassName {
        String stringName
        Long longName
        MyDatatype attributeName

        functionName(parameter) ReturnType
        functionName2(parameter2) ReturnType
    }
    class Interface {
        Int intName
    }
    ClassName --|> Interface

Class diagram in Mermaid cheatsheet

stateDiagram-v2
    Stationary --> Moving : Begin moving
    Moving --> Stationary : Stop moving
stateDiagram-v2
    Stationary --> Moving : Begin moving
    Moving --> Stationary : Stop moving

State diagram in Mermaid cheatsheet

erDiagram
    User {
        Int id PK
        String username
        Int serverId FK
    }

    Server {
        Int id PK
        String serverName
    }

    Server ||--o{ User : has
erDiagram
    User {
        Int id PK
        String username
        Int serverId FK
    }

    Server {
        Int id PK
        String serverName
    }

    Server ||--o{ User : has

Entity relationship diagram in Mermaid cheatsheet

journey
    title User Journey
    section Logging in
        Navigate to login: 4: Alice, Bob, Craig
        Entering details: 2: Alice, Bob
        Pressing button: 5: Alice
journey
    title User Journey
    section Logging in
        Navigate to login: 4: Alice, Bob, Craig
        Entering details: 2: Alice, Bob
        Pressing button: 5: Alice

User journey diagram in Mermaid cheatsheet

gantt
    Dated Milestone: milestone, m1, today, 1d
    Relative Milestone: milestone, m2, after m1, 1d
    Task 1: a1, today, 1d
    Task 2: a2, after a1, 1d
    Task 3: a3, today, 36hr
gantt
    Dated Milestone: milestone, m1, today, 1d
    Relative Milestone: milestone, m2, after m1, 1d
    Task 1: a1, today, 1d
    Task 2: a2, after a1, 1d
    Task 3: a3, today, 36hr

Gantt chart in Mermaid cheatsheet

pie
    title Fruits
    "Apples" : 50
    "Oranges" : 20
    "Grapes" : 9.99
    "Passionfruits" : 12.5
pie
    title Fruits
    "Apples" : 50
    "Oranges" : 20
    "Grapes" : 9.99
    "Passionfruits" : 12.5

Pie chart in Mermaid cheatsheet

    requirementDiagram

    requirement UptimeRequirement {
        id: 1
        text: Site Uptime 
        risk: Medium
        verifymethod: Analysis
    }

    element satisfyingElement {
        type: MyElement
        docref: ABC001
    }

    element containingElement {
        type: MyElement
        docref: ABC002
    }

    satisfyingElement - satisfies -> UptimeRequirement
    containingElement - contains -> UptimeRequirement
    requirementDiagram

    requirement UptimeRequirement {
        id: 1
        text: Site Uptime 
        risk: Medium
        verifymethod: Analysis
    }

    element satisfyingElement {
        type: MyElement
        docref: ABC001
    }

    element containingElement {
        type: MyElement
        docref: ABC002
    }

    satisfyingElement - satisfies -> UptimeRequirement
    containingElement - contains -> UptimeRequirement

Requirement diagram in Mermaid cheatsheet

gitGraph BT:
    commit
    branch branch2
    checkout branch2
    commit
    checkout main
    commit
    merge branch2
gitGraph BT:
    commit
    branch branch2
    checkout branch2
    commit
    checkout main
    commit
    merge branch2

Git graphs in Mermaid cheatsheet

More Repositories

1

Vidsta

Easily implementable and customisable Android video player library
Java
37
star
2

APODWallpaper

A highly customisable app to set your Android device's wallpaper to NASA's APOD
Kotlin
14
star
3

StickyHeaders

Sticky Headers Demo
Kotlin
12
star
4

cybersecurity-certificate-notes

Misc notes from Google's Cybersecurity Professional Certificate
9
star
5

PixelBlacksmith

"Pixel Blacksmith" is a 2016 Android crafting RPG (and my first app!) with 250k downloads, a complex visitor system, and hundreds of items
Java
8
star
6

SelectiveScrubber

Chrome extension for selectively removing phrases & sites from history in a single click
JavaScript
7
star
7

DynamicIconChanging

Proof of concept of dynamic Android app icon changing
Kotlin
6
star
8

uxdesign-certificate-notes

Misc notes from Google's UX Design Professional Certificate
4
star
9

junkbot-code

LEGO's Junkbot source code & assets
LiveScript
4
star
10

android-gradient-playground

https://blog.jakelee.co.uk/a-few-experiments-with-android-drawable-gradients/
Kotlin
3
star
11

blog-programming

Jekyll (w/ minimaJake) repo for my programming blog
Ruby
3
star
12

PreferencesExample

Example of preference screens / management in an Android app
Kotlin
3
star
13

minimaJake

Minima, but with the missing functionality added
SCSS
2
star
14

Wordpress

Automated backup of all posts and pages on my programming blog
2
star
15

BlacksmithSlots

"Blacksmith Slots" is a 2017 hybrid slots and RPG Android game, featuring a story alongside an innovative gameplay loop
Java
2
star
16

UpdateListener

Proof of concept of an app update listener
Kotlin
2
star
17

FirebaseReference

FirebaseReference is a project being developed alongside a straightforward tutorial series, featuring step by step guides to every service in Firebase.
Kotlin
2
star
18

BlogCustomActionBar

A custom action bar example project
Kotlin
1
star
19

WarningBarDemo

Demo for displaying a "no internet" bar when no internet is available
Kotlin
1
star
20

retrofit-experiments

Small collection of implementations of retrofit tutorials
Kotlin
1
star
21

blog-history

Jekyll (w/Minima) repo for my Internet History blog
Ruby
1
star
22

CombinedBuildConfigVariables

A proof of concept approach to using both buildtypes and flavours to determine a BuildConfig variable
Kotlin
1
star
23

KotlinExperiments

Kotlin
1
star
24

Apod-Wallpaper-2

Complete rewrite of "Daily APOD Wallpaper" using MVI & lots of fancy tech!
Kotlin
1
star
25

PopularMovies

Popular Movies project for Android Nanodegree
Java
1
star
26

PixelBookshop

An unfinished MVVM & Room Android game about running a bookshop
Kotlin
1
star
27

rp.lc

rp.lc (Replace) is a very unfinished engine & ecosystem for creating simulations that act based on input images
Kotlin
1
star
28

settlers

An online version of the Settlers 3 manual
HTML
1
star
29

blog-personal

Jekyll (w/ minimaJake) repo for my non-programming blog
JavaScript
1
star
30

ConnectQuest

"Connect Quest" is a 2017 Android puzzle game, featuring infinite puzzle generation, 2.5D graphics, and the ability to share levels via QR codes
Java
1
star
31

Google-Play-purchase-history-analyser

Proof of concept for analysing google play purchase history
JavaScript
1
star