Skip to content

Commit c93def8

Browse files
committed
Test mermaid.
1 parent 9fa2490 commit c93def8

File tree

4 files changed

+1094
-1
lines changed

4 files changed

+1094
-1
lines changed

astro.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import metaTags from "astro-meta-tags";
1111
import pagefind from "astro-pagefind";
1212
import deleteUnusedImages from "astro-delete-unused-images";
1313
import preload from "astro-preload";
14+
import rehypeMermaid from "rehype-mermaid";
1415
import { execSync } from "node:child_process";
1516

1617
let gitVersion = String(process.env.GIT_VERSION ?? "").slice(0, 7);
@@ -54,6 +55,10 @@ export default defineConfig({
5455
},
5556
},
5657
markdown: {
58+
syntaxHighlight: {
59+
type: "shiki",
60+
excludeLangs: ["mermaid", "math"],
61+
},
5762
remarkPlugins: [
5863
[
5964
remarkToc,
@@ -63,6 +68,7 @@ export default defineConfig({
6368
],
6469
],
6570
rehypePlugins: [
71+
rehypeMermaid,
6672
rehypeSlug,
6773
[
6874
rehypeAutolinkHeadings,

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@
3333
"hastscript": "^9.0.1",
3434
"js-yaml": "^4.1.0",
3535
"marked": "^15.0.11",
36+
"mermaid": "^11.6.0",
37+
"mermaid-isomorphic": "^3.0.4",
3638
"pagefind": "^1.3.0",
39+
"playwright": "^1.52.0",
3740
"react": "^19.1.0",
3841
"react-dom": "^19.1.0",
3942
"rehype-autolink-headings": "^7.1.0",
43+
"rehype-mermaid": "^3.0.0",
4044
"rehype-slug": "^6.0.0",
4145
"remark-toc": "^9.0.0",
4246
"sharp": "^0.34.1",
@@ -47,8 +51,8 @@
4751
"@types/js-yaml": "^4.0.9",
4852
"prettier": "^3.5.3",
4953
"prettier-plugin-astro": "^0.14.1",
50-
"tsx": "^4.19.4",
5154
"puppeteer": "^24.7.2",
55+
"tsx": "^4.19.4",
5256
"typescript": "^5.8.3"
5357
},
5458
"prettier": {

0 commit comments

Comments
 (0)