From d557ddef859901b207ab9a92427ca00e39b900ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:07:15 +0000 Subject: [PATCH 1/6] Initial plan From 3d32b6c54216734a0ed1ac77351ea83c2c362505 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:12:20 +0000 Subject: [PATCH 2/6] Add remark-gfm, remark-math, and rehype-katex plugins Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- apps/site/app/layout.tsx | 1 + apps/site/package.json | 16 +-- apps/site/source.config.ts | 22 ++++- pnpm-lock.yaml | 194 +++++++++++++++++++++++++++++++++++++ 4 files changed, 226 insertions(+), 7 deletions(-) diff --git a/apps/site/app/layout.tsx b/apps/site/app/layout.tsx index 353c26bb..ea89355d 100644 --- a/apps/site/app/layout.tsx +++ b/apps/site/app/layout.tsx @@ -1,4 +1,5 @@ import './globals.css'; +import 'katex/dist/katex.min.css'; import type { ReactNode } from 'react'; import { RootProvider } from 'fumadocs-ui/provider'; diff --git a/apps/site/package.json b/apps/site/package.json index f89279e3..088ff87c 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -9,22 +9,26 @@ "lint": "next lint" }, "dependencies": { + "fumadocs-core": "^13.0.0", + "fumadocs-mdx": "10.0.0", + "fumadocs-ui": "^13.0.0", + "katex": "^0.16.27", "next": "^14.2.0", "react": "^18.3.0", "react-dom": "^18.3.0", - "fumadocs-core": "^13.0.0", - "fumadocs-ui": "^13.0.0", - "fumadocs-mdx": "10.0.0" + "rehype-katex": "^7.0.1", + "remark-gfm": "^4.0.1", + "remark-math": "^6.0.0" }, "devDependencies": { "@types/node": "^20.10.0", "@types/react": "^18.3.0", "@types/react-dom": "^18.3.0", - "typescript": "^5.3.0", + "autoprefixer": "^10.4.16", "eslint": "^8.0.0", "eslint-config-next": "^14.2.0", + "postcss": "^8.4.32", "tailwindcss": "^3.4.0", - "autoprefixer": "^10.4.16", - "postcss": "^8.4.32" + "typescript": "^5.3.0" } } diff --git a/apps/site/source.config.ts b/apps/site/source.config.ts index 70ea589d..88715d19 100644 --- a/apps/site/source.config.ts +++ b/apps/site/source.config.ts @@ -1,7 +1,27 @@ import { defineDocs, defineConfig } from 'fumadocs-mdx/config'; +import { rehypeCode } from 'fumadocs-core/mdx-plugins'; +import remarkGfm from 'remark-gfm'; +import remarkMath from 'remark-math'; +import rehypeKatex from 'rehype-katex'; export const { docs, meta } = defineDocs({ dir: 'content/docs', }); -export default defineConfig({}); +export default defineConfig({ + mdxOptions: { + remarkPlugins: [ + remarkGfm, // GitHub Flavored Markdown (tables, strikethrough, task lists, etc.) + remarkMath, // Math equations support + ], + rehypePlugins: [ + rehypeKatex, // Render math equations + [rehypeCode, { + themes: { + light: 'github-light', + dark: 'github-dark', + }, + }], + ], + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 076c7795..fcaba263 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,6 +81,9 @@ importers: fumadocs-ui: specifier: ^13.0.0 version: 13.4.10(@types/react-dom@18.3.7(@types/react@18.3.27))(@types/react@18.3.27)(next@14.2.35(@babel/core@7.28.6)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.19) + katex: + specifier: ^0.16.27 + version: 0.16.27 next: specifier: ^14.2.0 version: 14.2.35(@babel/core@7.28.6)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -90,6 +93,15 @@ importers: react-dom: specifier: ^18.3.0 version: 18.3.1(react@18.3.1) + rehype-katex: + specifier: ^7.0.1 + version: 7.0.1 + remark-gfm: + specifier: ^4.0.1 + version: 4.0.1 + remark-math: + specifier: ^6.0.0 + version: 6.0.0 devDependencies: '@types/node': specifier: ^20.10.0 @@ -2648,6 +2660,9 @@ packages: '@types/jsonfile@6.1.4': resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} + '@types/katex@0.16.8': + resolution: {integrity: sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg==} + '@types/linkify-it@5.0.0': resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==} @@ -3705,6 +3720,10 @@ packages: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} + commander@8.3.0: + resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} + engines: {node: '>= 12'} + commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} @@ -4765,6 +4784,24 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} 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-is-element@3.0.0: + resolution: {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: {integrity: sha512-48+B/rJWAp0jamNbAAf9M7Uf//UVqAoMmgXhBdxTDJLGKY+LRnZ99qcG+Qjl5HfMpYNzS5v4EAwVEF34LeAj7w==} @@ -4777,9 +4814,15 @@ packages: hast-util-to-string@3.0.1: resolution: {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==} + hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -5527,6 +5570,10 @@ packages: resolution: {integrity: sha512-ClEvAj3K68y8uKhub3RgTmcRPo5DfIWvtxqrKQdDPyZ1UVHIIKvVvjrAsJFSVL5wjv0rt5iH9SMCZ0XRKNzeUA==} engines: {node: '>v0.4.10'} + katex@0.16.27: + resolution: {integrity: sha512-aeQoDkuRWSqQN6nSvVCEFvfXdqo1OQiCmmW1kc9xSdjutPv7BGO7pqY9sQRJpMOGrEdfDgF2TfRXe5eUAD2Waw==} + hasBin: true + keytar@7.9.0: resolution: {integrity: sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==} @@ -5786,6 +5833,9 @@ packages: mdast-util-gfm@3.1.0: resolution: {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: {integrity: sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==} @@ -5862,6 +5912,9 @@ packages: micromark-extension-gfm@3.0.0: resolution: {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: {integrity: sha512-dD/ADLJ1AeMvSAKBwO22zG22N4ybhe7kFIZ3LsDI0GlsNr2A3KYxb0LdC1u5rj4Nw+CHKY0RVdnHX8vj8ejm4Q==} @@ -6837,12 +6890,18 @@ packages: resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} + rehype-katex@7.0.1: + resolution: {integrity: sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA==} + rehype-recma@1.0.0: resolution: {integrity: sha512-lqA4rGUf1JmacCNWWZx0Wv1dHqMwxzsDWYMTowuplHF3xH0N/MmrZ/G3BDZnzAkRmxDadujCjaKM2hqYdCBOGw==} remark-gfm@4.0.1: resolution: {integrity: sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==} + remark-math@6.0.0: + resolution: {integrity: sha512-MMqgnP74Igy+S3WwnhQ7kqGlEerTETXMvJhrUzDikVZ2/uogJCb+WHUg97hK9/jcfc0dkD73s3LN8zU49cTEtA==} + remark-mdx@3.1.1: resolution: {integrity: sha512-Pjj2IYlUY3+D8x00UJsIOg5BEvfMyeI+2uLPn9VO9Wg4MEtN/VTIq2NEJQfde9PnX15KgtHyl9S0BcTnWrIuWg==} @@ -7375,6 +7434,7 @@ packages: tar@6.2.1: resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} engines: {node: '>=10'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exhorbitant rates) by contacting i@izs.me tarn@3.0.2: resolution: {integrity: sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ==} @@ -7640,6 +7700,9 @@ packages: unique-slug@2.0.2: resolution: {integrity: sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==} + unist-util-find-after@5.0.0: + resolution: {integrity: sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==} + unist-util-is@6.0.1: resolution: {integrity: sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==} @@ -7649,6 +7712,9 @@ packages: unist-util-position@5.0.0: resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} + unist-util-remove-position@5.0.0: + resolution: {integrity: sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==} + unist-util-stringify-position@4.0.0: resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} @@ -7749,6 +7815,9 @@ packages: resolution: {integrity: sha512-Ck0EJbAGxHwprkzFO966t4/5QkRuzh+/I1RxhLgUKKwEn+Cd8NwM60mE3AqBZg5gYODoXW0EFsQvbZjRlvdqbg==} engines: {node: '>=4'} + vfile-location@5.0.3: + resolution: {integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==} + vfile-message@4.0.3: resolution: {integrity: sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==} @@ -7853,6 +7922,9 @@ packages: walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + web-namespaces@2.0.1: + resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} + web-streams-polyfill@4.0.0-beta.3: resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==} engines: {node: '>= 14'} @@ -10322,6 +10394,8 @@ snapshots: dependencies: '@types/node': 20.19.29 + '@types/katex@0.16.8': {} + '@types/linkify-it@5.0.0': {} '@types/markdown-it@14.1.2': @@ -11569,6 +11643,8 @@ snapshots: commander@4.1.1: {} + commander@8.3.0: {} + commondir@1.0.1: {} component-emitter@1.3.1: {} @@ -12973,6 +13049,47 @@ 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-is-element@3.0.0: + 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 @@ -13032,10 +13149,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 + hookable@5.5.3: {} hosted-git-info@2.8.9: {} @@ -14206,6 +14338,10 @@ snapshots: promised-io: 0.3.6 walker: 1.0.8 + katex@0.16.27: + dependencies: + commander: 8.3.0 + keytar@7.9.0: dependencies: node-addon-api: 4.3.0 @@ -14510,6 +14646,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 @@ -14685,6 +14833,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.8 + devlop: 1.1.0 + katex: 0.16.27 + 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 @@ -15827,6 +15985,16 @@ snapshots: gopd: 1.2.0 set-function-name: 2.0.2 + rehype-katex@7.0.1: + dependencies: + '@types/hast': 3.0.4 + '@types/katex': 0.16.8 + hast-util-from-html-isomorphic: 2.0.0 + hast-util-to-text: 4.0.2 + katex: 0.16.27 + unist-util-visit-parents: 6.0.2 + vfile: 6.0.3 + rehype-recma@1.0.0: dependencies: '@types/estree': 1.0.8 @@ -15846,6 +16014,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 @@ -16829,6 +17006,11 @@ snapshots: imurmurhash: 0.1.4 optional: true + unist-util-find-after@5.0.0: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.1 + unist-util-is@6.0.1: dependencies: '@types/unist': 3.0.3 @@ -16841,6 +17023,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 @@ -16960,6 +17147,11 @@ snapshots: version-range@4.15.0: {} + 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 @@ -17059,6 +17251,8 @@ snapshots: dependencies: makeerror: 1.0.12 + web-namespaces@2.0.1: {} + web-streams-polyfill@4.0.0-beta.3: {} webidl-conversions@3.0.1: {} From 3a9349fbe88d159df8a9f652896996c70c352969 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:17:10 +0000 Subject: [PATCH 3/6] Enable advanced fumadocs UI features and enhanced navigation Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- apps/site/app/docs/[[...slug]]/page.tsx | 21 +++++- apps/site/app/layout.config.tsx | 24 +++++++ apps/site/package.json | 3 + apps/site/source.config.ts | 4 ++ pnpm-lock.yaml | 88 +++++++++++++++++++++++++ 5 files changed, 139 insertions(+), 1 deletion(-) diff --git a/apps/site/app/docs/[[...slug]]/page.tsx b/apps/site/app/docs/[[...slug]]/page.tsx index 04aabcaa..974979c3 100644 --- a/apps/site/app/docs/[[...slug]]/page.tsx +++ b/apps/site/app/docs/[[...slug]]/page.tsx @@ -15,7 +15,26 @@ export default async function Page({ const MDX = page.data.body; return ( - + + + Edit this page on GitHub → + + + ), + }} + > {page.data.title} {page.data.description} diff --git a/apps/site/app/layout.config.tsx b/apps/site/app/layout.config.tsx index 1efbbee3..b5d1db6f 100644 --- a/apps/site/app/layout.config.tsx +++ b/apps/site/app/layout.config.tsx @@ -13,4 +13,28 @@ export const baseOptions: Omit = { }, ], githubUrl: 'https://github.com/objectstack-ai/objectql', + // Enable sidebar search + sidebar: { + defaultOpenLevel: 0, + banner: ( +
+ ObjectQL Documentation +
+ ), + }, + // Enable table of contents + toc: { + enabled: true, + component: undefined, + }, + // Enable last updated timestamp + lastUpdate: { + enabled: true, + showTimestamp: true, + }, + // Enable edit on GitHub + editOnGithub: { + enabled: true, + base: 'https://github.com/objectstack-ai/objectql/blob/main/apps/site', + }, }; diff --git a/apps/site/package.json b/apps/site/package.json index 088ff87c..6567e8e3 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -16,7 +16,10 @@ "next": "^14.2.0", "react": "^18.3.0", "react-dom": "^18.3.0", + "rehype-autolink-headings": "^7.1.0", "rehype-katex": "^7.0.1", + "rehype-slug": "^6.0.0", + "remark-frontmatter": "^5.0.0", "remark-gfm": "^4.0.1", "remark-math": "^6.0.0" }, diff --git a/apps/site/source.config.ts b/apps/site/source.config.ts index 88715d19..0ed039e7 100644 --- a/apps/site/source.config.ts +++ b/apps/site/source.config.ts @@ -3,6 +3,8 @@ import { rehypeCode } from 'fumadocs-core/mdx-plugins'; import remarkGfm from 'remark-gfm'; import remarkMath from 'remark-math'; import rehypeKatex from 'rehype-katex'; +import rehypeSlug from 'rehype-slug'; +import rehypeAutolinkHeadings from 'rehype-autolink-headings'; export const { docs, meta } = defineDocs({ dir: 'content/docs', @@ -15,6 +17,8 @@ export default defineConfig({ remarkMath, // Math equations support ], rehypePlugins: [ + rehypeSlug, // Add IDs to headings + [rehypeAutolinkHeadings, { behavior: 'wrap' }], // Add links to headings rehypeKatex, // Render math equations [rehypeCode, { themes: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fcaba263..099757d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -93,9 +93,18 @@ importers: react-dom: specifier: ^18.3.0 version: 18.3.1(react@18.3.1) + rehype-autolink-headings: + specifier: ^7.1.0 + version: 7.1.0 rehype-katex: specifier: ^7.0.1 version: 7.0.1 + rehype-slug: + specifier: ^6.0.0 + version: 6.0.0 + remark-frontmatter: + specifier: ^5.0.0 + version: 5.0.0 remark-gfm: specifier: ^4.0.1 version: 4.0.1 @@ -4445,6 +4454,9 @@ packages: fastq@1.20.1: resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} + fault@2.0.1: + resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==} + fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} @@ -4538,6 +4550,10 @@ packages: resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} engines: {node: '>= 6'} + format@0.2.2: + resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} + engines: {node: '>=0.4.x'} + formdata-node@4.4.1: resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==} engines: {node: '>= 12.20'} @@ -4796,6 +4812,9 @@ packages: hast-util-from-parse5@8.0.3: resolution: {integrity: sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==} + hast-util-heading-rank@3.0.0: + resolution: {integrity: sha512-EJKb8oMUXVHcWZTDepnr+WNbfnXKFNf9duMesmr4S8SXTJBJ9M4Yok08pu9vxdJwdlGRhVumk9mEhkEvKGifwA==} + hast-util-is-element@3.0.0: resolution: {integrity: sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==} @@ -5815,6 +5834,9 @@ packages: mdast-util-from-markdown@2.0.2: resolution: {integrity: sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==} + mdast-util-frontmatter@2.0.1: + resolution: {integrity: sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==} + mdast-util-gfm-autolink-literal@2.0.1: resolution: {integrity: sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==} @@ -5891,6 +5913,9 @@ packages: micromark-core-commonmark@2.0.3: resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==} + micromark-extension-frontmatter@2.0.0: + resolution: {integrity: sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==} + micromark-extension-gfm-autolink-literal@2.1.0: resolution: {integrity: sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==} @@ -6890,12 +6915,21 @@ packages: resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} + rehype-autolink-headings@7.1.0: + resolution: {integrity: sha512-rItO/pSdvnvsP4QRB1pmPiNHUskikqtPojZKJPPPAVx9Hj8i8TwMBhofrrAYRhYOOBZH9tgmG5lPqDLuIWPWmw==} + rehype-katex@7.0.1: resolution: {integrity: sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA==} rehype-recma@1.0.0: resolution: {integrity: sha512-lqA4rGUf1JmacCNWWZx0Wv1dHqMwxzsDWYMTowuplHF3xH0N/MmrZ/G3BDZnzAkRmxDadujCjaKM2hqYdCBOGw==} + rehype-slug@6.0.0: + resolution: {integrity: sha512-lWyvf/jwu+oS5+hL5eClVd3hNdmwM1kAC0BUvEGD19pajQMIzcNUd/k9GsfQ+FfECvX+JE+e9/btsKH0EjJT6A==} + + remark-frontmatter@5.0.0: + resolution: {integrity: sha512-XTFYvNASMe5iPN0719nPrdItC9aU0ssC4v14mH1BCi1u0n1gAocqcujWUrByftZTbLhRtiKRyjYTSIOcr69UVQ==} + remark-gfm@4.0.1: resolution: {integrity: sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==} @@ -12630,6 +12664,10 @@ snapshots: dependencies: reusify: 1.1.0 + fault@2.0.1: + dependencies: + format: 0.2.2 + fb-watchman@2.0.2: dependencies: bser: 2.1.1 @@ -12730,6 +12768,8 @@ snapshots: hasown: 2.0.2 mime-types: 2.1.35 + format@0.2.2: {} + formdata-node@4.4.1: dependencies: node-domexception: 1.0.0 @@ -13082,6 +13122,10 @@ snapshots: vfile-location: 5.0.3 web-namespaces: 2.0.1 + hast-util-heading-rank@3.0.0: + dependencies: + '@types/hast': 3.0.4 + hast-util-is-element@3.0.0: dependencies: '@types/hast': 3.0.4 @@ -14589,6 +14633,17 @@ snapshots: transitivePeerDependencies: - supports-color + mdast-util-frontmatter@2.0.1: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + escape-string-regexp: 5.0.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + micromark-extension-frontmatter: 2.0.0 + transitivePeerDependencies: + - supports-color + mdast-util-gfm-autolink-literal@2.0.1: dependencies: '@types/mdast': 4.0.4 @@ -14775,6 +14830,13 @@ snapshots: micromark-util-symbol: 2.0.1 micromark-util-types: 2.0.2 + micromark-extension-frontmatter@2.0.0: + dependencies: + fault: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.2 + micromark-extension-gfm-autolink-literal@2.1.0: dependencies: micromark-util-character: 2.1.1 @@ -15985,6 +16047,15 @@ snapshots: gopd: 1.2.0 set-function-name: 2.0.2 + rehype-autolink-headings@7.1.0: + dependencies: + '@types/hast': 3.0.4 + '@ungap/structured-clone': 1.3.0 + hast-util-heading-rank: 3.0.0 + hast-util-is-element: 3.0.0 + unified: 11.0.5 + unist-util-visit: 5.0.0 + rehype-katex@7.0.1: dependencies: '@types/hast': 3.0.4 @@ -16003,6 +16074,23 @@ snapshots: transitivePeerDependencies: - supports-color + rehype-slug@6.0.0: + dependencies: + '@types/hast': 3.0.4 + github-slugger: 2.0.0 + hast-util-heading-rank: 3.0.0 + hast-util-to-string: 3.0.1 + unist-util-visit: 5.0.0 + + remark-frontmatter@5.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-frontmatter: 2.0.1 + micromark-extension-frontmatter: 2.0.0 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + remark-gfm@4.0.1: dependencies: '@types/mdast': 4.0.4 From 166df9623bb1c8504d1785b0fb9e0884c6b90a8c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:20:11 +0000 Subject: [PATCH 4/6] Add fumadocs features demo page showcasing all enabled features Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- apps/site/content/docs/features-demo.mdx | 111 +++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 apps/site/content/docs/features-demo.mdx diff --git a/apps/site/content/docs/features-demo.mdx b/apps/site/content/docs/features-demo.mdx new file mode 100644 index 00000000..8bca516f --- /dev/null +++ b/apps/site/content/docs/features-demo.mdx @@ -0,0 +1,111 @@ +--- +title: Fumadocs Features Demo +description: Demonstration of enabled fumadocs features +--- + +## GitHub Flavored Markdown + +### Tables + +| Feature | Status | Description | +|---------|--------|-------------| +| GFM Tables | ✅ Enabled | Support for GitHub Flavored Markdown tables | +| Math Equations | ✅ Enabled | LaTeX math rendering with KaTeX | +| Code Highlighting | ✅ Enabled | Syntax highlighting with themes | +| Anchor Links | ✅ Enabled | Automatic heading anchors | + +### Task Lists + +- [x] Install fumadocs dependencies +- [x] Configure MDX plugins +- [x] Enable enhanced code highlighting +- [ ] Add more content examples + +### Strikethrough + +~~This text has been deprecated~~ Use the new API instead. + +## Math Equations + +Fumadocs now supports LaTeX math equations! + +### Inline Math + +The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$. + +### Block Math + +$$ +E = mc^2 +$$ + +$$ +\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi} +$$ + +### Complex Equations + +The Schrödinger equation: + +$$ +i\hbar\frac{\partial}{\partial t}\Psi(\mathbf{r},t) = \hat{H}\Psi(\mathbf{r},t) +$$ + +## Code Highlighting + +### TypeScript Example + +```typescript +import { ObjectQL } from '@objectql/core'; + +interface User { + id: string; + name: string; + email: string; +} + +async function getUser(id: string): Promise { + const user = await ObjectQL.findOne('users', { _id: id }); + return user as User; +} +``` + +### Python Example + +```python +def fibonacci(n): + """Calculate the nth Fibonacci number.""" + if n <= 1: + return n + return fibonacci(n-1) + fibonacci(n-2) + +# Usage +result = fibonacci(10) +print(f"The 10th Fibonacci number is {result}") +``` + +### Bash Example + +```bash +# Install ObjectQL +pnpm add @objectql/core + +# Run development server +pnpm dev +``` + +## Blockquotes + +> **Note**: This is an important note about ObjectQL. +> +> It supports multiple lines and **formatted text**. + +> **Warning**: Be careful when modifying production data! + +## Links and Navigation + +- Jump to [Tables](#tables) +- Go to [Math Equations](#math-equations) +- Check out [Code Highlighting](#code-highlighting) + +All headings now have automatic anchor links! From fdf48183614ca0b14dfc6e17f1ccee1ccd30a9c0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:22:27 +0000 Subject: [PATCH 5/6] Consolidate TOC configuration and address code review feedback Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- apps/site/app/docs/[[...slug]]/page.tsx | 15 --------------- apps/site/app/layout.config.tsx | 13 ++++++++++++- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/apps/site/app/docs/[[...slug]]/page.tsx b/apps/site/app/docs/[[...slug]]/page.tsx index 974979c3..c9fbb7b0 100644 --- a/apps/site/app/docs/[[...slug]]/page.tsx +++ b/apps/site/app/docs/[[...slug]]/page.tsx @@ -19,21 +19,6 @@ export default async function Page({ toc={page.data.toc} full={page.data.full} lastUpdate={page.data.lastModified} - tableOfContent={{ - enabled: true, - footer: ( - - ), - }} > {page.data.title} {page.data.description} diff --git a/apps/site/app/layout.config.tsx b/apps/site/app/layout.config.tsx index b5d1db6f..7b97d640 100644 --- a/apps/site/app/layout.config.tsx +++ b/apps/site/app/layout.config.tsx @@ -25,7 +25,18 @@ export const baseOptions: Omit = { // Enable table of contents toc: { enabled: true, - component: undefined, + footer: ( + + ), }, // Enable last updated timestamp lastUpdate: { From edd23d16bf0a5254b368e2c7bc5a91893465cabe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=80=A1?= Date: Tue, 20 Jan 2026 22:32:04 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=20features-demo.mdx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/site/content/docs/features-demo.mdx | 111 ----------------------- 1 file changed, 111 deletions(-) delete mode 100644 apps/site/content/docs/features-demo.mdx diff --git a/apps/site/content/docs/features-demo.mdx b/apps/site/content/docs/features-demo.mdx deleted file mode 100644 index 8bca516f..00000000 --- a/apps/site/content/docs/features-demo.mdx +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: Fumadocs Features Demo -description: Demonstration of enabled fumadocs features ---- - -## GitHub Flavored Markdown - -### Tables - -| Feature | Status | Description | -|---------|--------|-------------| -| GFM Tables | ✅ Enabled | Support for GitHub Flavored Markdown tables | -| Math Equations | ✅ Enabled | LaTeX math rendering with KaTeX | -| Code Highlighting | ✅ Enabled | Syntax highlighting with themes | -| Anchor Links | ✅ Enabled | Automatic heading anchors | - -### Task Lists - -- [x] Install fumadocs dependencies -- [x] Configure MDX plugins -- [x] Enable enhanced code highlighting -- [ ] Add more content examples - -### Strikethrough - -~~This text has been deprecated~~ Use the new API instead. - -## Math Equations - -Fumadocs now supports LaTeX math equations! - -### Inline Math - -The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$. - -### Block Math - -$$ -E = mc^2 -$$ - -$$ -\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi} -$$ - -### Complex Equations - -The Schrödinger equation: - -$$ -i\hbar\frac{\partial}{\partial t}\Psi(\mathbf{r},t) = \hat{H}\Psi(\mathbf{r},t) -$$ - -## Code Highlighting - -### TypeScript Example - -```typescript -import { ObjectQL } from '@objectql/core'; - -interface User { - id: string; - name: string; - email: string; -} - -async function getUser(id: string): Promise { - const user = await ObjectQL.findOne('users', { _id: id }); - return user as User; -} -``` - -### Python Example - -```python -def fibonacci(n): - """Calculate the nth Fibonacci number.""" - if n <= 1: - return n - return fibonacci(n-1) + fibonacci(n-2) - -# Usage -result = fibonacci(10) -print(f"The 10th Fibonacci number is {result}") -``` - -### Bash Example - -```bash -# Install ObjectQL -pnpm add @objectql/core - -# Run development server -pnpm dev -``` - -## Blockquotes - -> **Note**: This is an important note about ObjectQL. -> -> It supports multiple lines and **formatted text**. - -> **Warning**: Be careful when modifying production data! - -## Links and Navigation - -- Jump to [Tables](#tables) -- Go to [Math Equations](#math-equations) -- Check out [Code Highlighting](#code-highlighting) - -All headings now have automatic anchor links!