diff --git a/.vite/server.ts b/.vite/server.ts
index 50be3908da..c62b6236ab 100644
--- a/.vite/server.ts
+++ b/.vite/server.ts
@@ -12,10 +12,10 @@ async function createServer() {
appType: 'custom', // don't include Vite's default HTML handling middlewares
});
- app.use(vite.middlewares);
app.use(express.static('./packages/mermaid/dist'));
app.use(express.static('./packages/mermaid-example-diagram/dist'));
app.use(express.static('./packages/mermaid-mindmap/dist'));
+ app.use(vite.middlewares);
app.use(express.static('demos'));
app.use(express.static('cypress/platform'));
diff --git a/cypress/platform/knsv.html b/cypress/platform/knsv.html
index 11340c4dbc..d4ffa0c0c7 100644
--- a/cypress/platform/knsv.html
+++ b/cypress/platform/knsv.html
@@ -6,6 +6,10 @@
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
+
+
mindmap
root
+ A
+ B
+ C
+ D
+ E
+ A2
+ B2
+ C2
+ D2
+ E2
child1((Circle))
grandchild 1
grandchild 2
@@ -63,8 +83,10 @@
::icon(mdi mdi-fire)
gc6((grand child 6))
::icon(mdi mdi-fire)
+ gc7((grand grand child 8))
-
+
+
+```
+
+[1]: Setup.md?id=render
+[2]: 8.6.0_docs.md
+[3]: #mermaidapi-configuration-defaults
+[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
+[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
+[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
+[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
+[8]: https://developer.mozilla.org/docs/Web/API/Element
diff --git a/vdocs/config/Tutorials.md b/vdocs/config/Tutorials.md
new file mode 100644
index 0000000000..bfaa4facf9
--- /dev/null
+++ b/vdocs/config/Tutorials.md
@@ -0,0 +1,72 @@
+# Tutorials
+
+This is list of publicly available Tutorials for using Mermaid.JS . This is intended as a basic introduction for the use of the Live Editor for generating diagrams, and deploying Mermaid.JS through HTML.
+
+**Note that these tutorials might display an older interface, but the usage of the live-editor will largely be the same.**
+
+For most purposes, you can use the [Live Editor](https://mermaid-js.github.io/mermaid-live-editor), to quickly and easily render a diagram.
+
+## Live-Editor Tutorials
+
+The definitions that can be generated the Live-Editor are also backwards-compatible as of version 8.7.0.
+
+[Chris Chinchilla: Hands on - Text-based diagrams with Mermaid](https://www.youtube.com/watch?v=4_LdV1cs2sA)
+
+[GitLab Unfiltered: How to Create Mermaid Diagrams](https://www.youtube.com/watch?v=SQ9QmuTHuSI&t=438s)
+
+[GitLab Unfiltered: Emilie adds a mermaid diagram to the handbook](https://www.youtube.com/watch?v=5RQqht3NNSE)
+
+[World of Zero: I Learn How To Build Flowcharts and Signal Diagram's in Mermaid.JS](https://www.youtube.com/watch?v=7_2IroEs6Is&t=207s)
+
+[Eddie Jaoude: Can you code your diagrams?](https://www.youtube.com/watch?v=9HZzKkAqrX8)
+
+## Mermaid with HTML
+
+Examples are provided in [Getting Started](../intro/n00b-gettingStarted)
+
+**CodePen Examples:**
+
+https://codepen.io/CarlBoneri/pen/BQwZzq
+
+https://codepen.io/tdkn/pen/vZxQzd
+
+https://codepen.io/janzeteachesit/pen/OWWZKN
+
+## Mermaid with Text Area
+
+https://codepen.io/Ryuno-Ki/pen/LNxwgR
+
+## Mermaid in open source docs
+
+[K8s.io Diagram Guide](https://kubernetes.io/docs/contribute/style/diagram-guide/)
+
+[K8s.dev blog: Improve your documentation with Mermaid.js diagrams](https://www.kubernetes.dev/blog/2021/12/01/improve-your-documentation-with-mermaid.js-diagrams/)
+
+## Jupyter Integration with mermaid-js
+
+Here's an example of Python integration with mermaid-js which uses the mermaid.ink service, that displays the graph in a Jupyter notebook.
+
+```python
+import base64
+from IPython.display import Image, display
+import matplotlib.pyplot as plt
+
+def mm(graph):
+ graphbytes = graph.encode("ascii")
+ base64_bytes = base64.b64encode(graphbytes)
+ base64_string = base64_bytes.decode("ascii")
+ display(Image(url="https://mermaid.ink/img/" + base64_string))
+
+mm("""
+graph LR;
+ A--> B & C & D;
+ B--> A & E;
+ C--> A & E;
+ D--> A & E;
+ E--> B & C & D;
+""")
+```
+
+**Output**
+
+![Example graph of the Python integration](img/python-mermaid-integration.png)
diff --git a/vdocs/config/accessibility.md b/vdocs/config/accessibility.md
new file mode 100644
index 0000000000..387871de42
--- /dev/null
+++ b/vdocs/config/accessibility.md
@@ -0,0 +1,208 @@
+# Accessibility Options
+
+## Accessibility
+
+Now with Mermaid library in much wider use, we have started to work towards more accessible features, based on the feedback from the community.
+
+To begin with, we have added a new feature to Mermaid library, which is to support accessibility options, **Accessibility Title** and **Accessibility Description**.
+
+This support for accessibility options is available for all the diagrams/chart types. Also, we have tired to keep the same format for the accessibility options, so that it is easy to understand and maintain.
+
+## Defining Accessibility Options
+
+### Single line accessibility values
+
+The diagram authors can now add the accessibility options in the diagram definition, using the `accTitle` and `accDescr` keywords, where each keyword is followed by `:` and the string value for title and description like:
+
+- `accTitle: "Your Accessibility Title"` or
+- `accDescr: "Your Accessibility Description"`
+
+**When these two options are defined, they will add a coressponding `
` and `` tag in the SVG.**
+
+Let us take a look at the following example with a flowchart diagram:
+
+```mermaid-example
+ graph LR
+ accTitle: Big decisions
+ accDescr: Flow chart of the decision making process
+ A[Hard] -->|Text| B(Round)
+ B --> C{Decision}
+ C -->|One| D[Result 1]
+
+```
+
+See in the code snippet above, the `accTitle` and `accDescr` are defined in the diagram definition. They result in the following tags in SVG code:
+
+![Accessibility options rendered inside SVG](img/accessibility-div-example.png)
+
+### Multi-line Accessibility title/description
+
+You can also define the accessibility options in a multi-line format, where the keyword is followed by opening curly bracket `{` and then multiple lines, followed by a closing `}`.
+
+`accTitle: My single line title value` (**_single line format_**)
+
+vs
+
+`accDescr: { My multi-line description of the diagram }` (**_multi-line format_**)
+
+Let us look at it in the following example, with same flowchart:
+
+```mermaid-example
+ graph LR
+ accTitle: Big decisions
+
+ accDescr {
+ My multi-line description
+ of the diagram
+ }
+
+ A[Hard] -->|Text| B(Round)
+ B --> C{Decision}
+ C -->|One| D[Result 1]
+
+```
+
+See in the code snippet above, the `accTitle` and `accDescr` are defined in the diagram definition. They result in the following tags in SVG code:
+
+![Accessibility options rendered inside SVG](img/accessibility-div-example-2.png)
+
+### Sample Code Snippet for other diagram types
+
+#### Sequence Diagram
+
+```mermaid-example
+ sequenceDiagram
+ accTitle: My Sequence Diagram
+ accDescr: My Sequence Diagram Description
+
+ Alice->>John: Hello John, how are you?
+ John-->>Alice: Great!
+ Alice-)John: See you later!
+```
+
+#### Class Diagram
+
+```mermaid-example
+ classDiagram
+ accTitle: My Class Diagram
+ accDescr: My Class Diagram Description
+
+ Vehicle <|-- Car
+```
+
+#### State Diagram
+
+```mermaid-example
+ stateDiagram
+ accTitle: My State Diagram
+ accDescr: My State Diagram Description
+
+ s1 --> s2
+
+```
+
+#### Entity Relationship Diagram
+
+```mermaid-example
+ erDiagram
+ accTitle: My Entity Relationship Diagram
+ accDescr: My Entity Relationship Diagram Description
+
+ CUSTOMER ||--o{ ORDER : places
+ ORDER ||--|{ LINE-ITEM : contains
+ CUSTOMER }|..|{ DELIVERY-ADDRESS : uses
+
+```
+
+#### User Journey Diagram
+
+```mermaid-example
+ journey
+ accTitle: My User Journey Diagram
+ accDescr: My User Journey Diagram Description
+
+ title My working day
+ section Go to work
+ Make tea: 5: Me
+ Go upstairs: 3: Me
+ Do work: 1: Me, Cat
+ section Go home
+ Go downstairs: 5: Me
+ Sit down: 5: Me
+
+```
+
+#### Gantt Chart
+
+```mermaid-example
+ gantt
+ accTitle: My Gantt Chart Accessibility Title
+ accDescr: My Gantt Chart Accessibility Description
+
+ title A Gantt Diagram
+ dateFormat YYYY-MM-DD
+ section Section
+ A task :a1, 2014-01-01, 30d
+ Another task :after a1 , 20d
+ section Another
+ Task in sec :2014-01-12 , 12d
+ another task : 24d
+
+```
+
+#### Pie Chart
+
+```mermaid-example
+ pie
+ accTitle: My Pie Chart Accessibility Title
+ accDescr: My Pie Chart Accessibility Description
+
+ title Key elements in Product X
+ "Calcium" : 42.96
+ "Potassium" : 50.05
+ "Magnesium" : 10.01
+ "Iron" : 5
+
+```
+
+#### Requirement Diagram
+
+```mermaid-example
+ requirementDiagram
+ accTitle: My Requirement Diagram
+ accDescr: My Requirement Diagram Description
+
+ requirement test_req {
+ id: 1
+ text: the test text.
+ risk: high
+ verifymethod: test
+ }
+
+ element test_entity {
+ type: simulation
+ }
+
+ test_entity - satisfies -> test_req
+
+```
+
+#### Gitgraph
+
+```mermaid-example
+ gitGraph
+ accTitle: My Gitgraph Accessibility Title
+ accDescr: My Gitgraph Accessibility Description
+
+ commit
+ commit
+ branch develop
+ checkout develop
+ commit
+ commit
+ checkout main
+ merge develop
+ commit
+ commit
+
+```
diff --git a/vdocs/config/directives.md b/vdocs/config/directives.md
new file mode 100644
index 0000000000..9060afdcfc
--- /dev/null
+++ b/vdocs/config/directives.md
@@ -0,0 +1,255 @@
+# Directives
+
+## Directives
+
+Directives gives a diagram author the capability to alter the appearance of a diagram before rendering by changing the applied configuration.
+
+The significance of having directives is that you have them available while writing the diagram, and can modify the default global and diagram specific configurations. So, directives are applied on top of the default configurations. The beauty of directives is that you can use them to alter configuration settings for a specific diagram, i.e. at an individual level.
+
+While directives allow you to change most of the default configuration settings, there are some that are not available, that too for security reasons. Also, you do have the _option to define the set of configurations_ that you would allow to be available to the diagram author for overriding with help of directives.
+
+## Types of Directives options
+
+Mermaid basically supports two types of configuration options to be overridden by directives.
+
+1. _General/Top Level configurations_ : These are the configurations that are available and applied to all the diagram. **Some of the most important top-level** configurations are:
+
+- theme
+- fontFamily
+- logLevel
+- securityLevel
+- startOnLoad
+- secure
+
+2. _Diagram specific configurations_ : These are the configurations that are available and applied to a specific diagram. For each diagram there are specific configuration that will alter how that particular diagram looks and behaves.
+ For example, `mirrorActors` is a configuration that is specific to the `SequenceDiagram` and alter whether the actors are mirrored or not. So this config is available only for the `SequenceDiagram` type.
+
+**NOTE:** These options listed here are not all the configuration options. To get hold of all the configuration options, please refer to the [defaultConfig.js](https://github.com/mermaid-js/mermaid/blob/develop/src/defaultConfig.js) in the source code.
+
+```
+Soon we plan to publish a complete list of top-level configurations & all the diagram specific configurations, with their possible values in the docs
+```
+
+## Declaring directives
+
+Now that we have defined the types of configurations that are available, we can learn how to declare directives.
+A directive always starts and end `%%` sign with directive text in between, like `%% {directive_text} %%`.
+
+Here the structure of a directive text is like a nested key-value pair map or a JSON object with root being _init_. Where all the general configurations are defined in the top level, and all the diagram specific configurations are defined one level deeper with diagram type as key/root for that section.
+
+Following code snippet shows the structure of a directive:
+
+```
+%%{
+ init: {
+ "theme": "dark",
+ "fontFamily": "monospace",
+ "logLevel": "info",
+ "flowchart": {
+ "htmlLabels": true,
+ "curve": "linear"
+ },
+ "sequence": {
+ "mirrorActors": true
+ }
+ }
+}%%
+```
+
+You can also define the directives in a single line, like this:
+
+```
+%%{init: { **insert argument here**}}%%
+```
+
+For example, the following code snippet:
+
+```
+%%{init: { "sequence": { "mirrorActors":false }}}%%
+```
+
+**Notes:**
+The json object that is passed as {**argument** } must be valid key value pairs and encased in quotation marks or it will be ignored.
+Valid Key Value pairs can be found in config.
+
+Example with a simple graph:
+
+```mermaid-example
+%%{init: { 'logLevel': 'debug', 'theme': 'dark' } }%%
+graph LR
+A-->B
+```
+
+Here the directive declaration will set the `logLevel` to `debug` and the `theme` to `dark` for a rendered mermaid diagram, changing the appearance of the diagram itself.
+
+Note: You can use 'init' or 'initialize' as both acceptable as init directives. Also note that `%%init%%` and `%%initialize%%` directives will be grouped together after they are parsed. This means:
+
+```mmd
+%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%%
+%%{initialize: { 'logLevel': 'fatal', "theme":'dark', 'startOnLoad': true } }%%
+...
+```
+
+parsing the above generates a single `%%init%%` JSON object below, combining the two directives and carrying over the last value given for `loglevel`:
+
+```json
+{
+ "logLevel": "fatal",
+ "theme": "dark",
+ "startOnLoad": true
+}
+```
+
+This will then be sent to `mermaid.initialize(...)` for rendering.
+
+## Directive Examples
+
+More directive examples for diagram specific configuration overrides
+Now that the concept of directives has been explained, Let us see some more examples for directives usage:
+
+### Changing Theme via directive
+
+The following code snippet changes theme to forest:
+
+`%%{init: { "theme": "forest" } }%%`
+
+Possible themes value are: `default`,`base`, `dark`, `forest` and `neutral`.
+Default Value is `default`.
+
+Example:
+
+```mermaid-example
+%%{init: { "theme": "forest" } }%%
+graph TD
+A(Forest) --> B[/Another/]
+A --> C[End]
+ subgraph section
+ B
+ C
+ end
+
+```
+
+### Changing fontFamily via directive
+
+The following code snippet changes fontFamily to rebuchet MS, Verdana, Arial, Sans-Serif:
+
+`%%{init: { "fontFamily": "Trebuchet MS, Verdana, Arial, Sans-Serif" } }%%`
+
+Example:
+
+```mermaid-example
+%%{init: { "fontFamily": "Trebuchet MS, Verdana, Arial, Sans-Serif" } }%%
+graph TD
+A(Forest) --> B[/Another/]
+A --> C[End]
+ subgraph section
+ B
+ C
+ end
+
+```
+
+### Changing logLevel via directive
+
+The following code snippet changes logLevel to 2:
+
+`%%{init: { "logLevel": 2 } }%%`
+
+Possible logLevel values are:
+
+- `1` for _debug_,
+- `2` for _info_
+- `3` for _warn_
+- `4` for _error_
+- `5` for _only fatal errors_
+
+Default Value is `5`.
+
+Example:
+
+```mermaid-example
+%%{init: { "logLevel": 2 } }%%
+graph TD
+A(Forest) --> B[/Another/]
+A --> C[End]
+ subgraph section
+ B
+ C
+ end
+```
+
+### Changing flowchart config via directive
+
+Some common flowchart configurations are:
+
+- _htmlLabels_: true/false
+- _curve_: linear/curve
+- _diagramPadding_: number
+- _useMaxWidth_: number
+
+For complete list of flowchart configurations, see [defaultConfig.js](https://github.com/mermaid-js/mermaid/blob/develop/src/defaultConfig.js) in the source code.
+_Soon we plan to publish a complete list all diagram specific configurations updated in the docs_
+
+The following code snippet changes flowchart config:
+
+`%%{init: { "flowchart": { "htmlLabels": true, "curve": "linear" } } }%%`
+
+Here were are overriding only the flowchart config, and not the general config, where HtmlLabels is set to true and curve is set to linear.
+
+```mermaid-example
+%%{init: { "flowchart": { "htmlLabels": true, "curve": "linear" } } }%%
+graph TD
+A(Forest) --> B[/Another/]
+A --> C[End]
+ subgraph section
+ B
+ C
+ end
+```
+
+### Changing Sequence diagram config via directive
+
+Some common sequence configurations are:
+
+- _width_: number
+- _height_: number
+- _messageAlign_: left, center, right
+- _mirrorActors_: boolean
+- _useMaxWidth_: boolean
+- _rightAngles_: boolean
+- _showSequenceNumbers_: boolean
+- _wrap_: boolean
+
+For complete list of sequence diagram configurations, see _defaultConfig.js_ in the source code.
+_Soon we plan to publish a complete list all diagram specific configurations updated in the docs_
+
+So, `wrap` by default has a value of `false` for sequence diagrams.
+
+Let us see an example:
+
+```mermaid-example
+sequenceDiagram
+
+Alice->Bob: Hello Bob, how are you?
+Bob->Alice: Fine, How did you mother like the book I suggested? And did you catch with the new book about alien invasion?
+Alice->Bob: Good.
+Bob->Alice: Cool
+```
+
+Now let us enable wrap for sequence diagrams.
+
+The following code snippet changes sequence diagram config for `wrap` to `true`:
+
+`%%{init: { "sequence": { "wrap": true} } }%%`
+
+Using in the diagram above, the wrap will be enabled.
+
+```mermaid-example
+%%{init: { "sequence": { "wrap": true, "width":300 } } }%%
+sequenceDiagram
+Alice->Bob: Hello Bob, how are you?
+Bob->Alice: Fine, How did you mother like the book I suggested? And did you catch with the new book about alien invasion?
+Alice->Bob: Good.
+Bob->Alice: Cool
+```
diff --git a/vdocs/config/img/accessibility-div-example-2.png b/vdocs/config/img/accessibility-div-example-2.png
new file mode 100644
index 0000000000..b257edbd03
Binary files /dev/null and b/vdocs/config/img/accessibility-div-example-2.png differ
diff --git a/vdocs/config/img/accessibility-div-example.png b/vdocs/config/img/accessibility-div-example.png
new file mode 100644
index 0000000000..2b3478f0bd
Binary files /dev/null and b/vdocs/config/img/accessibility-div-example.png differ
diff --git a/vdocs/config/img/assignWithDepth.png b/vdocs/config/img/assignWithDepth.png
new file mode 100644
index 0000000000..d00e8eb7c9
Binary files /dev/null and b/vdocs/config/img/assignWithDepth.png differ
diff --git a/vdocs/config/img/object.assign without depth.png b/vdocs/config/img/object.assign without depth.png
new file mode 100644
index 0000000000..c87505c1c1
Binary files /dev/null and b/vdocs/config/img/object.assign without depth.png differ
diff --git a/vdocs/config/img/python-mermaid-integration.png b/vdocs/config/img/python-mermaid-integration.png
new file mode 100644
index 0000000000..d54a0e97d5
Binary files /dev/null and b/vdocs/config/img/python-mermaid-integration.png differ
diff --git a/vdocs/config/img/wrapped text.png b/vdocs/config/img/wrapped text.png
new file mode 100644
index 0000000000..cf8dd12386
Binary files /dev/null and b/vdocs/config/img/wrapped text.png differ
diff --git a/vdocs/config/mermaidCLI.md b/vdocs/config/mermaidCLI.md
new file mode 100644
index 0000000000..f9473f1dd3
--- /dev/null
+++ b/vdocs/config/mermaidCLI.md
@@ -0,0 +1,3 @@
+# mermaid CLI
+
+mermaid CLI has been moved to [mermaid-cli](https://github.com/mermaid-js/mermaid-cli). Please read its documentation instead.
diff --git a/vdocs/config/n00b-advanced.md b/vdocs/config/n00b-advanced.md
new file mode 100644
index 0000000000..1e6546f5cf
--- /dev/null
+++ b/vdocs/config/n00b-advanced.md
@@ -0,0 +1,24 @@
+# Advanced n00b mermaid (Coming soon..)
+
+## splitting mermaid code from html
+
+A more condensed html code can be achieved by embedding the mermaid code in its own .js file, which is referenced like so:
+
+```
+stuff stuff
+
+