Update 8.6.0_docs.md

This commit is contained in:
Neil Cuzon 2020-07-09 06:10:07 -07:00 committed by GitHub
parent 629eb4ca90
commit 31027047e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 11 deletions

View File

@ -46,11 +46,20 @@ Older versions of mermaid will not parse directives because %% will comment out
# 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 would be an argument-directive: %%{init: {<argument> }}%%
also note: the json object that is passed as {<argument> } must be valid, quoted json or it will be ignored.
**for example**:
| Parameter | Description |Type | Required | Values|
| --- | --- | --- | --- | --- |
| 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 }}%%
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.
**for example**:
%%{init: {"theme": "default", "logLevel": 1 }}%%
@ -63,10 +72,17 @@ When deployed within code, init is called before the graph/diagram description.
f-->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
| 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 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:
%%{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)
**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:
There are two more functions in the mermaidAPI that can be called by site owners: **reset** and **globalReset**.