Skip to content

Commit

Permalink
Update to mermaid-isomorphic 3
Browse files Browse the repository at this point in the history
Notably this updated to Mermaid 11 and adds an optional peer dependency
on `playwright`.

See
https://github.com/remcohaszing/mermaid-isomorphic/releases/tag/v3.0.0
for more details.
  • Loading branch information
remcohaszing committed Oct 8, 2024
1 parent 7938138 commit 9292063
Show file tree
Hide file tree
Showing 74 changed files with 2,109 additions and 1,800 deletions.
17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ A [rehype](https://rehype.js.org) plugin to render [mermaid](https://mermaid-js.
- [`'pre-mermaid'`](#pre-mermaid)
- [API](#api)
- [`unified().use(rehypeMermaid, options?)`](#unifieduserehypemermaid-options)
- [`options`](#options)
- [`browser`](#browser)
- [`colorScheme`](#colorscheme)
- [`css`](#css)
- [`dark`](#dark)
- [`errorFallback`](#errorfallback)
- [`launchOptions`](#launchoptions)
- [`mermaidConfig`](#mermaidconfig)
- [`prefix`](#prefix)
- [`strategy`](#strategy)
- [Examples](#examples)
- [remark](#remark)
- [MDX](#mdx)
Expand All @@ -42,11 +32,12 @@ A [rehype](https://rehype.js.org) plugin to render [mermaid](https://mermaid-js.
npm install rehype-mermaid
```

In Node.js this package uses [playwright](https://playwright.dev) under the hood. To use it, you may
need to install additional dependencies. These can be installed with:
Outside of browsers `rehype-mermaid` uses [Playwright](https://playwright.dev). If you use this
outside of a browser, you need to install Playwright and a Playwright browser.

```sh
npx playwright-core install --with-deps chromium
npm install playwright
npx playwright install --with-deps chromium
```

See the Playwright [Browsers](https://playwright.dev/docs/browsers) documentation for more
Expand Down
12 changes: 6 additions & 6 deletions fixtures/code.lang-mermaid/img-png-dark-custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
</p>
<picture
><source
height="49"
height="70"
id="mermaid-dark-0"
media="(prefers-color-scheme: dark)"
srcset="
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAxCAYAAACs0js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1X2Ou2Jr/EOMKYlxBjCuIcQUxriDGFcS4ghhXEOMKYlxBjCuIcQUxriDGFcS4ghhXEOMKMkzcoe6baKu7iHfBT3pPKZsh4kbCcUTCcTTY9mD83nO955TNEHE97pewNdahb+gYpif8yGULek8qi/Jxl5eLeDLuR6ezEd29DuSyBcw+Cug9qyzKx114Fsa3L0m4+jtQu7sGHcfthrk1KB93atQHe9M+WO17AQBnBo8g9DqGj5GE3tNKUjpuJp2HdzqEk66DSCWzSCWzaD+6H5u3VBvi6i35ixs9PfUEkM8tYWR4EiPDkyvOPG4fLl3pw8ZqdT+CussATI0uoKm1Hpevnlvx/If3n3Hr2n14Z0LoOtum275SlL0tJOI/8MYXQc/AYTg6bSseA+dPYMfObcrfGpSNO+X2wWQCTvUc+uOsqsqMrl4HXs2HkVj8rsu+cigb9/HDBbS0W1C7a/tfz139HSgWf2HiwYuKbyuXsvfc0bkbmucHWusRWLxTsT2roeyVux4wriDGFcS4ghhXEOMKYlxBjCuIcQUxriDGFcS4ghhXEOMKYlxBjCuIcQUxriDGFcS4gkp+Qfk2GsPd6dnKrDGQTDa/qdRrNOMWAW8wGkMwGlvTYevFT41/ZiIiIiIiXf0GBWiii5aCnM8AAAAASUVORK5CYII=
"
width="41.671875" />
width="86.671875" />
<img
alt=""
height="49"
height="70"
id="mermaid-0"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAxCAYAAACs0jsDAAAAAXNSR0IArs4c6QAAAhhJREFUaIHtmMFLk3EYxz/rFWNswexgINkyvKhhhwUKujHaVCw6hAcPeQ46SB27SAdv0UXCLv4LHYwcbfNlbDQWjSUkIUYQLQXZhHBzc2ytXm+h2DbofRYLf5/r93m/zwfe9+X98YJCoVC0JJZ64bOHn72A91+ItLVZnt9/2putmTe43tvptD7uvGSVNzvCp+ReuVwyXgB/LcoFp5WrnvPickf58iFfLpd+1p0501QDQZSoNEpUGiUqzekUTSSiTExcZ27ugWQtSIuurq7gdF4hlXrL7m5GslpONJ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026fG0HG3ttLw+fxYWXk89H6jUcPq6jPs7e0iHI7rtk+NYR8LrdYXVCplxGL3EAgEh15LSw/gdLoM/2gwbNx8fhMWiwXz87E/zqxWK8Lh2yiXD9BsftZlnxaGjbu9nYHfH4DLdeWv5wsLdzEYDJDLvRn7Nq0M+8xdX3818tzn8yOXez+2Pedh2Dv3X8C4ghhXEOMKYlxBjCuIcQUxriDGFcS4ghhXEOMKYlxBjCuIcQUxriDGFcS4ghhXEOMKUv2CstlQgLft8awxkZ+9X5fVrlGLW2w1FLQa5vg97LhNTlrO/GcmIiIiItLVb3i1nsU5OdnpAAAAAElFTkSuQmCC"
width="86.671875"
/></picture>
</body>
</html>
12 changes: 6 additions & 6 deletions fixtures/code.lang-mermaid/img-png-dark.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
</p>
<picture
><source
height="49"
height="70"
id="mermaid-dark-0"
media="(prefers-color-scheme: dark)"
srcset="
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAxCAYAAACs0jsDAAAAAXNSR0IArs4c6QAAAglJREFUaIHtmLFvEmEYhx9AJOaDiQRCGSsYQ8LFGq8mVO6gmLiqXXHir6iDXeyf4MBQEzcbjIuNgx1gkEJTY2ADmS42NE6E5EJqEJw0Nm2h8T4Mpt+z/r77vU9yd7k3BwqFQjGXuCaFG2+/mC435r8QGf9wvdh4dP3befmVSRe73JjdTvPZUacxE7lf3Ew/PPYFAiXg70QBjjoNPr9/JV3uTxbv3D/2BQITz7hnaiARJSobJSobJSqbyymq6zpvSiWerq/LrAXZooZhYFkWmqYRDAZlVssT9fv93F5a4vX2NrZtk8lkZFWDTNGVVIox0Gg02KvVyGazsqpBpqhhmnw6OGAwGFCpVAiHQiSTSVn1ckQjkQjxWIxypQJAq9Wi2+2SW12VUQ+yRE3DwLZt2u02QgiEENTqdXRdJzBlfbsoU/fRi3AvnUYIwcutrVOZkU7zbmfH8QzHoolEgnAoRLFY5Ovh4YnsST5PLpebD1HDMO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jCmJcQYwriHEFMa6g0B8oLcvCl4ODxaxJEMMwQu9jDYt7YZkmLNN8uVWviK7rT/4zExEREREp9QdDdIj92Jd76wAAAABJRU5ErkJggg==
"
width="41.671875" />
width="86.671875" />
<img
alt=""
height="49"
height="70"
id="mermaid-0"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAxCAYAAACs0jsDAAAAAXNSR0IArs4c6QAAAhhJREFUaIHtmMFLk3EYxz/rFWNswexgINkyvKhhhwUKujHaVCw6hAcPeQ46SB27SAdv0UXCLv4LHYwcbfNlbDQWjSUkIUYQLQXZhHBzc2ytXm+h2DbofRYLf5/r93m/zwfe9+X98YJCoVC0JJZ64bOHn72A91+ItLVZnt9/2putmTe43tvptD7uvGSVNzvCp+ReuVwyXgB/LcoFp5WrnvPickf58iFfLpd+1p0501QDQZSoNEpUGiUqzekUTSSiTExcZ27ugWQtSIuurq7gdF4hlXrL7m5GslpONJ/PkUzGmZm5h91+jnD4lVQ1SIrGYmEsFgsu1zBut59Q6CWGYUjVy4nqeoChITc2mx2f7yaZzA5ra++k6mVEt7e/sbn5Eb//FgADA9fo6rpIMLgsUQ9Sorq+gs1mp69vkEJhn0Jhn9FRH4lElFxuT2JF4/NoIwzDIBJ5TbFYYHp67ESu6wGmpu6aXWNedH39PZnMDrOzj+juvnwsW1paIBhcbg1RXQ/gcHQwOXkHTdOOZePjt1lcfMLGxjr9/YOm9ph6RqvVKvF4hJGRGyckATyeMTRNE3mpTIlubX3l4KCIx+P/Y+5wdOByDROLhalUKmZWmbv1PT29hEKpujPz8wtmVvzmdJ6emokSlUaJSqNEpflvRBt+mTLpErz53lSJH+VfZxvNNBKNZtMlsumSnFUN2tstNX/iKhQKRQtzCGNtnFnfo13VAAAAAElFTkSuQmCC"
width="41.671875"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAABGCAYAAAC5QghSAAAAAXNSR0IArs4c6QAAAoFJREFUeJzt3MFrknEcx/GPOZdetdbNIZM8GLiBdZAhOq1ZuwSdOo6dhIL+g+7RLRa77OJ5QcFERbc5O2yLEBIayEJxl1JCotkeJczOUvN5GPv6PE99XuDF3yN8ePPwXBQBIiIiItKJZdThiydHEQCR8c0xl4kJy8vkc2/rzHOVz0emph1Pp9yOi19mctV333o9ZbAB4NxxcW3agRth54WPM7vah++9ntIfec2lsa35DzGuIMYVxLiCGFcQ4wpiXEGMK4hxBTGuIMYVxLiCGFcQ4wpiXEGMK4hxBTGuINPETSYfYnExiGr1o95TNDNF3Hr9E2q1I7jdHmQyr/Weo5kp4ubzm5iZuY5E4j6KxRwURdF7kiaGj9vv97Gzk0UwGEIkcgfdroJSKa/3LE0MH7dcPkC7/RXRaAIu11XMzd1CNmuOR4Ph4xYKaXi9Png8XgBAPL6Ew8MKjo/rek9TZei4p6c/sL+/i1Aoik7nBJ3OCWZnb8Jut5vi7lX9xY2eSqUCut0uUqk1pFJrQ2eFQhrLy49gs9l026fG0HG3ttLw+fxYWXk89H6jUcPq6jPs7e0iHI7rtk+NYR8LrdYXVCplxGL3EAgEh15LSw/gdLoM/2gwbNx8fhMWiwXz87E/zqxWK8Lh2yiXD9BsftZlnxaGjbu9nYHfH4DLdeWv5wsLdzEYDJDLvRn7Nq0M+8xdX3818tzn8yOXez+2Pedh2Dv3X8C4ghhXEOMKYlxBjCuIcQUxriDGFcS4ghhXEOMKYlxBjCuIcQUxriDGFcS4ghhXEOMKUv2CstlQgLft8awxkZ+9X5fVrlGLW2w1FLQa5vg97LhNTlrO/GcmIiIiItLVb3i1nsU5OdnpAAAAAElFTkSuQmCC"
width="86.671875"
/></picture>
</body>
</html>
6 changes: 3 additions & 3 deletions fixtures/code.lang-mermaid/img-png.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
</p>
<img
alt=""
height="49"
height="70"
id="mermaid-0"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAxCAYAAACs0jsDAAAAAXNSR0IArs4c6QAAAhhJREFUaIHtm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4wpiXEGMK4hxBTGuINPETSYfYnExiGr1o95TNDNF3Hr9E2q1I7jdHmQyr/Weo5kp4ubzm5iZuY5E4j6KxRwURdF7kiaGj9vv97Gzk0UwGEIkcgfdroJSKa/3LE0MH7dcPkC7/RXRaAIu11XMzd1CNmuOR4Ph4xYKaXi9Png8XgBAPL6Ew8MKjo/rek9TZei4p6c/sL+/i1Aoik7nBJ3OCWZnb8Jut5vi7lX9xY2eSqUCut0uUqk1pFJrQ2eFQhrLy49gs9l026fG0HG3ttLw+fxYWXk89H6jUcPq6jPs7e0iHI7rtk+NYR8LrdYXVCplxGL3EAgEh15LSw/gdLoM/2gwbNx8fhMWiwXz87E/zqxWK8Lh2yiXD9BsftZlnxaGjbu9nYHfH4DLdeWv5wsLdzEYDJDLvRn7Nq0M+8xdX3818tzn8yOXez+2Pedh2Dv3X8C4ghhXEOMKYlxBjCuIcQUxriDGFcS4ghhXEOMKYlxBjCuIcQUxriDGFcS4ghhXEOMKUv2CstlQgLft8awxkZ+9X5fVrlGLW2w1FLQa5vg97LhNTlrO/GcmIiIiItLVb3i1nsU5OdnpAAAAAElFTkSuQmCC"
width="86.671875"
/>
</body>
</html>
Loading

0 comments on commit 9292063

Please sign in to comment.