Skip to content

Commit 3bef767

Browse files
committed
Rename to rehype-mermaid
1 parent 2fd0da0 commit 3bef767

File tree

5 files changed

+24
-19
lines changed

5 files changed

+24
-19
lines changed

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# rehype-mermaidjs
1+
# rehype-mermaid
22

3-
[![github actions](https://github.com/remcohaszing/rehype-mermaidjs/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/rehype-mermaidjs/actions/workflows/ci.yaml)
4-
[![codecov](https://codecov.io/gh/remcohaszing/rehype-mermaidjs/branch/main/graph/badge.svg)](https://codecov.io/gh/remcohaszing/rehype-mermaidjs)
5-
[![npm version](https://img.shields.io/npm/v/rehype-mermaidjs)](https://www.npmjs.com/package/rehype-mermaidjs)
6-
[![npm downloads](https://img.shields.io/npm/dm/rehype-mermaidjs)](https://www.npmjs.com/package/rehype-mermaidjs)
3+
[![github actions](https://github.com/remcohaszing/rehype-mermaid/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/rehype-mermaid/actions/workflows/ci.yaml)
4+
[![codecov](https://codecov.io/gh/remcohaszing/rehype-mermaid/branch/main/graph/badge.svg)](https://codecov.io/gh/remcohaszing/rehype-mermaid)
5+
[![npm version](https://img.shields.io/npm/v/rehype-mermaid)](https://www.npmjs.com/package/rehype-mermaid)
6+
[![npm downloads](https://img.shields.io/npm/dm/rehype-mermaid)](https://www.npmjs.com/package/rehype-mermaid)
77

88
A [rehype](https://rehype.js.org) plugin to render [mermaid](https://mermaid-js.github.io) diagrams.
99

@@ -28,12 +28,13 @@ A [rehype](https://rehype.js.org) plugin to render [mermaid](https://mermaid-js.
2828
- [Compatibility](#compatibility)
2929
- [Related Projects](#related-projects)
3030
- [Contributing](#contributing)
31+
- [Acknowledgements](#acknowledgements)
3132
- [License](#license)
3233

3334
## Installation
3435

3536
```sh
36-
npm install rehype-mermaidjs
37+
npm install rehype-mermaid
3738
```
3839

3940
In Node.js this package uses [playwright](https://playwright.dev) under the hood. To use it, you may
@@ -88,7 +89,7 @@ The following script:
8889
import { readFile } from 'node:fs/promises'
8990

9091
import { rehype } from 'rehype'
91-
import rehypeMermaid from 'rehype-mermaidjs'
92+
import rehypeMermaid from 'rehype-mermaid'
9293

9394
const { value } = await rehype()
9495
.use(rehypeMermaid, {
@@ -267,6 +268,10 @@ slightly different results. Don’t worry about adding new fixtures, but don’t
267268
that cause CI to fail. Furthermore see my global
268269
[contributing guidelines](https://github.com/remcohaszing/.github/blob/main/CONTRIBUTING.md).
269270

271+
## Acknowledgements
272+
273+
Thanks to [@bitekong](https://github.com/bitekong) for giving me the npm package name.
274+
270275
## License
271276

272277
[MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing)

index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,12 @@ const rehypeMermaid: Plugin<[RehypeMermaidOptions?], Root> = (options) => {
239239
replacement = options.errorFallback(node, diagram, result.reason, file)
240240
} else {
241241
const message = file.message(result.reason, {
242-
ruleId: 'rehype-mermaidjs',
243-
source: 'rehype-mermaidjs',
242+
ruleId: 'rehype-mermaid',
243+
source: 'rehype-mermaid',
244244
ancestors
245245
})
246246
message.fatal = true
247-
message.url = 'https://github.com/remcohaszing/rehype-mermaidjs'
247+
message.url = 'https://github.com/remcohaszing/rehype-mermaid'
248248
throw message
249249
}
250250

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "rehype-mermaidjs",
2+
"name": "rehype-mermaid",
33
"version": "2.0.0",
44
"description": "A rehype plugin to render mermaid diagrams",
55
"exports": "./index.js",
@@ -14,9 +14,9 @@
1414
},
1515
"author": "Remco Haszing <[email protected]>",
1616
"license": "MIT",
17-
"repository": "remcohaszing/rehype-mermaidjs",
18-
"bugs": "https://github.com/remcohaszing/rehype-mermaidjs/issues",
19-
"homepage": "https://github.com/remcohaszing/rehype-mermaidjs#readme",
17+
"repository": "remcohaszing/rehype-mermaid",
18+
"bugs": "https://github.com/remcohaszing/rehype-mermaid/issues",
19+
"homepage": "https://github.com/remcohaszing/rehype-mermaid#readme",
2020
"funding": "https://github.com/sponsors/remcohaszing",
2121
"keywords": [
2222
"documentation",

test/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ test('invalid diagram unhandled', async () => {
106106
() => processor.process('<pre class="mermaid">This is not a valid diagram</pre>'),
107107
(error) => {
108108
assert(error instanceof VFileMessage)
109-
assert.equal(error.source, 'rehype-mermaidjs')
110-
assert.equal(error.ruleId, 'rehype-mermaidjs')
109+
assert.equal(error.source, 'rehype-mermaid')
110+
assert.equal(error.ruleId, 'rehype-mermaid')
111111
assert.equal(
112112
error.reason,
113113
'No diagram type detected matching given configuration for text: This is not a valid diagram'
@@ -116,7 +116,7 @@ test('invalid diagram unhandled', async () => {
116116
start: { line: 1, column: 1, offset: 0 },
117117
end: { line: 1, column: 55, offset: 54 }
118118
})
119-
assert.equal(error.url, 'https://github.com/remcohaszing/rehype-mermaidjs')
119+
assert.equal(error.url, 'https://github.com/remcohaszing/rehype-mermaid')
120120
const root = error.ancestors![0] as Root
121121
const html = root.children[0] as Element
122122
const body = html.children[1] as Element

0 commit comments

Comments
 (0)