You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-6Lines changed: 41 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -347,15 +347,50 @@ Using `markdown` component and/or directive, you will be able to use the `mermai
347
347
</markdown>
348
348
```
349
349
350
-
Optionally, you can specify mermaid [configuration options](https://mermaid.js.org/config/schema-docs/config.html#mermaid-config-properties) using `mermaidOptions` property.
350
+
#### Global configuration
351
+
352
+
You can provide a global configuration for mermaid [configuration options](https://mermaid.js.org/config/schema-docs/config.html#mermaid-config-properties) to use across your application with the `mermaidOptions` in the `MarkdownModuleConfig` either with `provideMarkdown` provide-function for standalone components or `MarkdownModule.forRoot()` for module configuration.
353
+
354
+
##### Using the `provideMarkdown` function
355
+
356
+
```typescript
357
+
provideMarkdown({
358
+
mermaidOptions: {
359
+
provide: MERMAID_OPTIONS,
360
+
useValue: {
361
+
darkMode: true,
362
+
look: 'handDrawn',
363
+
...
364
+
},
365
+
},
366
+
}),
367
+
```
368
+
369
+
##### Using the `MarkdownModule` import
370
+
371
+
```typescript
372
+
MarkdownModule.forRoot({
373
+
mermaidOptions: {
374
+
provide: MERMAID_OPTIONS,
375
+
useValue: {
376
+
darkMode: true,
377
+
look: 'handDrawn',
378
+
...
379
+
},
380
+
},
381
+
}),
382
+
```
383
+
384
+
#### Component configuration
385
+
386
+
Additionally, you can specify mermaid [configuration options](https://mermaid.js.org/config/schema-docs/config.html#mermaid-config-properties) on component directly using `mermaidOptions` property.
Optionally, you can specify mermaid [configuration options](https://mermaid.js.org/config/schema-docs/config.html#mermaid-config-properties) using `mermaidOptions` property.
377
+
#### Global configuration
378
378
379
-
**example.component.ts**
379
+
You can provide a global configuration for mermaid [configuration options](https://mermaid.js.org/config/schema-docs/config.html#mermaid-config-properties) to use across your application with the `mermaidOptions` in the `MarkdownModuleConfig` either with `provideMarkdown` provide-function for standalone components or `MarkdownModule.forRoot()` for module configuration.
380
+
381
+
```typescript
382
+
// using the `provideMarkdown` function
383
+
provideMarkdown({
384
+
mermaidOptions: {
385
+
provide: MERMAID_OPTIONS,
386
+
useValue: {
387
+
darkMode: true,
388
+
look: 'handDrawn',
389
+
...
390
+
},
391
+
},
392
+
}),
393
+
394
+
// using the `MarkdownModule` import
395
+
MarkdownModule.forRoot({
396
+
mermaidOptions: {
397
+
provide: MERMAID_OPTIONS,
398
+
useValue: {
399
+
darkMode: true,
400
+
look: 'handDrawn',
401
+
...
402
+
},
403
+
},
404
+
}),
405
+
```
406
+
407
+
#### Component configuration
408
+
409
+
Additionally, you can specify mermaid [configuration options](https://mermaid.js.org/config/schema-docs/config.html#mermaid-config-properties) on component directly using `mermaidOptions` property.
410
+
411
+
**example.component.ts**
380
412
```typescript
381
413
import { MermaidAPI } from 'ngx-markdown';
0 commit comments