Skip to content

Latest commit

 

History

History
80 lines (41 loc) · 1.47 KB

README.md

File metadata and controls

80 lines (41 loc) · 1.47 KB

Create Tree using Mermaid

Setup

  1. Install npm (choco install nodejs)

  2. Install mermaid-cli using this line escalated:

    npm install -g @mermaid-js/mermaid-cli

  3. Compile mermaid files using:

    mmdc -i .\obrien.mmd -o .\obrien.png

Code Example

See this example for a basic tree structure

%% Alice of Patrick Brien and Elizabeth Murray Ratoath
flowchart TD
    p["fa:fa-person Patrick Brien"]
    e["fa:fa-person-dress Elizabeth Murray"]
    A["fa:fa-person-dress Alice Brien<br>*(b.1822-d.1875)*"]

    p -- Father to --> A
    e -- Mother to --> A


%% Freestanding text at the end of the chart
    text["Additional Notes: The Brien family history..."]
    style text fill:#000000, stroke:none, font-size:12px

This is how this looks in png:

O'Brien Family Tree

Github should render this code block as a picture if the code block is prefixed with mermaid

%% Alice of Patrick Brien and Elizabeth Murray Ratoath
flowchart TD
    p["fa:fa-person Patrick Brien"]
    e["fa:fa-person-dress Elizabeth Murray"]
    A["fa:fa-person-dress Alice Brien<br>*(b.1822-d.1875)*"]

    p -- Father to --> A
    e -- Mother to --> A


%% Freestanding text at the end of the chart
    text["Additional Notes: The Brien family history..."]
    style text fill:#000000, stroke:none, font-size:12px

Loading

External Links

https://github.com/mermaid-js/mermaid-cli

https://mermaid.live/

Font Awesome:
https://fontawesome.com/search