mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-22 01:36:43 +02:00
chore: Change mermaid
blocks to mermaid-example
in docs
This commit is contained in:
@@ -75,7 +75,7 @@ When deployed within code, init is called before the graph/diagram description.
|
|||||||
|
|
||||||
**for example**:
|
**for example**:
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
%%{init: {"theme": "default", "logLevel": 1 }}%%
|
%%{init: {"theme": "default", "logLevel": 1 }}%%
|
||||||
graph LR
|
graph LR
|
||||||
a-->b
|
a-->b
|
||||||
|
@@ -88,7 +88,7 @@ Here the directive declaration will set the `logLevel` to `debug` and the `theme
|
|||||||
|
|
||||||
Note: You can use 'init' or 'initialize' as both are acceptable as init directives. Also note that `%%init%%` and `%%initialize%%` directives will be grouped together after they are parsed.
|
Note: You can use 'init' or 'initialize' as both are acceptable as init directives. Also note that `%%init%%` and `%%initialize%%` directives will be grouped together after they are parsed.
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%%
|
%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%%
|
||||||
%%{initialize: { 'logLevel': 'fatal', "theme":'dark', 'startOnLoad': true } }%%
|
%%{initialize: { 'logLevel': 'fatal', "theme":'dark', 'startOnLoad': true } }%%
|
||||||
...
|
...
|
||||||
|
@@ -10,7 +10,7 @@ Note that at the moment, the only supported diagrams are below:
|
|||||||
|
|
||||||
### Flowcharts
|
### Flowcharts
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
graph LR
|
graph LR
|
||||||
A["$$x^2$$"] -->|"$$\sqrt{x+3}$$"| B("$$\frac{1}{2}$$")
|
A["$$x^2$$"] -->|"$$\sqrt{x+3}$$"| B("$$\frac{1}{2}$$")
|
||||||
A -->|"$$\overbrace{a+b+c}^{\text{note}}$$"| C("$$\pi r^2$$")
|
A -->|"$$\overbrace{a+b+c}^{\text{note}}$$"| C("$$\pi r^2$$")
|
||||||
@@ -20,7 +20,7 @@ Note that at the moment, the only supported diagrams are below:
|
|||||||
|
|
||||||
### Sequence
|
### Sequence
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
autonumber
|
autonumber
|
||||||
participant 1 as $$\alpha$$
|
participant 1 as $$\alpha$$
|
||||||
|
@@ -41,7 +41,7 @@ In the `Code` panel, write or edit Mermaid code, and instantly `Preview` the ren
|
|||||||
|
|
||||||
Here is an example of Mermaid code and its rendered result:
|
Here is an example of Mermaid code and its rendered result:
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
graph TD
|
graph TD
|
||||||
A[Enter Chart Definition] --> B(Preview)
|
A[Enter Chart Definition] --> B(Preview)
|
||||||
B --> C{decide}
|
B --> C{decide}
|
||||||
|
@@ -83,7 +83,7 @@ Mermaid offers a variety of styles or “looks” for your diagrams, allowing yo
|
|||||||
|
|
||||||
You can select a look by adding the look parameter in the metadata section of your Mermaid diagram code. Here’s an example:
|
You can select a look by adding the look parameter in the metadata section of your Mermaid diagram code. Here’s an example:
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
---
|
---
|
||||||
config:
|
config:
|
||||||
look: handDrawn
|
look: handDrawn
|
||||||
@@ -108,7 +108,7 @@ In addition to customizing the look of your diagrams, Mermaid Chart now allows y
|
|||||||
|
|
||||||
You can specify the layout algorithm directly in the metadata section of your Mermaid diagram code. Here’s an example:
|
You can specify the layout algorithm directly in the metadata section of your Mermaid diagram code. Here’s an example:
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
---
|
---
|
||||||
config:
|
config:
|
||||||
layout: elk
|
layout: elk
|
||||||
|
@@ -7,7 +7,7 @@ outline: 'deep' # shows all h3 headings in outline in Vitepress
|
|||||||
|
|
||||||
## Introduction to Block Diagrams
|
## Introduction to Block Diagrams
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
block-beta
|
block-beta
|
||||||
columns 1
|
columns 1
|
||||||
db(("DB"))
|
db(("DB"))
|
||||||
|
@@ -248,7 +248,7 @@ classE o-- classF : aggregation
|
|||||||
|
|
||||||
Relations can logically represent an N:M association:
|
Relations can logically represent an N:M association:
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
classDiagram
|
classDiagram
|
||||||
Animal <|--|> Zebra
|
Animal <|--|> Zebra
|
||||||
```
|
```
|
||||||
|
@@ -141,7 +141,7 @@ sequenceDiagram
|
|||||||
|
|
||||||
## A commit flow diagram.
|
## A commit flow diagram.
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
gitGraph:
|
gitGraph:
|
||||||
commit "Ashish"
|
commit "Ashish"
|
||||||
branch newbranch
|
branch newbranch
|
||||||
|
@@ -259,7 +259,7 @@ gantt
|
|||||||
|
|
||||||
The compact mode allows you to display multiple tasks in the same row. Compact mode can be enabled for a gantt chart by setting the display mode of the graph via preceding YAML settings.
|
The compact mode allows you to display multiple tasks in the same row. Compact mode can be enabled for a gantt chart by setting the display mode of the graph via preceding YAML settings.
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
---
|
---
|
||||||
displayMode: compact
|
displayMode: compact
|
||||||
---
|
---
|
||||||
|
@@ -442,7 +442,7 @@ sequenceDiagram
|
|||||||
|
|
||||||
Comments can be entered within a sequence diagram, which will be ignored by the parser. Comments need to be on their own line, and must be prefaced with `%%` (double percent signs). Any text after the start of the comment to the next newline will be treated as a comment, including any diagram syntax
|
Comments can be entered within a sequence diagram, which will be ignored by the parser. Comments need to be on their own line, and must be prefaced with `%%` (double percent signs). Any text after the start of the comment to the next newline will be treated as a comment, including any diagram syntax
|
||||||
|
|
||||||
```mermaid
|
```mermaid-example
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
Alice->>John: Hello John, how are you?
|
Alice->>John: Hello John, how are you?
|
||||||
%% this is a comment
|
%% this is a comment
|
||||||
|
Reference in New Issue
Block a user