@vercel/geistdocs 1.2.2 → 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.
Files changed (320) hide show
  1. package/dist/cli/index.js +3 -0
  2. package/dist/components/callout.d.ts +12 -0
  3. package/dist/components/callout.d.ts.map +1 -0
  4. package/dist/components/callout.js +7 -0
  5. package/dist/components/code-block-tabs.d.ts +7 -0
  6. package/dist/components/code-block-tabs.d.ts.map +1 -0
  7. package/dist/components/code-block-tabs.js +7 -0
  8. package/dist/components/code-block.d.ts +14 -0
  9. package/dist/components/code-block.d.ts.map +1 -0
  10. package/dist/components/code-block.js +41 -0
  11. package/dist/components/mermaid.d.ts +4 -0
  12. package/dist/components/mermaid.d.ts.map +1 -0
  13. package/dist/components/mermaid.js +44 -0
  14. package/dist/components/theme-aware-image.d.ts +12 -0
  15. package/dist/components/theme-aware-image.d.ts.map +1 -0
  16. package/dist/components/theme-aware-image.js +8 -0
  17. package/dist/components/video.d.ts +6 -0
  18. package/dist/components/video.d.ts.map +1 -0
  19. package/dist/components/video.js +3 -0
  20. package/dist/config.d.ts +52 -0
  21. package/dist/config.d.ts.map +1 -0
  22. package/dist/config.js +1 -0
  23. package/dist/controls.d.ts +15 -0
  24. package/dist/controls.d.ts.map +1 -0
  25. package/dist/controls.js +52 -0
  26. package/dist/internal/chat/context.d.ts +19 -0
  27. package/dist/internal/chat/context.d.ts.map +1 -0
  28. package/dist/internal/chat/context.js +36 -0
  29. package/dist/internal/chat/conversation.d.ts +10 -0
  30. package/dist/internal/chat/conversation.d.ts.map +1 -0
  31. package/dist/internal/chat/conversation.js +16 -0
  32. package/dist/internal/chat/copy-chat.d.ts +5 -0
  33. package/dist/internal/chat/copy-chat.d.ts.map +1 -0
  34. package/dist/internal/chat/copy-chat.js +35 -0
  35. package/dist/internal/chat/db.d.ts +13 -0
  36. package/dist/internal/chat/db.d.ts.map +1 -0
  37. package/dist/internal/chat/db.js +19 -0
  38. package/dist/internal/chat/message-metadata.d.ts +8 -0
  39. package/dist/internal/chat/message-metadata.d.ts.map +1 -0
  40. package/dist/internal/chat/message-metadata.js +29 -0
  41. package/dist/internal/chat/message.d.ts +11 -0
  42. package/dist/internal/chat/message.d.ts.map +1 -0
  43. package/dist/internal/chat/message.js +11 -0
  44. package/dist/internal/chat/prompt-input.d.ts +13 -0
  45. package/dist/internal/chat/prompt-input.d.ts.map +1 -0
  46. package/dist/internal/chat/prompt-input.js +39 -0
  47. package/dist/internal/chat/shell.d.ts +2 -0
  48. package/dist/internal/chat/shell.d.ts.map +1 -0
  49. package/dist/internal/chat/shell.js +194 -0
  50. package/dist/internal/chat/shimmer.d.ts +11 -0
  51. package/dist/internal/chat/shimmer.d.ts.map +1 -0
  52. package/dist/internal/chat/shimmer.js +18 -0
  53. package/dist/internal/chat/sources.d.ts +13 -0
  54. package/dist/internal/chat/sources.d.ts.map +1 -0
  55. package/dist/internal/chat/sources.js +9 -0
  56. package/dist/internal/chat/suggestion.d.ts +11 -0
  57. package/dist/internal/chat/suggestion.d.ts.map +1 -0
  58. package/dist/internal/chat/suggestion.js +12 -0
  59. package/dist/internal/cn.d.ts +3 -0
  60. package/dist/internal/cn.d.ts.map +1 -0
  61. package/dist/internal/cn.js +3 -0
  62. package/dist/internal/feedback-action.d.ts +14 -0
  63. package/dist/internal/feedback-action.d.ts.map +1 -0
  64. package/dist/internal/feedback-action.js +34 -0
  65. package/dist/internal/i18n.d.ts +6 -0
  66. package/dist/internal/i18n.d.ts.map +1 -0
  67. package/dist/internal/i18n.js +18 -0
  68. package/dist/internal/languages.d.ts +7 -0
  69. package/dist/internal/languages.d.ts.map +1 -0
  70. package/dist/internal/languages.js +18 -0
  71. package/dist/internal/not-implemented.d.ts +2 -0
  72. package/dist/internal/not-implemented.d.ts.map +1 -0
  73. package/dist/internal/not-implemented.js +4 -0
  74. package/dist/internal/page-actions-client.d.ts +14 -0
  75. package/dist/internal/page-actions-client.d.ts.map +1 -0
  76. package/dist/internal/page-actions-client.js +154 -0
  77. package/dist/internal/page-actions.d.ts +18 -0
  78. package/dist/internal/page-actions.d.ts.map +1 -0
  79. package/dist/internal/page-actions.js +4 -0
  80. package/dist/internal/search.d.ts +5 -0
  81. package/dist/internal/search.d.ts.map +1 -0
  82. package/dist/internal/search.js +14 -0
  83. package/dist/internal/sidebar.d.ts +6 -0
  84. package/dist/internal/sidebar.d.ts.map +1 -0
  85. package/dist/internal/sidebar.js +37 -0
  86. package/dist/internal/ui/button-group.d.ts +13 -0
  87. package/dist/internal/ui/button-group.d.ts.map +1 -0
  88. package/dist/internal/ui/button-group.js +26 -0
  89. package/dist/internal/ui/button.d.ts +12 -0
  90. package/dist/internal/ui/button.d.ts.map +1 -0
  91. package/dist/internal/ui/button.js +33 -0
  92. package/dist/internal/ui/card.d.ts +6 -0
  93. package/dist/internal/ui/card.d.ts.map +1 -0
  94. package/dist/internal/ui/card.js +14 -0
  95. package/dist/internal/ui/collapsible.d.ts +6 -0
  96. package/dist/internal/ui/collapsible.d.ts.map +1 -0
  97. package/dist/internal/ui/collapsible.js +12 -0
  98. package/dist/internal/ui/drawer.d.ts +6 -0
  99. package/dist/internal/ui/drawer.d.ts.map +1 -0
  100. package/dist/internal/ui/drawer.js +13 -0
  101. package/dist/internal/ui/dropdown-menu.d.ts +22 -0
  102. package/dist/internal/ui/dropdown-menu.d.ts.map +1 -0
  103. package/dist/internal/ui/dropdown-menu.js +41 -0
  104. package/dist/internal/ui/input-group.d.ts +15 -0
  105. package/dist/internal/ui/input-group.d.ts.map +1 -0
  106. package/dist/internal/ui/input-group.js +44 -0
  107. package/dist/internal/ui/input.d.ts +3 -0
  108. package/dist/internal/ui/input.d.ts.map +1 -0
  109. package/dist/internal/ui/input.js +5 -0
  110. package/dist/internal/ui/kbd.d.ts +4 -0
  111. package/dist/internal/ui/kbd.d.ts.map +1 -0
  112. package/dist/internal/ui/kbd.js +8 -0
  113. package/dist/internal/ui/popover.d.ts +6 -0
  114. package/dist/internal/ui/popover.d.ts.map +1 -0
  115. package/dist/internal/ui/popover.js +13 -0
  116. package/dist/internal/ui/scroll-area.d.ts +5 -0
  117. package/dist/internal/ui/scroll-area.d.ts.map +1 -0
  118. package/dist/internal/ui/scroll-area.js +12 -0
  119. package/dist/internal/ui/separator.d.ts +4 -0
  120. package/dist/internal/ui/separator.d.ts.map +1 -0
  121. package/dist/internal/ui/separator.js +7 -0
  122. package/dist/internal/ui/sheet.d.ts +10 -0
  123. package/dist/internal/ui/sheet.d.ts.map +1 -0
  124. package/dist/internal/ui/sheet.js +24 -0
  125. package/dist/internal/ui/sonner.d.ts +3 -0
  126. package/dist/internal/ui/sonner.d.ts.map +1 -0
  127. package/dist/internal/ui/sonner.js +20 -0
  128. package/dist/internal/ui/spinner.d.ts +3 -0
  129. package/dist/internal/ui/spinner.d.ts.map +1 -0
  130. package/dist/internal/ui/spinner.js +6 -0
  131. package/dist/internal/ui/textarea.d.ts +3 -0
  132. package/dist/internal/ui/textarea.d.ts.map +1 -0
  133. package/dist/internal/ui/textarea.js +5 -0
  134. package/dist/internal/ui/tooltip.d.ts +7 -0
  135. package/dist/internal/ui/tooltip.d.ts.map +1 -0
  136. package/dist/internal/ui/tooltip.js +16 -0
  137. package/dist/internal/use-mobile.d.ts +2 -0
  138. package/dist/internal/use-mobile.d.ts.map +1 -0
  139. package/dist/internal/use-mobile.js +16 -0
  140. package/dist/layout.d.ts +18 -0
  141. package/dist/layout.d.ts.map +1 -0
  142. package/dist/layout.js +49 -0
  143. package/dist/mdx.d.ts +36 -0
  144. package/dist/mdx.d.ts.map +1 -0
  145. package/dist/mdx.js +72 -0
  146. package/dist/pages/docs.d.ts +55 -0
  147. package/dist/pages/docs.d.ts.map +1 -0
  148. package/dist/pages/docs.js +63 -0
  149. package/dist/proxy.d.ts +21 -0
  150. package/dist/proxy.d.ts.map +1 -0
  151. package/dist/proxy.js +109 -0
  152. package/dist/routes/chat.d.ts +13 -0
  153. package/dist/routes/chat.d.ts.map +1 -0
  154. package/dist/routes/chat.js +229 -0
  155. package/dist/routes/llms.d.ts +33 -0
  156. package/dist/routes/llms.d.ts.map +1 -0
  157. package/dist/routes/llms.js +39 -0
  158. package/dist/routes/search.d.ts +10 -0
  159. package/dist/routes/search.d.ts.map +1 -0
  160. package/dist/routes/search.js +33 -0
  161. package/dist/routes/sitemap.d.ts +35 -0
  162. package/dist/routes/sitemap.d.ts.map +1 -0
  163. package/dist/routes/sitemap.js +150 -0
  164. package/dist/source.d.ts +30 -0
  165. package/dist/source.d.ts.map +1 -0
  166. package/dist/source.js +72 -0
  167. package/package.json +129 -9
  168. package/styles.css +193 -0
  169. package/template/_gitignore +1 -0
  170. package/template/app/[lang]/(home)/components/centered-section.tsx +26 -0
  171. package/template/app/[lang]/(home)/components/cta.tsx +19 -0
  172. package/template/app/[lang]/(home)/components/hero.tsx +27 -0
  173. package/template/app/[lang]/(home)/components/one-two-section.tsx +25 -0
  174. package/template/app/[lang]/(home)/components/templates.tsx +50 -0
  175. package/template/app/[lang]/(home)/components/text-grid-section.tsx +20 -0
  176. package/template/app/[lang]/(home)/layout.tsx +14 -0
  177. package/template/app/[lang]/(home)/page.tsx +126 -0
  178. package/template/app/[lang]/docs/[[...slug]]/page.tsx +19 -0
  179. package/template/app/[lang]/docs/layout.tsx +14 -0
  180. package/template/app/[lang]/layout.tsx +29 -0
  181. package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +7 -0
  182. package/template/app/[lang]/llms.txt/route.ts +6 -0
  183. package/template/app/[lang]/og/[...slug]/background.png +0 -0
  184. package/template/app/[lang]/og/[...slug]/geist-sans-regular.ttf +0 -0
  185. package/template/app/[lang]/og/[...slug]/geist-sans-semibold.ttf +0 -0
  186. package/template/app/[lang]/og/[...slug]/route.tsx +95 -0
  187. package/template/app/[lang]/rss.xml/route.ts +52 -0
  188. package/template/app/[lang]/sitemap.md/route.ts +9 -0
  189. package/template/app/actions/feedback/emotions.ts +18 -0
  190. package/template/app/actions/feedback/index.ts +45 -0
  191. package/template/app/api/chat/route.ts +8 -0
  192. package/template/app/api/search/route.ts +5 -0
  193. package/template/app/favicon.ico +0 -0
  194. package/template/app/global.css +2 -0
  195. package/template/app/robots.ts +14 -0
  196. package/template/app/sitemap.ts +36 -0
  197. package/template/app/styles/geistdocs.css +553 -0
  198. package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right-small.tsx +35 -0
  199. package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right.tsx +27 -0
  200. package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-check.tsx +27 -0
  201. package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-down-small.tsx +30 -0
  202. package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-right.tsx +27 -0
  203. package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-copy.tsx +27 -0
  204. package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-file-text.tsx +25 -0
  205. package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-menu-alt.tsx +27 -0
  206. package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-slash-forward.tsx +36 -0
  207. package/template/components/geistcn-fallbacks/geistcn-assets/icons/index.tsx +11 -0
  208. package/template/components/geistcn-fallbacks/geistcn-assets/logos/index.tsx +14 -0
  209. package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-elements.tsx +29 -0
  210. package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-sdk.tsx +38 -0
  211. package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-chat-sdk.tsx +42 -0
  212. package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-flags-sdk.tsx +42 -0
  213. package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-icon-vercel.tsx +31 -0
  214. package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-streamdown.tsx +29 -0
  215. package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-vercel-oss.tsx +24 -0
  216. package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-workflow-sdk.tsx +73 -0
  217. package/template/components/geistdocs/callout.tsx +40 -0
  218. package/template/components/geistdocs/chat.tsx +24 -0
  219. package/template/components/geistdocs/code-block-tabs.tsx +61 -0
  220. package/template/components/geistdocs/code-block.tsx +134 -0
  221. package/template/components/geistdocs/copy-page.tsx +27 -0
  222. package/template/components/geistdocs/desktop-menu.tsx +52 -0
  223. package/template/components/geistdocs/docs-layout.tsx +20 -0
  224. package/template/components/geistdocs/docs-page.tsx +35 -0
  225. package/template/components/geistdocs/edit-source.tsx +30 -0
  226. package/template/components/geistdocs/feedback.tsx +139 -0
  227. package/template/components/geistdocs/footer.tsx +30 -0
  228. package/template/components/geistdocs/github-button.tsx +19 -0
  229. package/template/components/geistdocs/home-layout.tsx +46 -0
  230. package/template/components/geistdocs/icons.tsx +13 -0
  231. package/template/components/geistdocs/installer.tsx +58 -0
  232. package/template/components/geistdocs/language-selector.tsx +3 -0
  233. package/template/components/geistdocs/mdx-components.tsx +5 -0
  234. package/template/components/geistdocs/mermaid.tsx +68 -0
  235. package/template/components/geistdocs/mobile-docs-bar.tsx +81 -0
  236. package/template/components/geistdocs/mobile-menu.tsx +150 -0
  237. package/template/components/geistdocs/navbar-logo.tsx +124 -0
  238. package/template/components/geistdocs/navbar.tsx +22 -0
  239. package/template/components/geistdocs/provider.tsx +31 -0
  240. package/template/components/geistdocs/rss-button.tsx +10 -0
  241. package/template/components/geistdocs/scroll-top.tsx +21 -0
  242. package/template/components/geistdocs/search.tsx +17 -0
  243. package/template/components/geistdocs/sidebar.tsx +128 -0
  244. package/template/components/geistdocs/theme-aware-image.tsx +22 -0
  245. package/template/components/geistdocs/theme-toggle.tsx +3 -0
  246. package/template/components/geistdocs/video.tsx +16 -0
  247. package/template/components/ui/badge.tsx +46 -0
  248. package/template/components/ui/button-group.tsx +83 -0
  249. package/template/components/ui/button.tsx +60 -0
  250. package/template/components/ui/card.tsx +92 -0
  251. package/template/components/ui/collapsible.tsx +33 -0
  252. package/template/components/ui/command-prompt.tsx +488 -0
  253. package/template/components/ui/command.tsx +184 -0
  254. package/template/components/ui/dialog.tsx +143 -0
  255. package/template/components/ui/drawer.tsx +135 -0
  256. package/template/components/ui/dropdown-menu.tsx +257 -0
  257. package/template/components/ui/hover-card.tsx +44 -0
  258. package/template/components/ui/input-group.tsx +170 -0
  259. package/template/components/ui/input.tsx +21 -0
  260. package/template/components/ui/kbd.tsx +28 -0
  261. package/template/components/ui/navigation-menu.tsx +192 -0
  262. package/template/components/ui/popover.tsx +48 -0
  263. package/template/components/ui/scroll-area.tsx +58 -0
  264. package/template/components/ui/select.tsx +187 -0
  265. package/template/components/ui/separator.tsx +28 -0
  266. package/template/components/ui/sheet.tsx +139 -0
  267. package/template/components/ui/sonner.tsx +40 -0
  268. package/template/components/ui/spinner.tsx +16 -0
  269. package/template/components/ui/textarea.tsx +18 -0
  270. package/template/components/ui/tooltip.tsx +61 -0
  271. package/template/components.json +22 -0
  272. package/template/content/docs/ask-ai.cn.mdx +85 -0
  273. package/template/content/docs/ask-ai.mdx +85 -0
  274. package/template/content/docs/configuration.cn.mdx +115 -0
  275. package/template/content/docs/configuration.mdx +115 -0
  276. package/template/content/docs/deployment.cn.mdx +34 -0
  277. package/template/content/docs/deployment.mdx +34 -0
  278. package/template/content/docs/edit-on-github.cn.mdx +47 -0
  279. package/template/content/docs/edit-on-github.mdx +47 -0
  280. package/template/content/docs/env.cn.mdx +25 -0
  281. package/template/content/docs/env.mdx +25 -0
  282. package/template/content/docs/feedback.cn.mdx +85 -0
  283. package/template/content/docs/feedback.mdx +85 -0
  284. package/template/content/docs/getting-started.cn.mdx +86 -0
  285. package/template/content/docs/getting-started.mdx +86 -0
  286. package/template/content/docs/index.cn.mdx +54 -0
  287. package/template/content/docs/index.mdx +87 -0
  288. package/template/content/docs/internationalization.cn.mdx +113 -0
  289. package/template/content/docs/internationalization.mdx +117 -0
  290. package/template/content/docs/llms-txt.cn.mdx +50 -0
  291. package/template/content/docs/llms-txt.mdx +50 -0
  292. package/template/content/docs/md.cn.mdx +68 -0
  293. package/template/content/docs/md.mdx +68 -0
  294. package/template/content/docs/meta.json +21 -0
  295. package/template/content/docs/open-in-chat.cn.mdx +78 -0
  296. package/template/content/docs/open-in-chat.mdx +78 -0
  297. package/template/content/docs/provider.cn.mdx +69 -0
  298. package/template/content/docs/provider.mdx +69 -0
  299. package/template/content/docs/rss.cn.mdx +104 -0
  300. package/template/content/docs/rss.mdx +104 -0
  301. package/template/content/docs/syntax.cn.mdx +416 -0
  302. package/template/content/docs/syntax.mdx +407 -0
  303. package/template/content/docs/theme-aware-image.mdx +53 -0
  304. package/template/geistdocs.tsx +51 -0
  305. package/template/hooks/geistdocs/use-sidebar.ts +13 -0
  306. package/template/hooks/use-mobile.ts +19 -0
  307. package/template/lib/geistdocs/config.tsx +27 -0
  308. package/template/lib/geistdocs/fonts.ts +18 -0
  309. package/template/lib/geistdocs/i18n.ts +13 -0
  310. package/template/lib/geistdocs/md-tracking.ts +56 -0
  311. package/template/lib/geistdocs/source.ts +12 -0
  312. package/template/lib/utils.ts +6 -0
  313. package/template/next.config.ts +22 -0
  314. package/template/package.json +63 -0
  315. package/template/postcss.config.mjs +5 -0
  316. package/template/proxy.ts +16 -0
  317. package/template/source.config.ts +62 -0
  318. package/template/tsconfig.json +37 -0
  319. package/dist/index.js +0 -2
  320. /package/dist/{index.d.ts → cli/index.d.ts} +0 -0
