mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-16 18:54:12 +01:00
chore: more revision fixes
This commit is contained in:
@@ -52,9 +52,10 @@ Implementors can only modify configurations using directives, and cannot change
|
||||
|
||||
The Two types of directives: are `init` (or `initialize`) and `wrap`.
|
||||
|
||||
```note
|
||||
All directives are enclosed in `%%{ }%%`
|
||||
```
|
||||
> **Note**\
|
||||
> All directives are enclosed in `%%{ }%%`
|
||||
>
|
||||
> >
|
||||
|
||||
Older versions of mermaid will not parse directives because `%%` will comment out the directive. This makes the update backwards-compatible.
|
||||
|
||||
@@ -66,18 +67,19 @@ Older versions of mermaid will not parse directives because `%%` will comment ou
|
||||
| --------- | ----------------------- | --------- | -------- | ----------------------------------------------- |
|
||||
| init | modifies configurations | Directive | Optional | Any parameters not included in the secure array |
|
||||
|
||||
```note
|
||||
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 a secure array at a higher level. In the event of a collision, mermaid will give priority to secure arrays and parse the request without changing the values of those parameters in conflict.
|
||||
|
||||
When deployed within code, init is called before the graph/diagram description.
|
||||
```
|
||||
> **Note**\
|
||||
> 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 a secure array at a higher level. In the event of a collision, mermaid will give priority to secure arrays and parse the request without changing the values of those parameters in conflict.
|
||||
>
|
||||
> When deployed within code, init is called before the graph/diagram description.
|
||||
>
|
||||
> >
|
||||
|
||||
**for example**:
|
||||
|
||||
@@ -111,15 +113,16 @@ When deployed within code, init is called before the graph/diagram description.
|
||||
| --------- | ----------------------------- | --------- | -------- | ---------- |
|
||||
| wrap | a callable text-wrap function | Directive | Optional | %%{wrap}%% |
|
||||
|
||||
```note
|
||||
Wrap is a function that is currently only deployable for sequence diagrams.
|
||||
|
||||
`Wrap respects a manually added <br>, so if the user wants to break up their text, they have full control over line breaks by adding <br> tags.`
|
||||
|
||||
It is a non-argument directive and can be executed thusly:
|
||||
|
||||
`%%{wrap}%%` .
|
||||
```
|
||||
> **Note**\
|
||||
> Wrap is a function that is currently only deployable for sequence diagrams.
|
||||
>
|
||||
> `Wrap respects a manually added <br>, so if the user wants to break up their text, they have full control over line breaks by adding <br> tags.`
|
||||
>
|
||||
> It is a non-argument directive and can be executed thusly:
|
||||
>
|
||||
> `%%{wrap}%%` .
|
||||
>
|
||||
> >
|
||||
|
||||
**An example of text wrapping in a sequence diagram**:
|
||||
|
||||
@@ -161,13 +164,14 @@ Example of **object.Assign**:
|
||||
| --------------- | ------------------------------------- | ----------- | --------------------------------------- | ---------- | ---------- |
|
||||
| `setSiteConfig` | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | conf | siteConfig |
|
||||
|
||||
```note
|
||||
Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls to reset() will reset
|
||||
the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig) will reset siteConfig and currentConfig
|
||||
to the defaultConfig
|
||||
Note: currentConfig is set in this function。
|
||||
Default value: will mirror Global Config
|
||||
```
|
||||
> **Note**\
|
||||
> Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls to reset() will reset
|
||||
> the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig) will reset siteConfig and currentConfig
|
||||
> to the defaultConfig
|
||||
> Note: currentConfig is set in this function。
|
||||
> Default value: will mirror Global Config
|
||||
>
|
||||
> >
|
||||
|
||||
## getSiteConfig
|
||||
|
||||
@@ -175,9 +179,10 @@ Default value: will mirror Global Config
|
||||
| --------------- | --------------------------------------------------- | ----------- | ---------------------------------- |
|
||||
| `getSiteConfig` | Returns the current `siteConfig` base configuration | Get Request | Returns Any Values in `siteConfig` |
|
||||
|
||||
```note
|
||||
Returns any values in siteConfig.
|
||||
```
|
||||
> **Note**\
|
||||
> Returns any values in siteConfig.
|
||||
>
|
||||
> >
|
||||
|
||||
## setConfig
|
||||
|
||||
@@ -185,11 +190,12 @@ Returns any values in siteConfig.
|
||||
| ----------- | ------------------------------------------ | ----------- | --------------------------------- | ---------- | ---------------------------------------------- |
|
||||
| `setConfig` | Sets the `currentConfig` to desired values | Put Request | Any Values, those in secure array | conf | `currentConfig` merged with the sanitized conf |
|
||||
|
||||
```note
|
||||
Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure keys. Any
|
||||
values found in conf with key found in siteConfig.secure will be replaced with the corresponding
|
||||
siteConfig value.
|
||||
```
|
||||
> **Note**\
|
||||
> Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure keys. Any
|
||||
> values found in conf with key found in siteConfig.secure will be replaced with the corresponding
|
||||
> siteConfig value.
|
||||
>
|
||||
> >
|
||||
|
||||
## getConfig
|
||||
|
||||
@@ -197,9 +203,10 @@ siteConfig value.
|
||||
| ----------- | --------------------------- | ----------- | ------------------------------- |
|
||||
| `getConfig` | Obtains the `currentConfig` | Get Request | Any Values from `currentConfig` |
|
||||
|
||||
```note
|
||||
Returns any values in currentConfig.
|
||||
```
|
||||
> **Note**\
|
||||
> Returns any values in currentConfig.
|
||||
>
|
||||
> >
|
||||
|
||||
## sanitize
|
||||
|
||||
@@ -207,10 +214,11 @@ Returns any values in currentConfig.
|
||||
| ---------- | ---------------------------------------- | -------------- | ------ |
|
||||
| `sanitize` | Sets the `siteConfig` to desired values. | Put Request(?) | None |
|
||||
|
||||
```note
|
||||
modifies options in-place
|
||||
Ensures options parameter does not attempt to override siteConfig secure keys.
|
||||
```
|
||||
> **Note**\
|
||||
> modifies options in-place
|
||||
> Ensures options parameter does not attempt to override siteConfig secure keys.
|
||||
>
|
||||
> >
|
||||
|
||||
## reset
|
||||
|
||||
@@ -224,8 +232,9 @@ Ensures options parameter does not attempt to override siteConfig secure keys.
|
||||
| --------- | ------------------------------------------------------------ | ---------- | -------- | -------------------------------------------- |
|
||||
| `conf` | base set of values, which `currentConfig` could be reset to. | Dictionary | Required | Any Values, with respect to the secure Array |
|
||||
|
||||
```note
|
||||
default: current siteConfig (optional, default `getSiteConfig()`)
|
||||
```
|
||||
> **Note**\
|
||||
> default: current siteConfig (optional, default `getSiteConfig()`)
|
||||
>
|
||||
> >
|
||||
|
||||
## For more information, read [Setup](setup/README).
|
||||
|
||||
Reference in New Issue
Block a user