Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed May 6, 2023
1 parent 62fa0ef commit 2d91338
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 23 deletions.
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ using [playwright](https://playwright.dev).

- [Installation](#installation)
- [Usage](#usage)
- [Options](#options)
- [API](#api)
- [`unified().use(remarkMermaid, options?)`](#unifieduseremarkmermaid-options)
- [`browser`](#browser)
- [`css`](#css)
- [`errorFallback`](#errorfallback)
- [`launchOptions`](#launchoptions)
- [`mermaidOptions`](#mermaidoptions)
- [`prefix`](#prefix)
- [Compatibility](#compatibility)
- [Related Projects](#related-projects)
- [Contributing](#contributing)
- [License](#license)

## Installation
Expand Down Expand Up @@ -60,7 +63,7 @@ const { value } = await remark()
console.log(value);
```

### Options
## API

This package has a default export `remarkMermaid`.

Expand Down Expand Up @@ -101,6 +104,25 @@ use this in a browser, call `mermaid.initialize()` manually.

A custom prefix to use for Mermaid IDs. (`string`, default: `mermaid`)

## Compatibility

This project is compatible with Node.js 16 or greater.

## Related Projects

- [`mermaid`](https://mermaid.js.org) is the library that’s used to render the diagrams.
- [`mermaid-isomorphic`](https://github.com/remcohaszing/mermaid-isomorphic) allows this package to
render Mermaid diagrams in both Node.js and the browser.
- [`rehype-mermaidjs`](https://github.com/remcohaszing/rehype-mermaidjs) is a more powerful plugin
that does the same, but as a [rehype](https://github.com/rehypejs/rehype) plugin.

## Contributing

Test fixtures are generated and verified using Linux. Rendering on other platforms may yield
slightly different results. Don’t worry about adding new fixtures, but don’t update existing ones
that cause CI to fail. Furthermore see my global
[contributing guidelines](https://github.com/remcohaszing/.github/blob/main/CONTRIBUTING.md).

## License

[MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing)
40 changes: 19 additions & 21 deletions test/test.ts-snapshots/error-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@

This is an invalid diagram

```
input.md
input.md

UnknownDiagramError: No diagram type detected matching given configuration for text: invalid
UnknownDiagramError: No diagram type detected matching given configuration for text: invalid

{
"type": "code",
"lang": "mermaid",
"meta": null,
"value": "invalid",
"position": {
"start": {
"line": 5,
"column": 1,
"offset": 37
},
"end": {
"line": 7,
"column": 4,
"offset": 59
{
"type": "code",
"lang": "mermaid",
"meta": null,
"value": "invalid",
"position": {
"start": {
"line": 5,
"column": 1,
"offset": 37
},
"end": {
"line": 7,
"column": 4,
"offset": 59
}
}
}
}
}
```

More content

0 comments on commit 2d91338

Please sign in to comment.