mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
chore: fix most of aloisklink reviews
This commit is contained in:
30
.github/gh-pages-publish.yml
vendored
30
.github/gh-pages-publish.yml
vendored
@@ -1,30 +0,0 @@
|
|||||||
name: Build and Deploy Docs
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
jobs:
|
|
||||||
build-and-deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout 🛎️
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v2.2.4
|
|
||||||
|
|
||||||
- name: Install deps
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Install and Build 🔧
|
|
||||||
run: |
|
|
||||||
cd ./packages/mermaid
|
|
||||||
pnpm docs:build:vitepress
|
|
||||||
|
|
||||||
- name: Deploy 🚀📕
|
|
||||||
uses: JamesIves/github-pages-deploy-action@v4.3.3
|
|
||||||
with:
|
|
||||||
branch: gh-pages
|
|
||||||
folder: packages/mermaid/src/vitepress/.vitepress/dist
|
|
3
.github/workflows/lint.yml
vendored
3
.github/workflows/lint.yml
vendored
@@ -39,4 +39,5 @@ jobs:
|
|||||||
run: pnpm run lint
|
run: pnpm run lint
|
||||||
|
|
||||||
- name: Verify Docs
|
- name: Verify Docs
|
||||||
run: cd packages/mermaid && pnpm docs:verify
|
working-directory: ./packages/mermaid
|
||||||
|
run: pnpm run docs:verify
|
||||||
|
@@ -72,16 +72,16 @@ flowchart LR
|
|||||||
If you want to preview the whole documentation site on your machine:
|
If you want to preview the whole documentation site on your machine:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ cd mermaid
|
cd mermaid
|
||||||
$ pnpm i
|
pnpm i
|
||||||
$ pnpm docs:dev
|
pnpm docs:dev
|
||||||
```
|
```
|
||||||
|
|
||||||
You can now build and serve the documentation site:
|
You can now build and serve the documentation site:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ pnpm docs:build:vitepress
|
pnpm docs:build:vitepress
|
||||||
$ pnpm docs:serve
|
pnpm docs:serve
|
||||||
```
|
```
|
||||||
|
|
||||||
## Branching
|
## Branching
|
||||||
|
@@ -102,7 +102,6 @@
|
|||||||
"coveralls": "3.1.1",
|
"coveralls": "3.1.1",
|
||||||
"cypress": "10.10.0",
|
"cypress": "10.10.0",
|
||||||
"cypress-image-snapshot": "4.0.1",
|
"cypress-image-snapshot": "4.0.1",
|
||||||
"documentation": "13.2.5",
|
|
||||||
"esbuild": "0.15.12",
|
"esbuild": "0.15.12",
|
||||||
"eslint": "8.25.0",
|
"eslint": "8.25.0",
|
||||||
"eslint-config-prettier": "8.5.0",
|
"eslint-config-prettier": "8.5.0",
|
||||||
|
@@ -104,7 +104,7 @@ function sidebarSyntax() {
|
|||||||
{ text: 'Gantt', link: '/syntax/gantt' },
|
{ text: 'Gantt', link: '/syntax/gantt' },
|
||||||
{ text: 'Pie Chart', link: '/syntax/pie' },
|
{ text: 'Pie Chart', link: '/syntax/pie' },
|
||||||
{ text: 'Requirement Diagram', link: '/syntax/requirementDiagram' },
|
{ text: 'Requirement Diagram', link: '/syntax/requirementDiagram' },
|
||||||
{ text: 'Gitgraph (Git) Diagram 🔥', link: '/syntax/gitGraph' },
|
{ text: 'Gitgraph (Git) Diagram 🔥', link: '/syntax/gitgraph' },
|
||||||
{ text: 'C4C Diagram (Context) Diagram 🦺⚠️', link: '/syntax/c4c' },
|
{ text: 'C4C Diagram (Context) Diagram 🦺⚠️', link: '/syntax/c4c' },
|
||||||
{ text: 'Other Examples', link: '/syntax/examples' },
|
{ text: 'Other Examples', link: '/syntax/examples' },
|
||||||
],
|
],
|
||||||
@@ -120,7 +120,7 @@ function sidebarConfig() {
|
|||||||
items: [
|
items: [
|
||||||
{ text: 'Tutorials', link: '/config/Tutorials' },
|
{ text: 'Tutorials', link: '/config/Tutorials' },
|
||||||
{ text: 'API-Usage', link: '/config/usage' },
|
{ text: 'API-Usage', link: '/config/usage' },
|
||||||
{ text: 'Mermaid API Configuration', link: '/config/setup/modules' },
|
{ text: 'Mermaid API Configuration', link: '/config/setup/README' },
|
||||||
{ text: 'Directives', link: '/config/directives' },
|
{ text: 'Directives', link: '/config/directives' },
|
||||||
{ text: 'Theming', link: '/config/theming' },
|
{ text: 'Theming', link: '/config/theming' },
|
||||||
{ text: 'Accessibility', link: '/config/accessibility' },
|
{ text: 'Accessibility', link: '/config/accessibility' },
|
||||||
@@ -156,7 +156,6 @@ function sidebarCommunity() {
|
|||||||
text: 'Development and Contribution',
|
text: 'Development and Contribution',
|
||||||
link: '/community/development',
|
link: '/community/development',
|
||||||
},
|
},
|
||||||
{ text: 'Changelog', link: '/community/CHANGELOG' },
|
|
||||||
{ text: 'Adding Diagrams', link: '/community/newDiagram' },
|
{ text: 'Adding Diagrams', link: '/community/newDiagram' },
|
||||||
{ text: 'Security', link: '/community/security' },
|
{ text: 'Security', link: '/community/security' },
|
||||||
],
|
],
|
||||||
|
@@ -12,9 +12,69 @@ Renames and re-exports [mermaidAPI](mermaidAPI.md#mermaidapi)
|
|||||||
|
|
||||||
• `Const` **mermaidAPI**: `Readonly`<{ `defaultConfig`: `MermaidConfig` = configApi.defaultConfig; `getConfig`: () => `MermaidConfig` = configApi.getConfig; `getSiteConfig`: () => `MermaidConfig` = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`options`: `MermaidConfig`) => `Promise`<`void`\> ; `parse`: (`text`: `string`, `parseError?`: `ParseErrorFunction`) => `boolean` ; `parseDirective`: (`p`: `any`, `statement`: `string`, `context`: `string`, `type`: `string`) => `void` ; `render`: (`id`: `string`, `text`: `string`, `cb`: (`svgCode`: `string`, `bindFunctions?`: (`element`: `Element`) => `void`) => `void`, `container?`: `Element`) => `Promise`<`void`\> ; `reset`: () => `void` ; `setConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.setConfig; `updateSiteConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.updateSiteConfig }\>
|
• `Const` **mermaidAPI**: `Readonly`<{ `defaultConfig`: `MermaidConfig` = configApi.defaultConfig; `getConfig`: () => `MermaidConfig` = configApi.getConfig; `getSiteConfig`: () => `MermaidConfig` = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`options`: `MermaidConfig`) => `Promise`<`void`\> ; `parse`: (`text`: `string`, `parseError?`: `ParseErrorFunction`) => `boolean` ; `parseDirective`: (`p`: `any`, `statement`: `string`, `context`: `string`, `type`: `string`) => `void` ; `render`: (`id`: `string`, `text`: `string`, `cb`: (`svgCode`: `string`, `bindFunctions?`: (`element`: `Element`) => `void`) => `void`, `container?`: `Element`) => `Promise`<`void`\> ; `reset`: () => `void` ; `setConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.setConfig; `updateSiteConfig`: (`conf`: `MermaidConfig`) => `MermaidConfig` = configApi.updateSiteConfig }\>
|
||||||
|
|
||||||
|
## mermaidAPI configuration defaults
|
||||||
|
|
||||||
|
```ts
|
||||||
|
const config = {
|
||||||
|
theme: 'default',
|
||||||
|
logLevel: 'fatal',
|
||||||
|
securityLevel: 'strict',
|
||||||
|
startOnLoad: true,
|
||||||
|
arrowMarkerAbsolute: false,
|
||||||
|
|
||||||
|
er: {
|
||||||
|
diagramPadding: 20,
|
||||||
|
layoutDirection: 'TB',
|
||||||
|
minEntityWidth: 100,
|
||||||
|
minEntityHeight: 75,
|
||||||
|
entityPadding: 15,
|
||||||
|
stroke: 'gray',
|
||||||
|
fill: 'honeydew',
|
||||||
|
fontSize: 12,
|
||||||
|
useMaxWidth: true,
|
||||||
|
},
|
||||||
|
flowchart: {
|
||||||
|
diagramPadding: 8,
|
||||||
|
htmlLabels: true,
|
||||||
|
curve: 'basis',
|
||||||
|
},
|
||||||
|
sequence: {
|
||||||
|
diagramMarginX: 50,
|
||||||
|
diagramMarginY: 10,
|
||||||
|
actorMargin: 50,
|
||||||
|
width: 150,
|
||||||
|
height: 65,
|
||||||
|
boxMargin: 10,
|
||||||
|
boxTextMargin: 5,
|
||||||
|
noteMargin: 10,
|
||||||
|
messageMargin: 35,
|
||||||
|
messageAlign: 'center',
|
||||||
|
mirrorActors: true,
|
||||||
|
bottomMarginAdj: 1,
|
||||||
|
useMaxWidth: true,
|
||||||
|
rightAngles: false,
|
||||||
|
showSequenceNumbers: false,
|
||||||
|
},
|
||||||
|
gantt: {
|
||||||
|
titleTopMargin: 25,
|
||||||
|
barHeight: 20,
|
||||||
|
barGap: 4,
|
||||||
|
topPadding: 50,
|
||||||
|
leftPadding: 75,
|
||||||
|
gridLineStartPadding: 35,
|
||||||
|
fontSize: 11,
|
||||||
|
fontFamily: '"Open Sans", sans-serif',
|
||||||
|
numberSectionStyles: 4,
|
||||||
|
axisFormat: '%Y-%m-%d',
|
||||||
|
topAxis: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
mermaid.initialize(config);
|
||||||
|
```
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
mermaidAPI.ts:485
|
mermaidAPI.ts:546
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
|
@@ -482,32 +482,10 @@ async function initialize(options: MermaidConfig) {
|
|||||||
addDiagrams();
|
addDiagrams();
|
||||||
}
|
}
|
||||||
|
|
||||||
export const mermaidAPI = Object.freeze({
|
|
||||||
render,
|
|
||||||
parse,
|
|
||||||
parseDirective,
|
|
||||||
initialize,
|
|
||||||
getConfig: configApi.getConfig,
|
|
||||||
setConfig: configApi.setConfig,
|
|
||||||
getSiteConfig: configApi.getSiteConfig,
|
|
||||||
updateSiteConfig: configApi.updateSiteConfig,
|
|
||||||
reset: () => {
|
|
||||||
configApi.reset();
|
|
||||||
},
|
|
||||||
globalReset: () => {
|
|
||||||
configApi.reset(configApi.defaultConfig);
|
|
||||||
},
|
|
||||||
defaultConfig: configApi.defaultConfig,
|
|
||||||
});
|
|
||||||
|
|
||||||
setLogLevel(configApi.getConfig().logLevel);
|
|
||||||
configApi.reset(configApi.getConfig());
|
|
||||||
export default mermaidAPI;
|
|
||||||
/**
|
/**
|
||||||
* ## mermaidAPI configuration defaults
|
* ## mermaidAPI configuration defaults
|
||||||
*
|
*
|
||||||
* ```html
|
* ```ts
|
||||||
* <script>
|
|
||||||
* const config = {
|
* const config = {
|
||||||
* theme: 'default',
|
* theme: 'default',
|
||||||
* logLevel: 'fatal',
|
* logLevel: 'fatal',
|
||||||
@@ -563,6 +541,27 @@ export default mermaidAPI;
|
|||||||
* },
|
* },
|
||||||
* };
|
* };
|
||||||
* mermaid.initialize(config);
|
* mermaid.initialize(config);
|
||||||
* </script>
|
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
export const mermaidAPI = Object.freeze({
|
||||||
|
render,
|
||||||
|
parse,
|
||||||
|
parseDirective,
|
||||||
|
initialize,
|
||||||
|
getConfig: configApi.getConfig,
|
||||||
|
setConfig: configApi.setConfig,
|
||||||
|
getSiteConfig: configApi.getSiteConfig,
|
||||||
|
updateSiteConfig: configApi.updateSiteConfig,
|
||||||
|
reset: () => {
|
||||||
|
configApi.reset();
|
||||||
|
},
|
||||||
|
globalReset: () => {
|
||||||
|
configApi.reset(configApi.defaultConfig);
|
||||||
|
},
|
||||||
|
defaultConfig: configApi.defaultConfig,
|
||||||
|
});
|
||||||
|
|
||||||
|
setLogLevel(configApi.getConfig().logLevel);
|
||||||
|
configApi.reset(configApi.getConfig());
|
||||||
|
|
||||||
|
export default mermaidAPI;
|
||||||
|
2
pnpm-lock.yaml
generated
2
pnpm-lock.yaml
generated
@@ -34,7 +34,6 @@ importers:
|
|||||||
d3: 7.6.1
|
d3: 7.6.1
|
||||||
dagre: 0.8.5
|
dagre: 0.8.5
|
||||||
dagre-d3: 0.6.4
|
dagre-d3: 0.6.4
|
||||||
documentation: 13.2.5
|
|
||||||
dompurify: 2.4.0
|
dompurify: 2.4.0
|
||||||
esbuild: 0.15.12
|
esbuild: 0.15.12
|
||||||
eslint: 8.25.0
|
eslint: 8.25.0
|
||||||
@@ -119,7 +118,6 @@ importers:
|
|||||||
coveralls: 3.1.1
|
coveralls: 3.1.1
|
||||||
cypress: 10.10.0
|
cypress: 10.10.0
|
||||||
cypress-image-snapshot: 4.0.1_i53o2fh6a5o5tv3qlenzwcubc4
|
cypress-image-snapshot: 4.0.1_i53o2fh6a5o5tv3qlenzwcubc4
|
||||||
documentation: 13.2.5
|
|
||||||
esbuild: 0.15.12
|
esbuild: 0.15.12
|
||||||
eslint: 8.25.0
|
eslint: 8.25.0
|
||||||
eslint-config-prettier: 8.5.0_eslint@8.25.0
|
eslint-config-prettier: 8.5.0_eslint@8.25.0
|
||||||
|
Reference in New Issue
Block a user