mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Update 8.6.0_docs.md
This commit is contained in:
parent
629eb4ca90
commit
31027047e3
@ -46,11 +46,20 @@ Older versions of mermaid will not parse directives because %% will comment out
|
|||||||
# Init
|
# Init
|
||||||
init, or initialize: the init or initialize directive gives the user the ability to overwrite and change the values for configuration parameters, with respect to the secure array that is in effect.
|
init, or initialize: the init or initialize directive gives the user the ability to overwrite and change the values for configuration parameters, with respect to the secure array that is in effect.
|
||||||
|
|
||||||
init would be an argument-directive: %%{init: {<argument> }}%%
|
| Parameter | Description |Type | Required | Values|
|
||||||
also note: the json object that is passed as {<argument> } must be valid, quoted json or it will be ignored.
|
| --- | --- | --- | --- | --- |
|
||||||
**for example**:
|
| init | modifies configurations| Directive| Optional | Any parameters not included in the secure array|
|
||||||
|
|
||||||
|
**Notes:**
|
||||||
|
|
||||||
|
init would be an argument-directive: %%{init: { **insert argument here**}}%%
|
||||||
|
|
||||||
|
The json object that is passed as {**argument** } must be valid, quoted json or it will be ignored.
|
||||||
|
**for example**:
|
||||||
%%{init: {"theme": default, "logLevel": 1 }}%%
|
%%{init: {"theme": default, "logLevel": 1 }}%%
|
||||||
|
|
||||||
|
Configurations that are passed through init cannot change the parameters in secure arrays of higher levels. In the event of a conflict, mermaid will give priority to secure arrays and parse the request, without changing the values of the parameters in conflict.
|
||||||
|
|
||||||
When deployed within code, init is called before the graph/diagram description.
|
When deployed within code, init is called before the graph/diagram description.
|
||||||
**for example**:
|
**for example**:
|
||||||
%%{init: {"theme": "default", "logLevel": 1 }}%%
|
%%{init: {"theme": "default", "logLevel": 1 }}%%
|
||||||
@ -63,10 +72,17 @@ When deployed within code, init is called before the graph/diagram description.
|
|||||||
f-->g
|
f-->g
|
||||||
g-->
|
g-->
|
||||||
|
|
||||||
**Notes**: Configurations that are passed through init cannot change the parameters in secure arrays of higher levels. In the event of a conflict, mermaid will give priority to secure arrays and parse the request, without changing the values of the parameters in conflict.
|
|
||||||
|
|
||||||
# Wrap
|
# Wrap
|
||||||
|
| Parameter | Description |Type | Required | Values|
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| wrap | a callable text-wrap function| Directive| Optional | %%{wrap}%%|
|
||||||
|
|
||||||
|
**Notes:**
|
||||||
|
|
||||||
Wrap is a function that is currently only deployable for sequence diagrams.
|
Wrap is a function that is currently only deployable for sequence diagrams.
|
||||||
|
|
||||||
|
wrap respects manually added <br\> so if the user wants to break up their text, they have full control over those breaks by adding their own <br\> tags.
|
||||||
|
|
||||||
It is a non-argument directive and can be executed thusly:
|
It is a non-argument directive and can be executed thusly:
|
||||||
|
|
||||||
%%{wrap}%%.
|
%%{wrap}%%.
|
||||||
@ -76,12 +92,6 @@ It is a non-argument directive and can be executed thusly:
|
|||||||
![Image showing wrapped text](https://github.com/NeilCuzon/mermaid/blob/develop/docs/img/wrapped%20text.png)
|
![Image showing wrapped text](https://github.com/NeilCuzon/mermaid/blob/develop/docs/img/wrapped%20text.png)
|
||||||
|
|
||||||
|
|
||||||
**Notes**:
|
|
||||||
wrap respects manually added <br\> so if the user wants to break up their text, they have full control over those breaks by adding their own <br\> tags.
|
|
||||||
|
|
||||||
as of now, wrap is only usable in sequence diagrams.
|
|
||||||
|
|
||||||
|
|
||||||
# Resetting Configurations:
|
# Resetting Configurations:
|
||||||
There are two more functions in the mermaidAPI that can be called by site owners: **reset** and **globalReset**.
|
There are two more functions in the mermaidAPI that can be called by site owners: **reset** and **globalReset**.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user