Update 8.6.0_docs.md

This commit is contained in:
Neil Cuzon 2020-07-25 21:36:12 -07:00 committed by GitHub
parent 3a93c50e38
commit a5ed3ca446
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,9 +6,14 @@
## [CDN](https://unpkg.com/mermaid/) ## [CDN](https://unpkg.com/mermaid/)
With version 8.6.0 comes the release of directives for mermaid and a new system for configurations, with the aim of establishing centralized, sane defaults and simple implementation. With version 8.6.0 comes the release of directives for mermaid, a new system for modifying configurations, with the aim of establishing centralized, sane defaults and simple implementation.
the init directive is the main method of configuration for Site and Current Levels. `directives` allow for a diagram specific overriding of `config`, as it has been discussed in [Configurations](./Setup.md).
This allows site users to input modifications to `config` alongside diagram definitions, when creating diagrams on a private webpage that supports mermaid.
**A likely application for this is in the creation of diagrams/charts inside company/organizational webpages, that rely on mermaid for diagram and chart rendering.**
the `init` directive is the main method of configuration for Site and Current Levels.
The three levels of are Configuration, Global, Site and Current. The three levels of are Configuration, Global, Site and Current.
@ -35,19 +40,19 @@ The modifiable parts of the Configuration are limited by the secure array, which
Site owners can add to the **secure** array using this command: Site owners can add to the **secure** array using this command:
mermaidAPI.initialize( { startOnLoad: true, secure: ['parameter1', 'parameter2'] } ); mermaidAPI.initialize( { startOnLoad: true, secure: ['parameter1', 'parameter2'] } );
default values for the **secure array** consists of: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']. These default values are immutable. default values for the `secure array` consists of: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']. These default values are immutable.
Implementors can only modify configurations using directives, but cannot change the **secure** array. Implementors can only modify configurations using directives, but cannot change the `secure` array.
# Modifying Configurations and directives: # Modifying Configurations and directives:
The Two types of directives: are “init” or “initialize” and “wrap”. The Two types of directives: are `init` or `initialize` and `wrap`.
**Notes**: All directives are enclosed in `%%{ }%%.` **Notes**: All directives are enclosed in `%%{ }%%.`
Older versions of mermaid will not parse directives because `%%` will comment out the directive. Older versions of mermaid will not parse directives because `%%` will comment out the directive. This makes the update backward compatible.
# 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.
| Parameter | Description |Type | Required | Values| | Parameter | Description |Type | Required | Values|
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |