Skip to content

Commit

Permalink
fix: Documentation for mermaid configuration and note about theme set…
Browse files Browse the repository at this point in the history
…ting via env variable
  • Loading branch information
keonik committed Aug 10, 2023
1 parent 46d6ad5 commit 3973702
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Options
- dark
- neutral

This option does not accept environment variables or other dynamic values. If you want to change the theme dynamically, you can use the `theme` option in the `mermaidConfig` option. See [Mermaid Configuration](#mermaid-configuration) for more information.

### mmdcPath

In order for this generator to succeed you must have `mmdc` installed. This is the mermaid cli tool that is used to generate the ERD. By default the generator searches for an existing binary file at `/node_modules/.bin`. If it fails to find that binary it will run `find ../.. -name mmdc` to search through your folder for a `mmdc` binary. If you are using a different package manager or have a different location for your binary files, you can specify the path to the binary file.
Expand Down Expand Up @@ -202,6 +204,17 @@ generator erd {
}
```

### Mermaid configuration

Overriding the default mermaid configuration may be necessary to represent your schema in the best way possible. There is an example mermaid config [here](./example-mermaid-config.js) that you can use as a starting point. In the example JavaScript file, types are referenced to view all available options. You can also view them [here](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/defaultConfig.ts). The most common use cases for needing to overwrite mermaid configuration is for theming and default sizing of the ERD.

```prisma
generator erd {
provider = "prisma-erd-generator"
mermaidConfig = "mermaidConfig.json"
}
```

### Puppeteer configuration

If you want to change the configuration of Puppeteer, create a [Puppeteer config file (JSON)](https://pptr.dev/guides/configuration#configuration-files) and pass the file path to the generator.
Expand Down

0 comments on commit 3973702

Please sign in to comment.