Skip to content

Commit 3c3a460

Browse files
committed
Update readme
1 parent ec6c52e commit 3c3a460

File tree

1 file changed

+28
-20
lines changed

1 file changed

+28
-20
lines changed

README.md

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# gatsby-remark-mermaid
22

3-
[![npm](https://img.shields.io/npm/v/gatsby-remark-mermaid.svg?style=flat-square)](https://www.npmjs.com/package/gatsby-remark-mermaid)
3+
[![github actions](https://github.com/remcohaszing/gatsby-remark-mermaid/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/gatsby-remark-mermaid/actions/workflows/ci.yaml)
4+
[![npm](https://img.shields.io/npm/v/gatsby-remark-mermaid.svg)](https://www.npmjs.com/package/gatsby-remark-mermaid)
5+
[![prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
46

57
Create [mermaid](https://mermaidjs.github.io/) graphs and diagrams in your markdown files.
68

79
This plugin uses [remark-mermaidjs](https://github.com/remcohaszing/remark-mermaidjs) to generate
810
SVG diagrams at build time. The mermaid code blocks are replaced with an inline SVG in the generated
911
HTML. This prevents any runtime dependencies on `mermaid.js`.
1012

11-
## Install
13+
## Installation
1214

1315
```sh
1416
npm install gatsby-remark-mermaid gatsby-transformer-remark
@@ -55,18 +57,18 @@ module.exports = {
5557

5658
## Options
5759

58-
The configuration options for this plugin are the same as for `remark-mermaidjs`
59-
[provided here](https://github.com/remcohaszing/remark-mermaidjs#options). However, the table below
60-
describes the configuration details as they apply to Gatsby.
60+
The configuration options for this plugin are the same as for
61+
[`remark-mermaidjs`](https://github.com/remcohaszing/remark-mermaidjs#options).
6162

62-
| Name | Default | Description |
63-
| :------------------------------ | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
64-
| `launchOptions.executablePath` | | (Required) String path to the chrome executable that puppeteer uses to render the mermaid diagrams to SVGs. |
65-
| `mermaidOptions` | `{}` | (Optional) Configuration object for customizing themes, styles, and properties of all mermaid diagrams. See [mermaidAPI configuration options](https://mermaid-js.github.io/mermaid/#/Setup). |
66-
| `mermaidOptions.theme` | `"default"` | (Optional) Name of mermaid theme. Valid options: `'default'`, `'forest'`, `'dark'`, `'neutral'`, `'null'`. See [mermaid themes](https://mermaid-js.github.io/mermaid/#/Setup?id=theme). |
67-
| `mermaidOptions.themeCSS` | `""` | (Optional) Override mermaid styles using `themeCSS`. See [mermaid themes](https://mermaid-js.github.io/mermaid/#/Setup?id=theme). |
68-
| `mermaidOptions.themeVariables` | `{}` | (Optional) Override mermaid variables using `themeVariables`. See [Customizing Themes with themeVariables](https://mermaid-js.github.io/mermaid/#/./theming?id=customizing-themes-with-themevariablesSpecifies).) |
69-
| `svgo.plugins` | `defaultSVGOOptions` | (Optional) Override default optimizations for the generated SVG files. Set to `null` to disable minifying using SVGO completely. See [defaultSVGOOptions](https://github.com/remcohaszing/remark-mermaidjs/blob/v4.0.0/index.ts#L18)).) |
63+
- `launchOptions.executablePath`: String path to the chrome executable that puppeteer uses to render
64+
the mermaid diagrams to SVGs. (Required)
65+
- `mermaidOptions`: Configuration object for customizing themes, styles, and properties of all
66+
mermaid diagrams. See
67+
[mermaidAPI configuration options](https://mermaid-js.github.io/mermaid/#/Setup). (Optional)
68+
- `svgo`: Override default optimizations for the generated SVG files. Set to `false` to disable
69+
minifying using SVGO completely. See
70+
[defaultSVGOOptions](https://github.com/remcohaszing/remark-mermaidjs/blob/v4.0.0/index.ts#L18)).)
71+
(Optional)
7072

7173
**NOTE:** You can use the [Mermaid Live Editor](https://mermaidjs.github.io/mermaid-live-editor) to
7274
preview the theme options described below.
@@ -77,17 +79,23 @@ This plugin processes markdown code blocks set with `mermaid` as the language. I
7779

7880
For example, this mermaid code block:
7981

80-
```mermaid
81-
graph LR
82-
install[Install Plugin]
83-
install --> configure[Configure Plugin]
84-
configure --> draw[Draw Fancy Diagrams]
85-
```
82+
````markdown
83+
```mermaid
84+
graph LR
85+
install[Install Plugin]
86+
install --> configure[Configure Plugin]
87+
configure --> draw[Draw Fancy Diagrams]
88+
```
89+
````
8690

8791
Generates the following SVG image:
8892

8993
![example](https://github.com/remcohaszing/gatsby-remark-mermaid/raw/HEAD/example_graph.png)
9094

91-
### Credits
95+
## Credits
9296

9397
This package was originally developed by [Thomas Biesaart](https://github.com/ChappIO).
98+
99+
## License
100+
101+
[MIT](LICENSE.md) © [Thomas Biesaart](https://github.com/ChappIO)

0 commit comments

Comments
 (0)