mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Apply suggestions from code review
Co-authored-by: Alois Klink <alois@aloisklink.com>
This commit is contained in:
parent
c7f7ff39ce
commit
89da6ea31a
@ -27,24 +27,9 @@ export interface Detectors {
|
||||
*
|
||||
* Can be used for third-party custom diagrams.
|
||||
*
|
||||
* For third-party diagrams that are rarely used, we recommend instead setting
|
||||
* the `lazyLoadedDiagrams` param in the Mermaid config, as that will instead
|
||||
* only load the diagram when needed.
|
||||
*
|
||||
* @param id - A unique ID for the given diagram.
|
||||
* @param diagram - The diagram definition.
|
||||
* @param detector - Function that returns `true` if a given mermaid text is this diagram definition.
|
||||
*
|
||||
* @example How to add `@mermaid-js/mermaid-mindmap` to mermaid
|
||||
*
|
||||
* ```js
|
||||
* import {
|
||||
* diagram as mindmap, detector as mindmapDetector, id as mindmapId
|
||||
* } from "@mermaid-js/mermaid-mindmap";
|
||||
* import mermaid from "mermaid";
|
||||
*
|
||||
* mermaid.mermaidAPI.registerDiagram(mindmapId, mindmap, mindmapDetector);
|
||||
* ```
|
||||
*/
|
||||
export const registerDiagram = (
|
||||
id: string,
|
||||
|
Loading…
x
Reference in New Issue
Block a user