From 46346d2a51be0446e8810df796a236d3591ce752 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 23 Mar 2024 15:49:02 +0530 Subject: [PATCH] Remove comment --- docs/config/setup/modules/mermaidAPI.md | 64 +------------------------ packages/mermaid/src/mermaidAPI.ts | 63 +----------------------- 2 files changed, 3 insertions(+), 124 deletions(-) diff --git a/docs/config/setup/modules/mermaidAPI.md b/docs/config/setup/modules/mermaidAPI.md index 1a68b05bd0..5122b123e5 100644 --- a/docs/config/setup/modules/mermaidAPI.md +++ b/docs/config/setup/modules/mermaidAPI.md @@ -34,71 +34,11 @@ Renames and re-exports [mermaidAPI](mermaidAPI.md#mermaidapi) • `Const` **mermaidAPI**: `Readonly`<{ `defaultConfig`: `MermaidConfig` = configApi.defaultConfig; `getConfig`: () => `MermaidConfig` = configApi.getConfig; `getDiagramFromText`: (`text`: `string`, `metadata`: `Pick`<`DiagramMetadata`, `"title"`>) => `Promise`<`Diagram`> ; `getSiteConfig`: () => `MermaidConfig` = configApi.getSiteConfig; `globalReset`: () => `void` ; `initialize`: (`options`: `MermaidConfig`) => `void` ; `parse`: (`text`: `string`, `parseOptions`: [`ParseOptions`](../interfaces/mermaidAPI.ParseOptions.md) & { `suppressErrors`: `true` }) => `Promise`<[`ParseResult`](../interfaces/mermaidAPI.ParseResult.md) | `false`>(`text`: `string`, `parseOptions?`: [`ParseOptions`](../interfaces/mermaidAPI.ParseOptions.md)) => `Promise`<[`ParseResult`](../interfaces/mermaidAPI.ParseResult.md)> ; `render`: (`id`: `string`, `text`: `string`, `svgContainingElement?`: `Element`) => `Promise`<[`RenderResult`](../interfaces/mermaidAPI.RenderResult.md)> ; `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, - suppressErrorRendering: 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, - displayMode: '', - }, -}; -mermaid.initialize(config); -``` +- Use mermaid. instead of mermaid.mermaidAPI. #### Defined in -[mermaidAPI.ts:635](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L635) +[mermaidAPI.ts:574](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L574) ## Functions diff --git a/packages/mermaid/src/mermaidAPI.ts b/packages/mermaid/src/mermaidAPI.ts index 2a01d26245..50e343dd79 100644 --- a/packages/mermaid/src/mermaidAPI.ts +++ b/packages/mermaid/src/mermaidAPI.ts @@ -569,68 +569,7 @@ function addA11yInfo( } /** - * @internal - * ## mermaidAPI configuration defaults - * - * ```ts - * const config = { - * theme: 'default', - * logLevel: 'fatal', - * securityLevel: 'strict', - * startOnLoad: true, - * arrowMarkerAbsolute: false, - * suppressErrorRendering: 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, - * displayMode: '', - * }, - * }; - * mermaid.initialize(config); - * ``` + * @internal - Use mermaid. instead of mermaid.mermaidAPI. */ export const mermaidAPI = Object.freeze({ render,