Skip to content

Commit 42acf66

Browse files
committed
chore: add math equations
1 parent e840271 commit 42acf66

3 files changed

Lines changed: 268 additions & 2 deletions

File tree

docusaurus.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { themes as prismThemes } from "prism-react-renderer";
22
import type { Config } from "@docusaurus/types";
33
import type * as Preset from "@docusaurus/preset-classic";
4+
import remarkMath from "remark-math";
5+
import rehypeKatex from "rehype-katex";
46

57
const config: Config = {
68
title: "LeetCode and Codewars solutions",
@@ -21,13 +23,24 @@ const config: Config = {
2123
routeBasePath: "/",
2224
sidebarPath: require.resolve("./sidebars.js"),
2325
editUrl: "https://github.com/JuneLin2001/solve-problems/edit/main/",
26+
remarkPlugins: [remarkMath],
27+
rehypePlugins: [rehypeKatex],
2428
},
2529
theme: {
2630
customCss: require.resolve("./src/css/custom.css"),
2731
},
2832
} satisfies Preset.Options,
2933
],
3034
],
35+
stylesheets: [
36+
{
37+
href: "https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css",
38+
type: "text/css",
39+
integrity:
40+
"sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM",
41+
crossorigin: "anonymous",
42+
},
43+
],
3144

3245
themeConfig: {
3346
image: "img/docusaurus-social-card.jpg",

package-lock.json

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

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
"clsx": "^2.0.0",
2222
"prism-react-renderer": "^2.3.0",
2323
"react": "^19.0.0",
24-
"react-dom": "^19.0.0"
24+
"react-dom": "^19.0.0",
25+
"rehype-katex": "^7.0.1",
26+
"remark-math": "^6.0.0"
2527
},
2628
"devDependencies": {
2729
"@docusaurus/module-type-aliases": "3.7.0",

0 commit comments

Comments
 (0)