@vercel/geistdocs 1.2.3 → 1.3.0-canary.41d37f1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +3 -0
- package/dist/components/callout.d.ts +12 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +7 -0
- package/dist/components/code-block-tabs.d.ts +7 -0
- package/dist/components/code-block-tabs.d.ts.map +1 -0
- package/dist/components/code-block-tabs.js +7 -0
- package/dist/components/code-block.d.ts +14 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +41 -0
- package/dist/components/mermaid.d.ts +4 -0
- package/dist/components/mermaid.d.ts.map +1 -0
- package/dist/components/mermaid.js +44 -0
- package/dist/components/theme-aware-image.d.ts +12 -0
- package/dist/components/theme-aware-image.d.ts.map +1 -0
- package/dist/components/theme-aware-image.js +8 -0
- package/dist/components/video.d.ts +6 -0
- package/dist/components/video.d.ts.map +1 -0
- package/dist/components/video.js +3 -0
- package/dist/config.d.ts +52 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/controls.d.ts +15 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/controls.js +52 -0
- package/dist/internal/chat/context.d.ts +19 -0
- package/dist/internal/chat/context.d.ts.map +1 -0
- package/dist/internal/chat/context.js +36 -0
- package/dist/internal/chat/conversation.d.ts +10 -0
- package/dist/internal/chat/conversation.d.ts.map +1 -0
- package/dist/internal/chat/conversation.js +16 -0
- package/dist/internal/chat/copy-chat.d.ts +5 -0
- package/dist/internal/chat/copy-chat.d.ts.map +1 -0
- package/dist/internal/chat/copy-chat.js +35 -0
- package/dist/internal/chat/db.d.ts +13 -0
- package/dist/internal/chat/db.d.ts.map +1 -0
- package/dist/internal/chat/db.js +19 -0
- package/dist/internal/chat/message-metadata.d.ts +8 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -0
- package/dist/internal/chat/message-metadata.js +29 -0
- package/dist/internal/chat/message.d.ts +11 -0
- package/dist/internal/chat/message.d.ts.map +1 -0
- package/dist/internal/chat/message.js +11 -0
- package/dist/internal/chat/prompt-input.d.ts +13 -0
- package/dist/internal/chat/prompt-input.d.ts.map +1 -0
- package/dist/internal/chat/prompt-input.js +39 -0
- package/dist/internal/chat/shell.d.ts +2 -0
- package/dist/internal/chat/shell.d.ts.map +1 -0
- package/dist/internal/chat/shell.js +194 -0
- package/dist/internal/chat/shimmer.d.ts +11 -0
- package/dist/internal/chat/shimmer.d.ts.map +1 -0
- package/dist/internal/chat/shimmer.js +18 -0
- package/dist/internal/chat/sources.d.ts +13 -0
- package/dist/internal/chat/sources.d.ts.map +1 -0
- package/dist/internal/chat/sources.js +9 -0
- package/dist/internal/chat/suggestion.d.ts +11 -0
- package/dist/internal/chat/suggestion.d.ts.map +1 -0
- package/dist/internal/chat/suggestion.js +12 -0
- package/dist/internal/cn.d.ts +3 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/cn.js +3 -0
- package/dist/internal/feedback-action.d.ts +14 -0
- package/dist/internal/feedback-action.d.ts.map +1 -0
- package/dist/internal/feedback-action.js +34 -0
- package/dist/internal/i18n.d.ts +6 -0
- package/dist/internal/i18n.d.ts.map +1 -0
- package/dist/internal/i18n.js +18 -0
- package/dist/internal/languages.d.ts +7 -0
- package/dist/internal/languages.d.ts.map +1 -0
- package/dist/internal/languages.js +18 -0
- package/dist/internal/not-implemented.d.ts +2 -0
- package/dist/internal/not-implemented.d.ts.map +1 -0
- package/dist/internal/not-implemented.js +4 -0
- package/dist/internal/page-actions-client.d.ts +14 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -0
- package/dist/internal/page-actions-client.js +154 -0
- package/dist/internal/page-actions.d.ts +18 -0
- package/dist/internal/page-actions.d.ts.map +1 -0
- package/dist/internal/page-actions.js +4 -0
- package/dist/internal/search.d.ts +5 -0
- package/dist/internal/search.d.ts.map +1 -0
- package/dist/internal/search.js +14 -0
- package/dist/internal/sidebar.d.ts +6 -0
- package/dist/internal/sidebar.d.ts.map +1 -0
- package/dist/internal/sidebar.js +37 -0
- package/dist/internal/ui/button-group.d.ts +13 -0
- package/dist/internal/ui/button-group.d.ts.map +1 -0
- package/dist/internal/ui/button-group.js +26 -0
- package/dist/internal/ui/button.d.ts +12 -0
- package/dist/internal/ui/button.d.ts.map +1 -0
- package/dist/internal/ui/button.js +33 -0
- package/dist/internal/ui/card.d.ts +6 -0
- package/dist/internal/ui/card.d.ts.map +1 -0
- package/dist/internal/ui/card.js +14 -0
- package/dist/internal/ui/collapsible.d.ts +6 -0
- package/dist/internal/ui/collapsible.d.ts.map +1 -0
- package/dist/internal/ui/collapsible.js +12 -0
- package/dist/internal/ui/drawer.d.ts +6 -0
- package/dist/internal/ui/drawer.d.ts.map +1 -0
- package/dist/internal/ui/drawer.js +13 -0
- package/dist/internal/ui/dropdown-menu.d.ts +22 -0
- package/dist/internal/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/internal/ui/dropdown-menu.js +41 -0
- package/dist/internal/ui/input-group.d.ts +15 -0
- package/dist/internal/ui/input-group.d.ts.map +1 -0
- package/dist/internal/ui/input-group.js +44 -0
- package/dist/internal/ui/input.d.ts +3 -0
- package/dist/internal/ui/input.d.ts.map +1 -0
- package/dist/internal/ui/input.js +5 -0
- package/dist/internal/ui/kbd.d.ts +4 -0
- package/dist/internal/ui/kbd.d.ts.map +1 -0
- package/dist/internal/ui/kbd.js +8 -0
- package/dist/internal/ui/popover.d.ts +6 -0
- package/dist/internal/ui/popover.d.ts.map +1 -0
- package/dist/internal/ui/popover.js +13 -0
- package/dist/internal/ui/scroll-area.d.ts +5 -0
- package/dist/internal/ui/scroll-area.d.ts.map +1 -0
- package/dist/internal/ui/scroll-area.js +12 -0
- package/dist/internal/ui/separator.d.ts +4 -0
- package/dist/internal/ui/separator.d.ts.map +1 -0
- package/dist/internal/ui/separator.js +7 -0
- package/dist/internal/ui/sheet.d.ts +10 -0
- package/dist/internal/ui/sheet.d.ts.map +1 -0
- package/dist/internal/ui/sheet.js +24 -0
- package/dist/internal/ui/sonner.d.ts +3 -0
- package/dist/internal/ui/sonner.d.ts.map +1 -0
- package/dist/internal/ui/sonner.js +20 -0
- package/dist/internal/ui/spinner.d.ts +3 -0
- package/dist/internal/ui/spinner.d.ts.map +1 -0
- package/dist/internal/ui/spinner.js +6 -0
- package/dist/internal/ui/textarea.d.ts +3 -0
- package/dist/internal/ui/textarea.d.ts.map +1 -0
- package/dist/internal/ui/textarea.js +5 -0
- package/dist/internal/ui/tooltip.d.ts +7 -0
- package/dist/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/internal/ui/tooltip.js +16 -0
- package/dist/internal/use-mobile.d.ts +2 -0
- package/dist/internal/use-mobile.d.ts.map +1 -0
- package/dist/internal/use-mobile.js +16 -0
- package/dist/layout.d.ts +18 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +49 -0
- package/dist/mdx.d.ts +36 -0
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +72 -0
- package/dist/pages/docs.d.ts +55 -0
- package/dist/pages/docs.d.ts.map +1 -0
- package/dist/pages/docs.js +63 -0
- package/dist/proxy.d.ts +21 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +109 -0
- package/dist/routes/chat.d.ts +13 -0
- package/dist/routes/chat.d.ts.map +1 -0
- package/dist/routes/chat.js +229 -0
- package/dist/routes/llms.d.ts +33 -0
- package/dist/routes/llms.d.ts.map +1 -0
- package/dist/routes/llms.js +39 -0
- package/dist/routes/search.d.ts +10 -0
- package/dist/routes/search.d.ts.map +1 -0
- package/dist/routes/search.js +33 -0
- package/dist/routes/sitemap.d.ts +35 -0
- package/dist/routes/sitemap.d.ts.map +1 -0
- package/dist/routes/sitemap.js +150 -0
- package/dist/source.d.ts +30 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +72 -0
- package/package.json +129 -9
- package/styles.css +193 -0
- package/template/_gitignore +1 -0
- package/template/app/[lang]/(home)/components/centered-section.tsx +26 -0
- package/template/app/[lang]/(home)/components/cta.tsx +19 -0
- package/template/app/[lang]/(home)/components/hero.tsx +27 -0
- package/template/app/[lang]/(home)/components/one-two-section.tsx +25 -0
- package/template/app/[lang]/(home)/components/templates.tsx +50 -0
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +20 -0
- package/template/app/[lang]/(home)/layout.tsx +14 -0
- package/template/app/[lang]/(home)/page.tsx +126 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +19 -0
- package/template/app/[lang]/docs/layout.tsx +14 -0
- package/template/app/[lang]/layout.tsx +29 -0
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +7 -0
- package/template/app/[lang]/llms.txt/route.ts +6 -0
- package/template/app/[lang]/og/[...slug]/background.png +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-regular.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-semibold.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/route.tsx +95 -0
- package/template/app/[lang]/rss.xml/route.ts +52 -0
- package/template/app/[lang]/sitemap.md/route.ts +9 -0
- package/template/app/actions/feedback/emotions.ts +18 -0
- package/template/app/actions/feedback/index.ts +45 -0
- package/template/app/api/chat/route.ts +8 -0
- package/template/app/api/search/route.ts +5 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/global.css +2 -0
- package/template/app/robots.ts +14 -0
- package/template/app/sitemap.ts +36 -0
- package/template/app/styles/geistdocs.css +553 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right-small.tsx +35 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-check.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-down-small.tsx +30 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-right.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-copy.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-file-text.tsx +25 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-menu-alt.tsx +27 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-slash-forward.tsx +36 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/index.tsx +11 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/index.tsx +14 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-elements.tsx +29 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-sdk.tsx +38 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-chat-sdk.tsx +42 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-flags-sdk.tsx +42 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-icon-vercel.tsx +31 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-streamdown.tsx +29 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-vercel-oss.tsx +24 -0
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-workflow-sdk.tsx +73 -0
- package/template/components/geistdocs/callout.tsx +40 -0
- package/template/components/geistdocs/chat.tsx +24 -0
- package/template/components/geistdocs/code-block-tabs.tsx +61 -0
- package/template/components/geistdocs/code-block.tsx +134 -0
- package/template/components/geistdocs/copy-page.tsx +27 -0
- package/template/components/geistdocs/desktop-menu.tsx +52 -0
- package/template/components/geistdocs/docs-layout.tsx +20 -0
- package/template/components/geistdocs/docs-page.tsx +35 -0
- package/template/components/geistdocs/edit-source.tsx +30 -0
- package/template/components/geistdocs/feedback.tsx +139 -0
- package/template/components/geistdocs/footer.tsx +30 -0
- package/template/components/geistdocs/github-button.tsx +19 -0
- package/template/components/geistdocs/home-layout.tsx +46 -0
- package/template/components/geistdocs/icons.tsx +13 -0
- package/template/components/geistdocs/installer.tsx +58 -0
- package/template/components/geistdocs/language-selector.tsx +3 -0
- package/template/components/geistdocs/mdx-components.tsx +5 -0
- package/template/components/geistdocs/mermaid.tsx +68 -0
- package/template/components/geistdocs/mobile-docs-bar.tsx +81 -0
- package/template/components/geistdocs/mobile-menu.tsx +150 -0
- package/template/components/geistdocs/navbar-logo.tsx +124 -0
- package/template/components/geistdocs/navbar.tsx +22 -0
- package/template/components/geistdocs/provider.tsx +31 -0
- package/template/components/geistdocs/rss-button.tsx +10 -0
- package/template/components/geistdocs/scroll-top.tsx +21 -0
- package/template/components/geistdocs/search.tsx +17 -0
- package/template/components/geistdocs/sidebar.tsx +128 -0
- package/template/components/geistdocs/theme-aware-image.tsx +22 -0
- package/template/components/geistdocs/theme-toggle.tsx +3 -0
- package/template/components/geistdocs/video.tsx +16 -0
- package/template/components/ui/badge.tsx +46 -0
- package/template/components/ui/button-group.tsx +83 -0
- package/template/components/ui/button.tsx +60 -0
- package/template/components/ui/card.tsx +92 -0
- package/template/components/ui/collapsible.tsx +33 -0
- package/template/components/ui/command-prompt.tsx +488 -0
- package/template/components/ui/command.tsx +184 -0
- package/template/components/ui/dialog.tsx +143 -0
- package/template/components/ui/drawer.tsx +135 -0
- package/template/components/ui/dropdown-menu.tsx +257 -0
- package/template/components/ui/hover-card.tsx +44 -0
- package/template/components/ui/input-group.tsx +170 -0
- package/template/components/ui/input.tsx +21 -0
- package/template/components/ui/kbd.tsx +28 -0
- package/template/components/ui/navigation-menu.tsx +192 -0
- package/template/components/ui/popover.tsx +48 -0
- package/template/components/ui/scroll-area.tsx +58 -0
- package/template/components/ui/select.tsx +187 -0
- package/template/components/ui/separator.tsx +28 -0
- package/template/components/ui/sheet.tsx +139 -0
- package/template/components/ui/sonner.tsx +40 -0
- package/template/components/ui/spinner.tsx +16 -0
- package/template/components/ui/textarea.tsx +18 -0
- package/template/components/ui/tooltip.tsx +61 -0
- package/template/components.json +22 -0
- package/template/content/docs/ask-ai.cn.mdx +85 -0
- package/template/content/docs/ask-ai.mdx +85 -0
- package/template/content/docs/configuration.cn.mdx +115 -0
- package/template/content/docs/configuration.mdx +115 -0
- package/template/content/docs/deployment.cn.mdx +34 -0
- package/template/content/docs/deployment.mdx +34 -0
- package/template/content/docs/edit-on-github.cn.mdx +47 -0
- package/template/content/docs/edit-on-github.mdx +47 -0
- package/template/content/docs/env.cn.mdx +25 -0
- package/template/content/docs/env.mdx +25 -0
- package/template/content/docs/feedback.cn.mdx +85 -0
- package/template/content/docs/feedback.mdx +85 -0
- package/template/content/docs/getting-started.cn.mdx +86 -0
- package/template/content/docs/getting-started.mdx +86 -0
- package/template/content/docs/index.cn.mdx +54 -0
- package/template/content/docs/index.mdx +87 -0
- package/template/content/docs/internationalization.cn.mdx +113 -0
- package/template/content/docs/internationalization.mdx +117 -0
- package/template/content/docs/llms-txt.cn.mdx +50 -0
- package/template/content/docs/llms-txt.mdx +50 -0
- package/template/content/docs/md.cn.mdx +68 -0
- package/template/content/docs/md.mdx +68 -0
- package/template/content/docs/meta.json +21 -0
- package/template/content/docs/open-in-chat.cn.mdx +78 -0
- package/template/content/docs/open-in-chat.mdx +78 -0
- package/template/content/docs/provider.cn.mdx +69 -0
- package/template/content/docs/provider.mdx +69 -0
- package/template/content/docs/rss.cn.mdx +104 -0
- package/template/content/docs/rss.mdx +104 -0
- package/template/content/docs/syntax.cn.mdx +416 -0
- package/template/content/docs/syntax.mdx +407 -0
- package/template/content/docs/theme-aware-image.mdx +53 -0
- package/template/geistdocs.tsx +51 -0
- package/template/hooks/geistdocs/use-sidebar.ts +13 -0
- package/template/hooks/use-mobile.ts +19 -0
- package/template/lib/geistdocs/config.tsx +27 -0
- package/template/lib/geistdocs/fonts.ts +18 -0
- package/template/lib/geistdocs/i18n.ts +13 -0
- package/template/lib/geistdocs/md-tracking.ts +56 -0
- package/template/lib/geistdocs/source.ts +12 -0
- package/template/lib/utils.ts +6 -0
- package/template/next.config.ts +22 -0
- package/template/package.json +63 -0
- package/template/postcss.config.mjs +5 -0
- package/template/proxy.ts +16 -0
- package/template/source.config.ts +62 -0
- package/template/tsconfig.json +37 -0
- package/dist/index.js +0 -2
- /package/dist/{index.d.ts → cli/index.d.ts} +0 -0
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 语法
|
|
3
|
+
description: 了解受支持的 Markdown 语法和格式选项
|
|
4
|
+
type: reference
|
|
5
|
+
summary: 支持的 MDX 语法,包括文本格式、代码块、行高亮和 Mermaid 图表。
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/getting-started
|
|
8
|
+
related:
|
|
9
|
+
- /docs/configuration
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Geistdocs 支持 MDX,这是 Markdown 的超集,允许您在文档中使用 JSX 组件。本指南涵盖所有可用的格式选项。
|
|
13
|
+
|
|
14
|
+
## Frontmatter
|
|
15
|
+
|
|
16
|
+
每个 MDX 文件应在顶部包含 frontmatter:
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
---
|
|
20
|
+
title: Page Title
|
|
21
|
+
description: A brief description of the page content
|
|
22
|
+
---
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`title` 属性为必填,用于页面标题和导航。`description` 用于 SEO 和页面预览。
|
|
26
|
+
|
|
27
|
+
## Basic Markdown
|
|
28
|
+
|
|
29
|
+
### 文本格式
|
|
30
|
+
|
|
31
|
+
您可以使用标准 Markdown 语法来设置文本样式:
|
|
32
|
+
|
|
33
|
+
- **加粗文本** 使用 `**double asterisks**`
|
|
34
|
+
- _斜体文本_ 使用 `*single asterisks*`
|
|
35
|
+
- ~~删除线~~ 使用 `~~double tildes~~`
|
|
36
|
+
- `行内代码` 使用 `` `backticks` ``
|
|
37
|
+
|
|
38
|
+
### 标题
|
|
39
|
+
|
|
40
|
+
使用 `#` 符号创建标题:
|
|
41
|
+
|
|
42
|
+
```md
|
|
43
|
+
# Heading 1
|
|
44
|
+
|
|
45
|
+
## Heading 2
|
|
46
|
+
|
|
47
|
+
### Heading 3
|
|
48
|
+
|
|
49
|
+
#### Heading 4
|
|
50
|
+
|
|
51
|
+
##### Heading 5
|
|
52
|
+
|
|
53
|
+
###### Heading 6
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
标题会自动生成锚点链接,便于导航和深度链接。
|
|
57
|
+
|
|
58
|
+
### 列表
|
|
59
|
+
|
|
60
|
+
使用 `-`、`*` 或 `+` 创建无序列表:
|
|
61
|
+
|
|
62
|
+
- 第一项
|
|
63
|
+
- 第二项
|
|
64
|
+
- 嵌套项
|
|
65
|
+
- 另一个嵌套项
|
|
66
|
+
- 第三项
|
|
67
|
+
|
|
68
|
+
使用数字创建有序列表:
|
|
69
|
+
|
|
70
|
+
1. 第一步
|
|
71
|
+
2. 第二步
|
|
72
|
+
3. 第三步
|
|
73
|
+
|
|
74
|
+
### 引用
|
|
75
|
+
|
|
76
|
+
使用 `>` 创建引用:
|
|
77
|
+
|
|
78
|
+
> 这是一个引用。您可以用它来突出重要信息或引用外部来源。
|
|
79
|
+
|
|
80
|
+
### 链接
|
|
81
|
+
|
|
82
|
+
使用 `[text](url)` 创建链接:
|
|
83
|
+
|
|
84
|
+
- [外部链接](https://vercel.com)
|
|
85
|
+
- [内部链接](/docs/getting-started)
|
|
86
|
+
|
|
87
|
+
### 图片
|
|
88
|
+
|
|
89
|
+
使用 `` 添加图片:
|
|
90
|
+
|
|
91
|
+
```md
|
|
92
|
+

