From 10bdc8dde609b22d5f169acbe41c8012084b9b3a Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 28 Aug 2024 21:18:52 +0530 Subject: [PATCH] docs: Remove icons docs --- packages/mermaid/src/docs/config/icons.md | 61 ----------------------- 1 file changed, 61 deletions(-) delete mode 100644 packages/mermaid/src/docs/config/icons.md diff --git a/packages/mermaid/src/docs/config/icons.md b/packages/mermaid/src/docs/config/icons.md deleted file mode 100644 index 3d27be623..000000000 --- a/packages/mermaid/src/docs/config/icons.md +++ /dev/null @@ -1,61 +0,0 @@ -# SVG Icons (v+) - -SVG Icons can be used with supported diagrams. Alongside the icon packs included with Mermaid, 3rd party libraries can be included in the configuration to cover additional use-cases. - -## Supported Diagrams - -| Diagram | Usage | -| ------------ | --------------------------------- | -| Architecture | Icon names are surrounded by `()` | - -## Included Icon Packs - -| Icon Pack | Prefix | -| ------------- | ------ | -| default | N/A | -| Amazon AWS | `aws:` | -| Digital Ocean | `do:` | -| GitHub | `gh:` | - -Note that in order to use non-generic icons that are provided with Mermaid, the packs must be explicitly loaded when on initialization initialized. - -```js -import sampleIconPack from 'sample-icon-pack'; - -mermaid.initialize({ - iconLibraries: ['aws:common', 'aws:full', 'github', 'digital-ocean'], -}); -``` - -## Using Custom Icon Packs - -Custom icon packs can be used by including them in the `iconLibraries` array on mermaid initialization. - -```js -import sampleIconPack from 'sample-icon-pack'; - -mermaid.initialize({ - iconLibraries: [sampleIconPack, 'aws:full', ...], -}); -``` - -## Creating Custom Icon Packs - -```js -import { createIcon } from 'mermaid'; -import type { IconLibrary, IconResolver } from 'mermaid'; - -// type IconLibrary = Record; -// createIcon: (icon: string, originalSize: number) => IconResolver -const myIconLibrary: IconLibrary = { - defaultCloudExample: createIcon( - ` - - - `, - 80 - ) -}; - -export default myIconLibrary -```