diff --git a/.gitignore b/.gitignore index 21065ee..d35299c 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,7 @@ next-env.d.ts Agents.md # Environment variables -.env \ No newline at end of file +.env + +# VS code +.vscode \ No newline at end of file diff --git a/app/docs/CommunityShare/Geek/CommonUsedMarkdown.md b/app/docs/CommunityShare/Geek/CommonUsedMarkdown.md new file mode 100644 index 0000000..db791d1 --- /dev/null +++ b/app/docs/CommunityShare/Geek/CommonUsedMarkdown.md @@ -0,0 +1,76 @@ +--- +title: 常用Markdown语法 +date: 2025-09-20 14:25:39 +--- + +## 基础标题+字体样式 + +`# 一级标题` + +`## 二级标题` + +以此类推 + +**加粗字体** `**加粗字体**` + +_斜体字体_ `*斜体字体*` + +**_斜体加粗_** `***斜体加粗***` + +~~删除线~~ `~~删除线~~` + +荧光笔 `荧光笔` + +半 角 空 格 + +`半 角 空 格` + +全 角 空 格 + +`全 角 空 格` + +## 无序、有序列表 + +- 无序列表1 `* 无序列表1` +- 无序列表2 `* 无序列表2` +- 无序列表3 `* 无序列表3` +- 无序列表4 `* 无序列表4` + +1. 有序列表1 `1. 有序列表1` +2. 有序列表2 `2. 有序列表2` +3. 有序列表3 `3. 有序列表3` +4. 有序列表4 `4. 有序列表4` + +## 建表 + +| 表头 | 左对齐 | 居中 | 右对齐 | +| ------ | :----- | :----: | -----: | +| 单元格 | 单元格 | 单元格 | 单元格 | +| 单元格 | 单元格 | 单元格 | 单元格 | + +``` +| 表头 | 左对齐 | 居中 | 右对齐 | +| - | :- | :-: | -: | +| 单元格 | 单元格 | 单元格 | 单元格 | +| 单元格 | 单元格 | 单元格 | 单元格 | +``` + +## 超链接 + +`[想要显示的链接名](目标网址)` + +**示例** + +[点这里下载Anaconda](https://www.anaconda.com/download) + +`[点这里下载Anaconda](https://www.anaconda.com/download)` + +## 图片 + +`![测试图片](./你的图片.jpg "自定义鼠标悬停显示名")` + +**示例** + +![测试图片](/CommonUsedMarkdown.assets/testpic1.jpg "autumn") + +`![测试图片](./CommonUsedMarkdown.assets/testpic1.jpg "autumn")` diff --git a/app/docs/CommunityShare/Geek/Katex/Seb1.mdx b/app/docs/CommunityShare/Geek/Katex/Seb1.mdx new file mode 100644 index 0000000..c2ce9a3 --- /dev/null +++ b/app/docs/CommunityShare/Geek/Katex/Seb1.mdx @@ -0,0 +1,79 @@ +--- +title: 个人常用字符 +date: 2025-09-20 14:25:39 +--- + +## 希腊字母 + +| 效果 | 指令 | 效果 | 指令 | +| :--------: | :--------: | :-------: | :-------: | +| $\alpha$ | `\alpha` | $\sigma$ | `\sigma` | +| $\beta$ | `\beta` | $\tau$ | `\tau` | +| $\gamma$ | `\gamma` | $\Gamma$ | `\Gamma` | +| $\delta$ | `\delta` | $\Delta$ | `\Delta` | +| $\epsilon$ | `\epsilon` | $\psi$ | `\psi` | +| $\zeta$ | `\zeta` | $\omega$ | `\omega` | +| $\eta$ | `\eta` | $\Omega$ | `\Omega` | +| $\theta$ | `\theta` | $\Theta$ | `\Theta` | +| $\lambda$ | `\lambda` | $\phi$ | `\phi` | +| $\mu$ | `\mu` | $\varphi$ | `\varphi` | +| $\pi$ | `\pi` | $\xi$ | `\xi` | +| $\rho$ | `\rho` | | | + +## 箭头 + +| 样例 | 指令 | 样例 | 指令 | +| :---------------: | :---------------: | :------------------: | :------------------: | +| $\leftarrow$ | `\leftarrow` | $\Leftarrow$ | `\Leftarrow` | +| $\rightarrow$ | `\rightarrow` | $\Rightarrow$ | `\Rightarrow` | +| $\leftrightarrow$ | `\leftrightarrow` | $\Leftrightarrow$ | `\Leftrightarrow` | +| $\uparrow$ | `\uparrow` | $\mapsto$ | `\mapsto` | +| $\downarrow$ | `\downarrow` | $\rightleftharpoons$ | `\rightleftharpoons` | + +## 运算符 + +| 样例 | 指令 | 样例 | 指令 | +| :------: | :------: | :-------: | :-------: | +| $\times$ | `\times` | $\wedge$ | `\wedge` | +| $\div$ | `\div` | $\vee$ | `\vee` | +| $\cap$ | `\cap` | $\oplus$ | `\oplus` | +| $\cup$ | `\cup` | $\otimes$ | `\otimes` | +| $\cdot$ | `\cdot` | $\cdots$ | `\cdots` | + +## 关系符 + +| 样例 | 指令 | 样例 | 指令 | +| :-----: | :-----: | :---------: | :---------: | +| $\neq$ | `\neq` | $\subset$ | `\subset` | +| $\leq$ | `\leq` | $\subseteq$ | `\subseteq` | +| $\geq$ | `\geq` | $\approx$ | `\approx` | +| $\ll$ | `\ll` | $\equiv$ | `\equiv` | +| $\gg$ | `\gg` | $\cong$ | `\cong` | +| $\prec$ | `\prec` | $\parallel$ | `\parallel` | +| $\succ$ | `\succ` | $\perp$ | `\perp` | +| $\in$ | `\in` | $\notin$ | `\notin` | + +## 无穷、偏分、证明 + +| 样例 | 指令 | 样例 | 指令 | +| :-----------: | :-----------: | :----------: | :----------: | +| $\infty$ | `\infty` | $\exists$ | `\exists` | +| $\partial$ | `\partial` | $\neg$ | `\neg` | +| $\varnothing$ | `\varnothing` | $\because$ | `\because` | +| | | $\therefore$ | `\therefore` | + +## 上标、下标 + +| 样例 | 指令 | 样例 | 指令 | +| :-----------------------: | :-----------------------: | :------------------------: | :------------------------: | +| $\bar{a}$ | `\bar{a}` | | | +| $\hat{a}$ | `\hat{a}` | | | +| $\widehat{abc}$ | `\widehat{abc}` | | | +| $\tilde{a}$ | `\tilde{a}` | $\utilde{a}$ | `\utilde{a}` | +| $\widetilde{abc}$ | `\widetilde{abc}` | | | +| $\vec{A}$ | `\vec{A}` | | | +| $\overline{AB}$ | `\overline{AB}` | $\underline{AB}$ | `\underline{AB}` | +| $\overleftarrow{AB}$ | `\overleftarrow{AB}` | $\underleftarrow{AB}$ | `\underleftarrow{AB}` | +| $\overleftrightarrow{AB}$ | `\overleftrightarrow{AB}` | $\underleftrightarrow{AB}$ | `\underleftrightarrow{AB}` | +| $\overleftharpoon{AB}$ | `\overleftharpoon{AB}` | | | +| $\overgroup{AB}$ | `\overgroup{AB}` | $\undergroup{AB}$ | `\undergroup{AB}` | diff --git a/app/docs/CommunityShare/Geek/Katex/Seb2.mdx b/app/docs/CommunityShare/Geek/Katex/Seb2.mdx new file mode 100644 index 0000000..92c1d98 --- /dev/null +++ b/app/docs/CommunityShare/Geek/Katex/Seb2.mdx @@ -0,0 +1,108 @@ +--- +title: 数学公式语法 +date: 2025-09-20 14:25:39 +--- + +## 求和、求积、二项式 + +| 样例 | 指令 | +| :---------------: | :-------------: | +| $$\sum_{i=1}^n$$ | `\sum_{i=1}^n` | +| $$\prod_{i=1}^n$$ | `\prod_{i=1}^n` | +| $$\tbinom{a}{b}$$ | `\tbinom{a}{b}` | + +## 矩阵、行列式 + +$$ +\left(\begin{matrix} +a & b \\ +c & d +\end{matrix}\right) +$$ + +```latex +$$ +\left(\begin{matrix} +a & b \\ +c & d +\end{matrix}\right) +$$ +``` + +$$ +\left|\begin{matrix} +a & b \\ +c & d +\end{matrix}\right| +$$ + +```latex +$$ +\left|\begin{matrix} +a & b \\ +c & d +\end{matrix}\right| +$$ +``` + +$$ +\left(\begin{matrix} +1 & 2 & \cdots & n \\ +2 & 3 & \cdots & n+1 \\ +\vdots & \vdots & \ddots & n^2 - 1\\ +n & n+1 & \cdots & n^2 +\end{matrix}\right) +$$ + +```latex +$$ +\left(\begin{matrix} +1 & 2 & \cdots & n \\ +2 & 3 & \cdots & n+1 \\ +\vdots & \vdots & \ddots & n^2 - 1\\ +n & n+1 & \cdots & n^2 +\end{matrix}\right) +$$ +``` + +## 维持等号缩进 + +$$ +\begin{aligned} + f(X|\theta) &= f(x_1,x_2,\cdots,x_n|\theta)\\ + &= f(x_1|\theta) \cdot f(x_2|\theta) \cdots f(x_n|\theta)\\ + &= \prod_{i=1}^n \frac{1}{x_i !} e^{-\theta}\theta^{x_i}\\ + &= \left(\prod_{i=1}^n \frac{1}{x_i !}\right) e^{-n \theta}\theta^{\sum_{i=1}^n x_i} +\end{aligned} +$$ + +```latex +$$ +\begin{aligned} + f(X|\theta) &= f(x_1,x_2,\cdots,x_n|\theta)\\ + &= f(x_1|\theta) \cdot f(x_2|\theta) \cdots f(x_n|\theta)\\ + &= \prod_{i=1}^n \frac{1}{x_i !} e^{-\theta}\theta^{x_i}\\ + &= \left(\prod_{i=1}^n \frac{1}{x_i !}\right) e^{-n \theta}\theta^{\sum_{i=1}^n x_i} +\end{aligned} +$$ +``` + +## 分段函数的表示(与Latex有差异) + +因为不能用`\equation`和各种`\cases`,所以需要变通一下 + +$$ +f(x,\theta) = \left\{ \begin{array}{ll} +\dfrac{1}{x\sqrt{2\pi \theta}} e^{-\frac{1}{2\theta} [\log(x)]^2} &,\text{ $x>0$} \\ +0 &,\text{ otherwise} +\end{array} \right. +$$ + +```latex +$$ +f(x,\theta) = \left\{ \begin{array}{ll} +\dfrac{1}{x\sqrt{2\pi \theta}} e^{-\frac{1}{2\theta} [\log(x)]^2} &,\text{ $x>0$} \\ +0 &,\text{ otherwise} +\end{array} \right. +$$ +``` diff --git a/app/docs/CommunityShare/Geek/Katex/index.mdx b/app/docs/CommunityShare/Geek/Katex/index.mdx new file mode 100644 index 0000000..e255991 --- /dev/null +++ b/app/docs/CommunityShare/Geek/Katex/index.mdx @@ -0,0 +1,10 @@ +--- +title: 常用Katex语法 +date: 2025-09-20 14:25:39 +--- + +Katex 与 Latex 有些许的不同,稍作整理以便自己查阅 + +在2个`$`之间增加指令,就可以实现行间数学模式,与正文不冲突 + +在2个`$$`之间增加指令,将公式居中显示的单独模块 diff --git a/app/layout.tsx b/app/layout.tsx index 0bc4091..a47fc1e 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,6 +3,7 @@ import localFont from "next/font/local"; import { RootProvider } from "fumadocs-ui/provider"; import Script from "next/script"; import "./globals.css"; +import "katex/dist/katex.min.css"; import { ThemeProvider } from "@/app/components/ThemeProvider"; import { SpeedInsights } from "@vercel/speed-insights/next"; diff --git a/next.config.mjs b/next.config.mjs index a834c0e..5f7510b 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -2,7 +2,10 @@ import { createMDX } from "fumadocs-mdx/next"; import createNextIntlPlugin from "next-intl/plugin"; -const withMDX = createMDX(); +const withMDX = createMDX({ + configPath: "source.config.ts", +}); + const withNextIntl = createNextIntlPlugin("./i18n.ts"); /** @type {import('next').NextConfig} */ diff --git a/package.json b/package.json index 8d3f082..a9d9e28 100644 --- a/package.json +++ b/package.json @@ -61,9 +61,12 @@ "eslint": "^9.35.0", "eslint-config-next": "^15.5.3", "husky": "^9.1.7", + "katex": "^0.16.22", "lint-staged": "^16.1.6", "postcss": "^8.5.6", "prettier": "3.6.2", + "rehype-katex": "^7.0.1", + "remark-math": "^6.0.0", "tailwindcss": "^4.1.13", "tw-animate-css": "^1.3.8", "typescript": "^5.6.3" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9fe9b16..45be751 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -143,6 +143,9 @@ importers: husky: specifier: ^9.1.7 version: 9.1.7 + katex: + specifier: ^0.16.22 + version: 0.16.22 lint-staged: specifier: ^16.1.6 version: 16.1.6 @@ -152,6 +155,12 @@ importers: prettier: specifier: 3.6.2 version: 3.6.2 + rehype-katex: + specifier: ^7.0.1 + version: 7.0.1 + remark-math: + specifier: ^6.0.0 + version: 6.0.0 tailwindcss: specifier: ^4.1.13 version: 4.1.13 @@ -2031,6 +2040,12 @@ packages: integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==, } + "@types/katex@0.16.7": + resolution: + { + integrity: sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==, + } + "@types/mdast@4.0.4": resolution: { @@ -2797,6 +2812,13 @@ packages: } engines: { node: ">=20" } + commander@8.3.0: + resolution: + { + integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==, + } + engines: { node: ">= 12" } + compute-scroll-into-view@3.1.1: resolution: { @@ -2989,6 +3011,13 @@ packages: } engines: { node: ">=10.13.0" } + entities@6.0.1: + resolution: + { + integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==, + } + engines: { node: ">=0.12" } + environment@1.1.0: resolution: { @@ -3687,6 +3716,30 @@ packages: } engines: { node: ">= 0.4" } + hast-util-from-dom@5.0.1: + resolution: + { + integrity: sha512-N+LqofjR2zuzTjCPzyDUdSshy4Ma6li7p/c3pA78uTwzFgENbgbUrm2ugwsOdcjI1muO+o6Dgzp9p8WHtn/39Q==, + } + + hast-util-from-html-isomorphic@2.0.0: + resolution: + { + integrity: sha512-zJfpXq44yff2hmE0XmwEOzdWin5xwH+QIhMLOScpX91e/NSGPsAzNCvLQDIEPyO2TXi+lBmU6hjLIhV8MwP2kw==, + } + + hast-util-from-html@2.0.3: + resolution: + { + integrity: sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==, + } + + hast-util-from-parse5@8.0.3: + resolution: + { + integrity: sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==, + } + hast-util-heading-rank@3.0.0: resolution: { @@ -3699,6 +3752,12 @@ packages: integrity: sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==, } + hast-util-parse-selector@4.0.0: + resolution: + { + integrity: sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==, + } + hast-util-to-estree@3.1.3: resolution: { @@ -3723,12 +3782,24 @@ packages: integrity: sha512-XelQVTDWvqcl3axRfI0xSeoVKzyIFPwsAGSLIsKdJKQMXDYJS4WYrBNF/8J7RdhIcFI2BOHgAifggsvsxp/3+A==, } + hast-util-to-text@4.0.2: + resolution: + { + integrity: sha512-KK6y/BN8lbaq654j7JgBydev7wuNMcID54lkRav1P0CaE1e47P72AWWPiGKXTJU271ooYzcvTAn/Zt0REnvc7A==, + } + hast-util-whitespace@3.0.0: resolution: { integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==, } + hastscript@9.0.1: + resolution: + { + integrity: sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==, + } + html-url-attributes@3.0.1: resolution: { @@ -4119,6 +4190,13 @@ packages: } engines: { node: ">=4.0" } + katex@0.16.22: + resolution: + { + integrity: sha512-XCHRdUw4lf3SKBaJe4EvgqIuWwkPSo9XoeO8GjQW94Bp7TWv9hNhzZjZ+OH9yf1UmLygb7DIT5GSFQiyt16zYg==, + } + hasBin: true + keyv@4.5.4: resolution: { @@ -4404,6 +4482,12 @@ packages: integrity: sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==, } + mdast-util-math@3.0.0: + resolution: + { + integrity: sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==, + } + mdast-util-mdx-expression@2.0.1: resolution: { @@ -4507,6 +4591,12 @@ packages: integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==, } + micromark-extension-math@3.1.0: + resolution: + { + integrity: sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==, + } + micromark-extension-mdx-expression@3.0.1: resolution: { @@ -4985,6 +5075,12 @@ packages: integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==, } + parse5@7.3.0: + resolution: + { + integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==, + } + path-exists@4.0.0: resolution: { @@ -5601,6 +5697,12 @@ packages: integrity: sha512-rItO/pSdvnvsP4QRB1pmPiNHUskikqtPojZKJPPPAVx9Hj8i8TwMBhofrrAYRhYOOBZH9tgmG5lPqDLuIWPWmw==, } + rehype-katex@7.0.1: + resolution: + { + integrity: sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA==, + } + rehype-recma@1.0.0: resolution: { @@ -5619,6 +5721,12 @@ packages: integrity: sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==, } + remark-math@6.0.0: + resolution: + { + integrity: sha512-MMqgnP74Igy+S3WwnhQ7kqGlEerTETXMvJhrUzDikVZ2/uogJCb+WHUg97hK9/jcfc0dkD73s3LN8zU49cTEtA==, + } + remark-mdx@3.1.1: resolution: { @@ -6210,6 +6318,12 @@ packages: integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==, } + unist-util-find-after@5.0.0: + resolution: + { + integrity: sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==, + } + unist-util-is@6.0.0: resolution: { @@ -6228,6 +6342,12 @@ packages: integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==, } + unist-util-remove-position@5.0.0: + resolution: + { + integrity: sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==, + } + unist-util-stringify-position@4.0.0: resolution: { @@ -6351,6 +6471,12 @@ packages: integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==, } + vfile-location@5.0.3: + resolution: + { + integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==, + } + vfile-message@4.0.3: resolution: { @@ -6363,6 +6489,12 @@ packages: integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==, } + web-namespaces@2.0.1: + resolution: + { + integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==, + } + which-boxed-primitive@1.1.1: resolution: { @@ -7678,6 +7810,8 @@ snapshots: "@types/json5@0.0.29": {} + "@types/katex@0.16.7": {} + "@types/mdast@4.0.4": dependencies: "@types/unist": 3.0.3 @@ -8188,6 +8322,8 @@ snapshots: commander@14.0.1: {} + commander@8.3.0: {} + compute-scroll-into-view@3.1.1: {} concat-map@0.0.1: {} @@ -8287,6 +8423,8 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.2.3 + entities@6.0.1: {} + environment@1.1.0: {} es-abstract@1.24.0: @@ -8925,6 +9063,39 @@ snapshots: dependencies: function-bind: 1.1.2 + hast-util-from-dom@5.0.1: + dependencies: + "@types/hast": 3.0.4 + hastscript: 9.0.1 + web-namespaces: 2.0.1 + + hast-util-from-html-isomorphic@2.0.0: + dependencies: + "@types/hast": 3.0.4 + hast-util-from-dom: 5.0.1 + hast-util-from-html: 2.0.3 + unist-util-remove-position: 5.0.0 + + hast-util-from-html@2.0.3: + dependencies: + "@types/hast": 3.0.4 + devlop: 1.1.0 + hast-util-from-parse5: 8.0.3 + parse5: 7.3.0 + vfile: 6.0.3 + vfile-message: 4.0.3 + + hast-util-from-parse5@8.0.3: + dependencies: + "@types/hast": 3.0.4 + "@types/unist": 3.0.3 + devlop: 1.1.0 + hastscript: 9.0.1 + property-information: 7.1.0 + vfile: 6.0.3 + vfile-location: 5.0.3 + web-namespaces: 2.0.1 + hast-util-heading-rank@3.0.0: dependencies: "@types/hast": 3.0.4 @@ -8933,6 +9104,10 @@ snapshots: dependencies: "@types/hast": 3.0.4 + hast-util-parse-selector@4.0.0: + dependencies: + "@types/hast": 3.0.4 + hast-util-to-estree@3.1.3: dependencies: "@types/estree": 1.0.8 @@ -8992,10 +9167,25 @@ snapshots: dependencies: "@types/hast": 3.0.4 + hast-util-to-text@4.0.2: + dependencies: + "@types/hast": 3.0.4 + "@types/unist": 3.0.3 + hast-util-is-element: 3.0.0 + unist-util-find-after: 5.0.0 + hast-util-whitespace@3.0.0: dependencies: "@types/hast": 3.0.4 + hastscript@9.0.1: + dependencies: + "@types/hast": 3.0.4 + comma-separated-tokens: 2.0.3 + hast-util-parse-selector: 4.0.0 + property-information: 7.1.0 + space-separated-tokens: 2.0.2 + html-url-attributes@3.0.1: {} html-void-elements@3.0.0: {} @@ -9207,6 +9397,10 @@ snapshots: object.assign: 4.1.7 object.values: 1.2.1 + katex@0.16.22: + dependencies: + commander: 8.3.0 + keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -9426,6 +9620,18 @@ snapshots: transitivePeerDependencies: - supports-color + mdast-util-math@3.0.0: + dependencies: + "@types/hast": 3.0.4 + "@types/mdast": 4.0.4 + devlop: 1.1.0 + longest-streak: 3.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + unist-util-remove-position: 5.0.0 + transitivePeerDependencies: + - supports-color + mdast-util-mdx-expression@2.0.1: dependencies: "@types/estree-jsx": 1.0.5 @@ -9587,6 +9793,16 @@ snapshots: micromark-util-combine-extensions: 2.0.1 micromark-util-types: 2.0.2 + micromark-extension-math@3.1.0: + dependencies: + "@types/katex": 0.16.7 + devlop: 1.1.0 + katex: 0.16.22 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + micromark-extension-mdx-expression@3.0.1: dependencies: "@types/estree": 1.0.8 @@ -9963,6 +10179,10 @@ snapshots: is-decimal: 2.0.1 is-hexadecimal: 2.0.1 + parse5@7.3.0: + dependencies: + entities: 6.0.1 + path-exists@4.0.0: {} path-key@3.1.1: {} @@ -10473,6 +10693,16 @@ snapshots: unified: 11.0.5 unist-util-visit: 5.0.0 + rehype-katex@7.0.1: + dependencies: + "@types/hast": 3.0.4 + "@types/katex": 0.16.7 + hast-util-from-html-isomorphic: 2.0.0 + hast-util-to-text: 4.0.2 + katex: 0.16.22 + unist-util-visit-parents: 6.0.1 + vfile: 6.0.3 + rehype-recma@1.0.0: dependencies: "@types/estree": 1.0.8 @@ -10500,6 +10730,15 @@ snapshots: transitivePeerDependencies: - supports-color + remark-math@6.0.0: + dependencies: + "@types/mdast": 4.0.4 + mdast-util-math: 3.0.0 + micromark-extension-math: 3.1.0 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + remark-mdx@3.1.1: dependencies: mdast-util-mdx: 3.0.0 @@ -10937,6 +11176,11 @@ snapshots: trough: 2.2.0 vfile: 6.0.3 + unist-util-find-after@5.0.0: + dependencies: + "@types/unist": 3.0.3 + unist-util-is: 6.0.0 + unist-util-is@6.0.0: dependencies: "@types/unist": 3.0.3 @@ -10949,6 +11193,11 @@ snapshots: dependencies: "@types/unist": 3.0.3 + unist-util-remove-position@5.0.0: + dependencies: + "@types/unist": 3.0.3 + unist-util-visit: 5.0.0 + unist-util-stringify-position@4.0.0: dependencies: "@types/unist": 3.0.3 @@ -11045,6 +11294,11 @@ snapshots: util-deprecate@1.0.2: {} + vfile-location@5.0.3: + dependencies: + "@types/unist": 3.0.3 + vfile: 6.0.3 + vfile-message@4.0.3: dependencies: "@types/unist": 3.0.3 @@ -11055,6 +11309,8 @@ snapshots: "@types/unist": 3.0.3 vfile-message: 4.0.3 + web-namespaces@2.0.1: {} + which-boxed-primitive@1.1.1: dependencies: is-bigint: 1.1.0 diff --git a/public/CommonUsedMarkdown.assets/testpic1.jpg b/public/CommonUsedMarkdown.assets/testpic1.jpg new file mode 100644 index 0000000..e9debb3 Binary files /dev/null and b/public/CommonUsedMarkdown.assets/testpic1.jpg differ diff --git a/source.config.ts b/source.config.ts index eb86e17..d4dd2b7 100644 --- a/source.config.ts +++ b/source.config.ts @@ -1,7 +1,14 @@ import { defineDocs, defineConfig } from "fumadocs-mdx/config"; +import remarkMath from "remark-math"; +import rehypeKatex from "rehype-katex"; export const docs = defineDocs({ dir: "app/docs", }); -export default defineConfig(); +export default defineConfig({ + mdxOptions: { + remarkPlugins: [remarkMath], + rehypePlugins: (v) => [rehypeKatex, ...v], + }, +});