@@ -0,0 +1,407 @@
1
+ ---
2
+ title: Syntax
3
+ description: Learn about the supported markdown syntax and formatting options
4
+ type: reference
5
+ summary: Supported MDX syntax including text formatting, code blocks, line highlighting, and Mermaid diagrams.
6
+ prerequisites:
7
+ - /docs/getting-started
8
+ related:
9
+ - /docs/configuration
10
+ ---
11
+
12
+ Geistdocs supports MDX, a superset of Markdown that allows you to use JSX components within your documentation. This guide covers all the formatting options available.
13
+
14
+ ## Frontmatter
15
+
16
+ Every MDX file should include frontmatter at the top:
17
+
18
+ ```yaml
19
+ ---
20
+ title: Page Title
21
+ description: A brief description of the page content
22
+ ---
23
+ ```
24
+
25
+ The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews.
26
+
27
+ ## Basic Markdown
28
+
29
+ ### Text Formatting
30
+
31
+ You can style text using standard Markdown syntax:
32
+
33
+ - **Bold text** with `**double asterisks**`
34
+ - _Italic text_ with `*single asterisks*`
35
+ - ~~Strikethrough~~ with `~~double tildes~~`
36
+ - `Inline code` with `` `backticks` ``
37
+
38
+ ### Headings
39
+
40
+ Use `#` symbols to create headings:
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
+ Headings automatically generate anchor links for easy navigation and deep linking.
57
+
58
+ ### Lists
59
+
60
+ Create unordered lists with `-`, `*`, or `+`:
61
+
62
+ - First item
63
+ - Second item
64
+ - Nested item
65
+ - Another nested item
66
+ - Third item
67
+
68
+ Create ordered lists with numbers:
69
+
70
+ 1. First step
71
+ 2. Second step
72
+ 3. Third step
73
+
74
+ ### Blockquotes
75
+
76
+ Use `>` to create blockquotes:
77
+
78
+ > This is a blockquote. You can use it to highlight important information or quotes from external sources.
79
+
80
+ ### Links
81
+
82
+ Create links with `[text](url)`:
83
+
84
+ - [External link](https://vercel.com)
85
+ - [Internal link](/docs/getting-started)
86
+
87
+ ### Images
88
+
89
+ Add images with `![alt text](url)`:
90
+
91
+ ```md
92
+ ![Description of the image](/path/to/image.png)
93
+ ```
94
+
95
+ ## GitHub Flavored Markdown
96
+
97
+ Geistdocs supports GFM extensions including tables, task lists, and autolinks.
98
+
99
+ ### Tables
100
+
101
+ Create tables using pipes and dashes:
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
+ This renders as:
112
+
113
+ | Feature | Description | Status |
114
+ | -------- | ----------------- | --------- |
115
+ | Markdown | Basic formatting | Supported |
116
+ | GFM | GitHub extensions | Supported |
117
+ | MDX | JSX in Markdown | Supported |
118
+
119
+ ### Task Lists
120
+
121
+ Create interactive task lists:
122
+
123
+ ```md
124
+ - [x] Completed task
125
+ - [ ] Incomplete task
126
+ - [ ] Another task to do
127
+ ```
128
+
129
+ This renders as:
130
+
131
+ - [x] Completed task
132
+ - [ ] Incomplete task
133
+ - [ ] Another task to do
134
+
135
+ ### Autolinks
136
+
137
+ URLs are automatically converted to clickable links:
138
+
139
+ ```md
140
+ https://vercel.com
141
+ ```
142
+
143
+ This renders as:
144
+
145
+ https://vercel.com
146
+
147
+ ## Code Blocks
148
+
149
+ Fenced code blocks support syntax highlighting for many languages.
150
+
151
+ ### Basic Syntax Highlighting
152
+
153
+ Specify the language after the opening backticks:
154
+
155
+ ````md
156
+ ```typescript
157
+ const greet = (name: string): string => {
158
+ return `Hello, ${name}!`;
159
+ };
160
+ ```
161
+ ````
162
+
163
+ This renders as:
164
+
165
+ ```typescript
166
+ const greet = (name: string): string => {
167
+ return `Hello, ${name}!`;
168
+ };
169
+ ```
170
+
171
+ ### Titles
172
+
173
+ Add a title to your code block with the `title` attribute:
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
+ This renders as:
184
+
185
+ ```tsx title="components/button.tsx"
186
+ export const Button = ({ children }) => {
187
+ return <button type="button">{children}</button>;
188
+ };
189
+ ```
190
+
191
+ ### Line Numbers
192
+
193
+ Display line numbers by adding the `lineNumbers` attribute:
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
+ This renders as:
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
+ ### Line Highlighting
212
+
213
+ Highlight specific lines using the `[!code highlight]` comment:
214
+
215
+ ````md
216
+ ```typescript
217
+ const config = {
218
+ theme: "dark", // [ !code highlight]
219
+ language: "en",
220
+ };
221
+ ```
222
+ ````
223
+
224
+ Remove the space before `!` when using this syntax. This renders as:
225
+
226
+ ```typescript
227
+ const config = {
228
+ theme: "dark", // [!code highlight]
229
+ language: "en",
230
+ };
231
+ ```
232
+
233
+ ### Word Highlighting
234
+
235
+ Highlight specific words with `[!code word:term]`:
236
+
237
+ ````md
238
+ ```typescript
239
+ // [ !code word:config]
240
+ const config = {
241
+ theme: "dark",
242
+ };
243
+
244
+ console.log(config);
245
+ ```
246
+ ````
247
+
248
+ Remove the space before `!` when using this syntax. This renders as:
249
+
250
+ ```typescript
251
+ // [!code word:config]
252
+ const config = {
253
+ theme: "dark",
254
+ };
255
+
256
+ console.log(config);
257
+ ```
258
+
259
+ ### Diff Syntax
260
+
261
+ Show additions and deletions with `[!code ++]` and `[!code --]`:
262
+
263
+ ````md
264
+ ```typescript
265
+ const config = {
266
+ theme: "light", // [ !code --]
267
+ theme: "dark", // [ !code ++]
268
+ language: "en",
269
+ };
270
+ ```
271
+ ````
272
+
273
+ Remove the space before `!` when using this syntax. This renders as:
274
+
275
+ ```typescript
276
+ const config = {
277
+ theme: "light", // [!code --]
278
+ theme: "dark", // [!code ++]
279
+ language: "en",
280
+ };
281
+ ```
282
+
283
+ ### Focus Lines
284
+
285
+ Draw attention to specific lines with `[!code focus]`:
286
+
287
+ ````md
288
+ ```typescript
289
+ const numbers = [1, 2, 3, 4, 5];
290
+ const sum = numbers.reduce((a, b) => a + b, 0); // [ !code focus]
291
+ console.log(sum);
292
+ ```
293
+ ````
294
+
295
+ Remove the space before `!` when using this syntax. This renders as:
296
+
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
+ ## Mermaid Diagrams
304
+
305
+ Create diagrams and flowcharts using Mermaid syntax.
306
+
307
+ ### Flowcharts
308
+
309
+ ````md
310
+ ```mermaid
311
+ graph TD;
312
+ A[Start] --> B{Is it working?};
313
+ B -->|Yes| C[Great!];
314
+ B -->|No| D[Debug];
315
+ D --> B;
316
+ ```
317
+ ````
318
+
319
+ This renders as:
320
+
321
+ ```mermaid
322
+ graph TD;
323
+ A[Start] --> B{Is it working?};
324
+ B -->|Yes| C[Great!];
325
+ B -->|No| D[Debug];
326
+ D --> B;
327
+ ```
328
+
329
+ ### Sequence Diagrams
330
+
331
+ ````md
332
+ ```mermaid
333
+ sequenceDiagram
334
+ participant User
335
+ participant API
336
+ participant Database
337
+ User->>API: Request data
338
+ API->>Database: Query
339
+ Database-->>API: Results
340
+ API-->>User: Response
341
+ ```
342
+ ````
343
+
344
+ This renders as:
345
+
346
+ ```mermaid
347
+ sequenceDiagram
348
+ participant User
349
+ participant API
350
+ participant Database
351
+ User->>API: Request data
352
+ API->>Database: Query
353
+ Database-->>API: Results
354
+ API-->>User: Response
355
+ ```
356
+
357
+ ### Architecture Diagrams
358
+
359
+ ````md
360
+ ```mermaid
361
+ graph TD;
362
+ subgraph Frontend
363
+ A[Web App]
364
+ B[Mobile App]
365
+ end
366
+ subgraph Backend
367
+ C[API Gateway]
368
+ D[Auth Service]
369
+ E[Data Service]
370
+ end
371
+ subgraph Storage
372
+ F[(Database)]
373
+ G[(Cache)]
374
+ end
375
+ A --> C
376
+ B --> C
377
+ C --> D
378
+ C --> E
379
+ E --> F
380
+ E --> G
381
+ ```
382
+ ````
383
+
384
+ This renders as:
385
+
386
+ ```mermaid
387
+ graph TD;
388
+ subgraph Frontend
389
+ A[Web App]
390
+ B[Mobile App]
391
+ end
392
+ subgraph Backend
393
+ C[API Gateway]
394
+ D[Auth Service]
395
+ E[Data Service]
396
+ end
397
+ subgraph Storage
398
+ F[(Database)]
399
+ G[(Cache)]
400
+ end
401
+ A --> C
402
+ B --> C
403
+ C --> D
404
+ C --> E
405
+ E --> F
406
+ E --> G
407
+ ```
@@ -0,0 +1,53 @@
1
+ ---
2
+ title: Theme-Aware Image
3
+ description: Display different images based on the user's light or dark theme preference
4
+ type: reference
5
+ summary: A component that swaps images based on the active theme, built on top of Next.js Image.
6
+ prerequisites:
7
+ - /docs/getting-started
8
+ - /docs/provider
9
+ related:
10
+ - /docs/syntax
11
+ - /docs/configuration
12
+ ---
13
+
14
+ The `ThemeAwareImage` component renders different images depending on whether the user is viewing your documentation in light or dark mode. It extends the Next.js `Image` component, so you get all the same optimization benefits like lazy loading, responsive sizing, and format conversion.
15
+
16
+ ## Usage
17
+
18
+ Import the component and pass a `src` object with `light` and `dark` variants:
19
+
20
+ ```tsx
21
+ import { ThemeAwareImage } from "@/components/geistdocs/theme-aware-image";
22
+
23
+ <ThemeAwareImage
24
+ src={{
25
+ light: "/images/diagram-light.png",
26
+ dark: "/images/diagram-dark.png",
27
+ }}
28
+ alt="Architecture diagram"
29
+ width={800}
30
+ height={400}
31
+ />
32
+ ```
33
+
34
+ The component reads the current theme from `next-themes` and resolves the correct image source automatically. All standard Next.js `Image` props (such as `width`, `height`, `alt`, `priority`, and `className`) are supported.
35
+
36
+ ## How it works
37
+
38
+ `ThemeAwareImage` uses the `resolvedTheme` value from the `useTheme` hook provided by `next-themes`. This ensures it responds to the actual rendered theme, even when the user's preference is set to "system".
39
+
40
+ - When `resolvedTheme` is `"dark"`, the `src.dark` image is displayed.
41
+ - Otherwise, the `src.light` image is used.
42
+
43
+ Because this component relies on client-side theme detection, it is a client component (`"use client"`).
44
+
45
+ ## Props
46
+
47
+ | Prop | Type | Description |
48
+ | --- | --- | --- |
49
+ | `src` | `{ light: ImageProps["src"]; dark: ImageProps["src"] }` | An object containing the light and dark image sources |
50
+ | `alt` | `string` | Accessible alt text for the image |
51
+ | `width` | `number` | The width of the image in pixels |
52
+ | `height` | `number` | The height of the image in pixels |
53
+ | `...rest` | `ImageProps` | Any additional props supported by the Next.js `Image` component |
@@ -0,0 +1,51 @@
1
+ export const Logo = () => (
2
+ <span className="font-semibold text-gray-1000 text-lg leading-none tracking-[-3%]">
3
+ Geistdocs
4
+ </span>
5
+ );
6
+
7
+ export const github = {
8
+ owner: "vercel",
9
+ repo: "geistdocs",
10
+ };
11
+
12
+ export const nav = [
13
+ {
14
+ label: "Docs",
15
+ href: "/docs",
16
+ },
17
+ {
18
+ label: "Source",
19
+ href: `https://github.com/${github.owner}/${github.repo}/`,
20
+ },
21
+ ];
22
+
23
+ export const suggestions = [
24
+ "What is Geistdocs?",
25
+ "What can I make with Geistdocs?",
26
+ "What syntax does Geistdocs support?",
27
+ "How do I deploy my Geistdocs site?",
28
+ ];
29
+
30
+ export const title = "Geistdocs Documentation";
31
+
32
+ export const prompt =
33
+ "You are a helpful assistant specializing in answering questions about Geistdocs, a modern documentation template built with Next.js and Fumadocs.";
34
+
35
+ export const translations = {
36
+ en: {
37
+ displayName: "English",
38
+ },
39
+ cn: {
40
+ displayName: "Chinese",
41
+ search: "搜尋文檔",
42
+ },
43
+ };
44
+
45
+ export const basePath: string | undefined = undefined;
46
+
47
+ /**
48
+ * Unique identifier for this site, used in markdown request tracking analytics.
49
+ * Each site using geistdocs should set this to a unique value (e.g. "ai-sdk-docs", "next-docs").
50
+ */
51
+ export const siteId: string | undefined = undefined;
@@ -0,0 +1,13 @@
1
+ import { atom, useAtom } from "jotai";
2
+
3
+ // Export the sidebar open state atom so it can be used from other parts of the app
4
+ export const sidebarOpenAtom = atom<boolean>(false);
5
+
6
+ export const useSidebarContext = () => {
7
+ const [isOpen, setIsOpen] = useAtom(sidebarOpenAtom);
8
+
9
+ return {
10
+ isOpen,
11
+ setIsOpen,
12
+ };
13
+ };
@@ -0,0 +1,19 @@
1
+ import * as React from "react"
2
+
3
+ const MOBILE_BREAKPOINT = 768
4
+
5
+ export function useIsMobile() {
6
+ const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
7
+
8
+ React.useEffect(() => {
9
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
10
+ const onChange = () => {
11
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
12
+ }
13
+ mql.addEventListener("change", onChange)
14
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
15
+ return () => mql.removeEventListener("change", onChange)
16
+ }, [])
17
+
18
+ return !!isMobile
19
+ }
@@ -0,0 +1,27 @@
1
+ import { defineConfig } from "@vercel/geistdocs/config";
2
+ import {
3
+ basePath,
4
+ github,
5
+ Logo,
6
+ nav,
7
+ prompt,
8
+ siteId,
9
+ suggestions,
10
+ title,
11
+ translations,
12
+ } from "@/geistdocs";
13
+
14
+ export const config = defineConfig({
15
+ title,
16
+ defaultLanguage: "en",
17
+ logo: <Logo />,
18
+ github,
19
+ nav,
20
+ basePath,
21
+ siteId,
22
+ translations,
23
+ ai: {
24
+ prompt,
25
+ suggestions,
26
+ },
27
+ });
@@ -0,0 +1,18 @@
1
+ import {
2
+ Geist_Mono as createMono,
3
+ Geist as createSans,
4
+ } from "next/font/google";
5
+
6
+ export const sans = createSans({
7
+ variable: "--font-sans",
8
+ subsets: ["latin"],
9
+ weight: "variable",
10
+ display: "swap",
11
+ });
12
+
13
+ export const mono = createMono({
14
+ variable: "--font-mono",
15
+ subsets: ["latin"],
16
+ weight: "variable",
17
+ display: "swap",
18
+ });
@@ -0,0 +1,13 @@
1
+ import { defineI18n } from "fumadocs-core/i18n";
2
+ import { defineI18nUI } from "fumadocs-ui/i18n";
3
+ import { translations } from "@/geistdocs";
4
+
5
+ export const i18n = defineI18n({
6
+ defaultLanguage: "en",
7
+ languages: Object.keys(translations),
8
+ hideLocale: "default-locale",
9
+ });
10
+
11
+ export const { provider: i18nProvider } = defineI18nUI(i18n, {
12
+ translations,
13
+ });
@@ -0,0 +1,56 @@
1
+ import type { DetectionMethod } from "@vercel/agent-readability";
2
+ import { siteId } from "@/geistdocs";
3
+
4
+ const PLATFORM_URL = "https://geistdocs.com/md-tracking";
5
+
6
+ interface TrackMdRequestParams {
7
+ acceptHeader: string | null;
8
+ /** Detection method used to identify the agent (only for agent-rewrite requests) */
9
+ detectionMethod?: DetectionMethod | null;
10
+ path: string;
11
+ referer: string | null;
12
+ /** How the markdown was requested: 'md-url' for direct .md URLs, 'header-negotiated' for Accept header, 'agent-rewrite' for detected AI agents */
13
+ requestType?: "md-url" | "header-negotiated" | "agent-rewrite";
14
+ userAgent: string | null;
15
+ }
16
+
17
+ /**
18
+ * Track a markdown page request via the geistdocs platform.
19
+ * Fire-and-forget: errors are logged but don't affect the response.
20
+ */
21
+ export async function trackMdRequest({
22
+ path,
23
+ userAgent,
24
+ referer,
25
+ acceptHeader,
26
+ requestType,
27
+ detectionMethod,
28
+ }: TrackMdRequestParams): Promise<void> {
29
+ try {
30
+ const response = await fetch(PLATFORM_URL, {
31
+ method: "POST",
32
+ headers: {
33
+ "Content-Type": "application/json",
34
+ },
35
+ body: JSON.stringify({
36
+ path,
37
+ siteId: siteId ?? "geistdocs-unknown",
38
+ userAgent,
39
+ referer,
40
+ acceptHeader,
41
+ requestType,
42
+ detectionMethod,
43
+ }),
44
+ });
45
+
46
+ if (!response.ok) {
47
+ console.error(
48
+ "MD tracking failed:",
49
+ response.status,
50
+ await response.text()
51
+ );
52
+ }
53
+ } catch (error) {
54
+ console.error("MD tracking error:", error);
55
+ }
56
+ }
@@ -0,0 +1,12 @@
1
+ import { createSource } from "@vercel/geistdocs/source";
2
+ import { docs } from "@/.source/server";
3
+ import { config } from "./config";
4
+
5
+ export const geistdocsSource = createSource({
6
+ docs,
7
+ config,
8
+ });
9
+
10
+ export const source = geistdocsSource.source;
11
+ export const getPageImage = geistdocsSource.getPageImage;
12
+ export const getLLMText = geistdocsSource.getPageMarkdown;
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from "clsx"
2
+ import { twMerge } from "tailwind-merge"
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
@@ -0,0 +1,22 @@
1
+ import { createMDX } from "fumadocs-mdx/next";
2
+ import type { NextConfig } from "next";
3
+
4
+ const withMDX = createMDX();
5
+
6
+ const config: NextConfig = {
7
+ experimental: {
8
+ turbopackFileSystemCacheForDev: true,
9
+ },
10
+
11
+ images: {
12
+ formats: ["image/avif", "image/webp"],
13
+ remotePatterns: [
14
+ {
15
+ protocol: "https",
16
+ hostname: "placehold.co",
17
+ },
18
+ ],
19
+ },
20
+ };
21
+
22
+ export default withMDX(config);