|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## GitHub Flavored Markdown
|
|
96
|
+
|
|
97
|
+
Geistdocs 支持 GFM 扩展,包括表格、任务列表和自动链接。
|
|
98
|
+
|
|
99
|
+
### 表格
|
|
100
|
+
|
|
101
|
+
使用竖线和短横线创建表格:
|
|
102
|
+
|
|
103
|
+
```md
|
|
104
|
+
| Feature | Description | Status |
|
|
105
|
+
| -------- | ----------------- | --------- |
|
|
106
|
+
| Markdown | Basic formatting | Supported |
|
|
107
|
+
| GFM | GitHub extensions | Supported |
|
|
108
|
+
| MDX | JSX in Markdown | Supported |
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
渲染为:
|
|
112
|
+
|
|
113
|
+
| Feature | Description | Status |
|
|
114
|
+
| -------- | ----------------- | --------- |
|
|
115
|
+
| Markdown | Basic formatting | Supported |
|
|
116
|
+
| GFM | GitHub extensions | Supported |
|
|
117
|
+
| MDX | JSX in Markdown | Supported |
|
|
118
|
+
|
|
119
|
+
### 任务列表
|
|
120
|
+
|
|
121
|
+
创建交互式任务列表:
|
|
122
|
+
|
|
123
|
+
```md
|
|
124
|
+
- [x] Completed task
|
|
125
|
+
- [ ] Incomplete task
|
|
126
|
+
- [ ] Another task to do
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
渲染为:
|
|
130
|
+
|
|
131
|
+
- [x] 已完成任务
|
|
132
|
+
- [ ] 未完成任务
|
|
133
|
+
- [ ] 另一个待办任务
|
|
134
|
+
|
|
135
|
+
### 自动链接
|
|
136
|
+
|
|
137
|
+
URL 会自动转换为可点击链接:
|
|
138
|
+
|
|
139
|
+
```md
|
|
140
|
+
https://vercel.com
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
渲染为:
|
|
144
|
+
|
|
145
|
+
https://vercel.com
|
|
146
|
+
|
|
147
|
+
## 代码块
|
|
148
|
+
|
|
149
|
+
围栏代码块支持多种语言的语法高亮。
|
|
150
|
+
|
|
151
|
+
### 基本语法高亮
|
|
152
|
+
|
|
153
|
+
在开头的反引号后指定语言:
|
|
154
|
+
|
|
155
|
+
````md
|
|
156
|
+
```typescript
|
|
157
|
+
const greet = (name: string): string => {
|
|
158
|
+
return `Hello, ${name}!`;
|
|
159
|
+
};
|
|
160
|
+
```
|
|
161
|
+
````
|
|
162
|
+
|
|
163
|
+
渲染为:
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
const greet = (name: string): string => {
|
|
167
|
+
return `Hello, ${name}!`;
|
|
168
|
+
};
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 代码块标题
|
|
172
|
+
|
|
173
|
+
使用 `title` 属性为代码块添加标题:
|
|
174
|
+
|
|
175
|
+
````md
|
|
176
|
+
```tsx title="components/button.tsx"
|
|
177
|
+
export const Button = ({ children }) => {
|
|
178
|
+
return <button type="button">{children}</button>;
|
|
179
|
+
};
|
|
180
|
+
```
|
|
181
|
+
````
|
|
182
|
+
|
|
183
|
+
渲染为:
|
|
184
|
+
|
|
185
|
+
```tsx title="components/button.tsx"
|
|
186
|
+
export const Button = ({ children }) => {
|
|
187
|
+
return <button type="button">{children}</button>;
|
|
188
|
+
};
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### 行号
|
|
192
|
+
|
|
193
|
+
通过添加 `lineNumbers` 属性来显示行号:
|
|
194
|
+
|
|
195
|
+
````md
|
|
196
|
+
```typescript lineNumbers
|
|
197
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
198
|
+
const doubled = numbers.map((n) => n * 2);
|
|
199
|
+
console.log(doubled);
|
|
200
|
+
```
|
|
201
|
+
````
|
|
202
|
+
|
|
203
|
+
渲染为:
|
|
204
|
+
|
|
205
|
+
```typescript lineNumbers
|
|
206
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
207
|
+
const doubled = numbers.map((n) => n * 2);
|
|
208
|
+
console.log(doubled);
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
您也可以使用 `lineNumbers=10` 指定起始行号:
|
|
212
|
+
|
|
213
|
+
```typescript lineNumbers=10
|
|
214
|
+
const config = {
|
|
215
|
+
theme: "dark",
|
|
216
|
+
language: "en",
|
|
217
|
+
};
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### 行高亮
|
|
221
|
+
|
|
222
|
+
使用 `[!code highlight]` 注释高亮特定行:
|
|
223
|
+
|
|
224
|
+
````md
|
|
225
|
+
```typescript
|
|
226
|
+
const config = {
|
|
227
|
+
theme: "dark", // [ !code highlight]
|
|
228
|
+
language: "en",
|
|
229
|
+
};
|
|
230
|
+
```
|
|
231
|
+
````
|
|
232
|
+
|
|
233
|
+
在使用此语法时,请移除 `!` 前的空格。渲染为:
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
const config = {
|
|
237
|
+
theme: "dark", // [!code highlight]
|
|
238
|
+
language: "en",
|
|
239
|
+
};
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### 单词高亮
|
|
243
|
+
|
|
244
|
+
使用 `[!code word:term]` 高亮特定单词:
|
|
245
|
+
|
|
246
|
+
````md
|
|
247
|
+
```typescript
|
|
248
|
+
// [ !code word:config]
|
|
249
|
+
const config = {
|
|
250
|
+
theme: "dark",
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
console.log(config);
|
|
254
|
+
```
|
|
255
|
+
````
|
|
256
|
+
|
|
257
|
+
在使用此语法时,请移除 `!` 前的空格。渲染为:
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
// [!code word:config]
|
|
261
|
+
const config = {
|
|
262
|
+
theme: "dark",
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
console.log(config);
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### 差异语法
|
|
269
|
+
|
|
270
|
+
使用 `[!code ++]` 和 `[!code --]` 显示添加和删除:
|
|
271
|
+
|
|
272
|
+
````md
|
|
273
|
+
```typescript
|
|
274
|
+
const config = {
|
|
275
|
+
theme: "light", // [ !code --]
|
|
276
|
+
theme: "dark", // [ !code ++]
|
|
277
|
+
language: "en",
|
|
278
|
+
};
|
|
279
|
+
```
|
|
280
|
+
````
|
|
281
|
+
|
|
282
|
+
在使用此语法时,请移除 `!` 前的空格。渲染为:
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
const config = {
|
|
286
|
+
theme: "light", // [!code --]
|
|
287
|
+
theme: "dark", // [!code ++]
|
|
288
|
+
language: "en",
|
|
289
|
+
};
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### 焦点行
|
|
293
|
+
|
|
294
|
+
使用 `[!code focus]` 强调特定行:
|
|
295
|
+
|
|
296
|
+
````md
|
|
297
|
+
```typescript
|
|
298
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
299
|
+
const sum = numbers.reduce((a, b) => a + b, 0); // [ !code focus]
|
|
300
|
+
console.log(sum);
|
|
301
|
+
```
|
|
302
|
+
````
|
|
303
|
+
|
|
304
|
+
在使用此语法时,请移除 `!` 前的空格。渲染为:
|
|
305
|
+
|
|
306
|
+
```typescript
|
|
307
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
308
|
+
const sum = numbers.reduce((a, b) => a + b, 0); // [!code focus]
|
|
309
|
+
console.log(sum);
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Mermaid 图表
|
|
313
|
+
|
|
314
|
+
使用 Mermaid 语法创建图表和流程图。
|
|
315
|
+
|
|
316
|
+
### 流程图
|
|
317
|
+
|
|
318
|
+
````md
|
|
319
|
+
```mermaid
|
|
320
|
+
graph TD;
|
|
321
|
+
A[Start] --> B{Is it working?};
|
|
322
|
+
B -->|Yes| C[Great!];
|
|
323
|
+
B -->|No| D[Debug];
|
|
324
|
+
D --> B;
|
|
325
|
+
```
|
|
326
|
+
````
|
|
327
|
+
|
|
328
|
+
渲染为:
|
|
329
|
+
|
|
330
|
+
```mermaid
|
|
331
|
+
graph TD;
|
|
332
|
+
A[Start] --> B{Is it working?};
|
|
333
|
+
B -->|Yes| C[Great!];
|
|
334
|
+
B -->|No| D[Debug];
|
|
335
|
+
D --> B;
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### 时序图
|
|
339
|
+
|
|
340
|
+
````md
|
|
341
|
+
```mermaid
|
|
342
|
+
sequenceDiagram
|
|
343
|
+
participant User
|
|
344
|
+
participant API
|
|
345
|
+
participant Database
|
|
346
|
+
User->>API: Request data
|
|
347
|
+
API->>Database: Query
|
|
348
|
+
Database-->>API: Results
|
|
349
|
+
API-->>User: Response
|
|
350
|
+
```
|
|
351
|
+
````
|
|
352
|
+
|
|
353
|
+
渲染为:
|
|
354
|
+
|
|
355
|
+
```mermaid
|
|
356
|
+
sequenceDiagram
|
|
357
|
+
participant User
|
|
358
|
+
participant API
|
|
359
|
+
participant Database
|
|
360
|
+
User->>API: Request data
|
|
361
|
+
API->>Database: Query
|
|
362
|
+
Database-->>API: Results
|
|
363
|
+
API-->>User: Response
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### 架构图
|
|
367
|
+
|
|
368
|
+
````md
|
|
369
|
+
```mermaid
|
|
370
|
+
graph TD;
|
|
371
|
+
subgraph Frontend
|
|
372
|
+
A[Web App]
|
|
373
|
+
B[Mobile App]
|
|
374
|
+
end
|
|
375
|
+
subgraph Backend
|
|
376
|
+
C[API Gateway]
|
|
377
|
+
D[Auth Service]
|
|
378
|
+
E[Data Service]
|
|
379
|
+
end
|
|
380
|
+
subgraph Storage
|
|
381
|
+
F[(Database)]
|
|
382
|
+
G[(Cache)]
|
|
383
|
+
end
|
|
384
|
+
A --> C
|
|
385
|
+
B --> C
|
|
386
|
+
C --> D
|
|
387
|
+
C --> E
|
|
388
|
+
E --> F
|
|
389
|
+
E --> G
|
|
390
|
+
```
|
|
391
|
+
````
|
|
392
|
+
|
|
393
|
+
渲染为:
|
|
394
|
+
|
|
395
|
+
```mermaid
|
|
396
|
+
graph TD;
|
|
397
|
+
subgraph Frontend
|
|
398
|
+
A[Web App]
|
|
399
|
+
B[Mobile App]
|
|
400
|
+
end
|
|
401
|
+
subgraph Backend
|
|
402
|
+
C[API Gateway]
|
|
403
|
+
D[Auth Service]
|
|
404
|
+
E[Data Service]
|
|
405
|
+
end
|
|
406
|
+
subgraph Storage
|
|
407
|
+
F[(Database)]
|
|
408
|
+
G[(Cache)]
|
|
409
|
+
end
|
|
410
|
+
A --> C
|
|
411
|
+
B --> C
|
|
412
|
+
C --> D
|
|
413
|
+
C --> E
|
|
414
|
+
E --> F
|
|
415
|
+
E --> G
|
|
416
|
+
```
|