@wordup-md/nuxt-layer-shadcn-unocss 0.2.0

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 (359) hide show
  1. package/.cursor/rules/active-context-rule.mdc +8 -0
  2. package/.cursor/rules/memory-bank-overview.mdc +17 -0
  3. package/.cursor/rules/product-context-rule.mdc +8 -0
  4. package/.cursor/rules/progress-rule.mdc +8 -0
  5. package/.cursor/rules/projectbrief-rule.mdc +8 -0
  6. package/.cursor/rules/system-patterns-rule.mdc +8 -0
  7. package/.cursor/rules/tech-context-rule.mdc +8 -0
  8. package/.cursorrules +52 -0
  9. package/.editorconfig +12 -0
  10. package/.nuxtrc +1 -0
  11. package/.playground/app.config.ts +189 -0
  12. package/.playground/assets/style.css +15 -0
  13. package/.playground/components/content/MdcExample.vue +81 -0
  14. package/.playground/components/content/MdcReplay.vue +319 -0
  15. package/.playground/content/1.getting-started/1.introduction.md +8 -0
  16. package/.playground/content/1.getting-started/2.writing/1.markdown.md +56 -0
  17. package/.playground/content/1.getting-started/2.writing/2.pages.md +177 -0
  18. package/.playground/content/1.getting-started/2.writing/3.folders.md +56 -0
  19. package/.playground/content/1.getting-started/2.writing/_dir.yml +3 -0
  20. package/.playground/content/1.getting-started/_dir.yml +3 -0
  21. package/.playground/content/2.content-elements/1.text-formatting.md +60 -0
  22. package/.playground/content/2.content-elements/10.horizontal-rule.md +25 -0
  23. package/.playground/content/2.content-elements/11.tables.md +25 -0
  24. package/.playground/content/2.content-elements/12.overview.md +93 -0
  25. package/.playground/content/2.content-elements/13.text-components.md +36 -0
  26. package/.playground/content/2.content-elements/2.headings.md +32 -0
  27. package/.playground/content/2.content-elements/3.paragraphs.md +39 -0
  28. package/.playground/content/2.content-elements/4.lists.md +37 -0
  29. package/.playground/content/2.content-elements/5.links.md +17 -0
  30. package/.playground/content/2.content-elements/6.images.md +17 -0
  31. package/.playground/content/2.content-elements/7.blockquotes.md +17 -0
  32. package/.playground/content/2.content-elements/8.code-blocks.md +141 -0
  33. package/.playground/content/2.content-elements/9.inline-code.md +21 -0
  34. package/.playground/content/2.content-elements/_dir.yml +3 -0
  35. package/.playground/content/2.content-elements/index.md +8 -0
  36. package/.playground/content/3.components/1.index.md +187 -0
  37. package/.playground/content/3.components/2.docs/_dir.yml +3 -0
  38. package/.playground/content/3.components/2.docs/alert.md +152 -0
  39. package/.playground/content/3.components/2.docs/badge.md +131 -0
  40. package/.playground/content/3.components/2.docs/button-link.md +53 -0
  41. package/.playground/content/3.components/2.docs/callout.md +16 -0
  42. package/.playground/content/3.components/2.docs/code-group.md +77 -0
  43. package/.playground/content/3.components/2.docs/code-snippet.md +129 -0
  44. package/.playground/content/3.components/2.docs/field-group.md +62 -0
  45. package/.playground/content/3.components/2.docs/field.md +39 -0
  46. package/.playground/content/3.components/2.docs/file-tree.md +144 -0
  47. package/.playground/content/3.components/2.docs/icon.md +94 -0
  48. package/.playground/content/3.components/2.docs/pm.md +67 -0
  49. package/.playground/content/3.components/2.docs/read-more.md +44 -0
  50. package/.playground/content/3.components/2.docs/shortcut.md +36 -0
  51. package/.playground/content/3.components/2.docs/stack.md +81 -0
  52. package/.playground/content/3.components/2.docs/steps.md +148 -0
  53. package/.playground/content/3.components/2.docs/tabs.md +375 -0
  54. package/.playground/content/3.components/3.page/_dir.yml +2 -0
  55. package/.playground/content/3.components/3.page/accordion.md +74 -0
  56. package/.playground/content/3.components/3.page/card-group.md +115 -0
  57. package/.playground/content/3.components/3.page/card.md +142 -0
  58. package/.playground/content/3.components/3.page/collapsible.md +61 -0
  59. package/.playground/content/3.components/3.page/hero-alt.md +118 -0
  60. package/.playground/content/3.components/3.page/hero.md +60 -0
  61. package/.playground/content/3.components/3.page/team-card.md +82 -0
  62. package/.playground/content/3.components/_dir.yml +2 -0
  63. package/.playground/content/4.development/1.configuration/1.overview.md +297 -0
  64. package/.playground/content/4.development/1.configuration/2.nuxt-content.md +105 -0
  65. package/.playground/content/4.development/1.configuration/3.og-image.md +86 -0
  66. package/.playground/content/4.development/1.configuration/4.edit-link.md +63 -0
  67. package/.playground/content/4.development/1.configuration/5.banner.md +52 -0
  68. package/.playground/content/4.development/1.configuration/6.carbon-ads.md +65 -0
  69. package/.playground/content/4.development/1.configuration/7.umami.md +41 -0
  70. package/.playground/content/4.development/1.configuration/_dir.yml +3 -0
  71. package/.playground/content/4.development/2.advanced/1.override.md +49 -0
  72. package/.playground/content/4.development/2.advanced/2.math.md +89 -0
  73. package/.playground/content/4.development/2.advanced/_dir.yml +3 -0
  74. package/.playground/content/4.development/3.themes.md +9 -0
  75. package/.playground/content/4.development/4.composables.md +38 -0
  76. package/.playground/content/4.development/5.installation.md +36 -0
  77. package/.playground/content/4.development/_dir.yml +3 -0
  78. package/.playground/content/_menu-footer.md +5 -0
  79. package/.playground/content/index.md +67 -0
  80. package/.playground/content/test-card.md +187 -0
  81. package/.playground/content/test.md +88 -0
  82. package/.playground/content/test2.md +12 -0
  83. package/.playground/content/test3.md +187 -0
  84. package/.playground/nuxt.config.ts +52 -0
  85. package/.playground/public/banner-preview.png +0 -0
  86. package/.playground/public/favicon.ico +0 -0
  87. package/.playground/public/front-matter-showcase/authors.png +0 -0
  88. package/.playground/public/front-matter-showcase/badges.png +0 -0
  89. package/.playground/public/front-matter-showcase/nav-badges.png +0 -0
  90. package/.playground/public/hero.png +0 -0
  91. package/.playground/public/logo-dark.svg +12 -0
  92. package/.playground/public/logo.svg +12 -0
  93. package/.playground/public/og-nuxt-seo.png +0 -0
  94. package/.playground/public/og-nuxt.png +0 -0
  95. package/.playground/public/og-shadcn-docs-dark.png +0 -0
  96. package/.playground/public/og-shadcn-docs.png +0 -0
  97. package/.playground/public/sidebar-default.png +0 -0
  98. package/.playground/public/sidebar-group.png +0 -0
  99. package/.playground/public/sidebar-tree.png +0 -0
  100. package/.playground/uno.config.ts +16 -0
  101. package/README.md +93 -0
  102. package/app.vue +59 -0
  103. package/assets/css/a11y.css +48 -0
  104. package/assets/css/mdc-editor.css +91 -0
  105. package/components/A11yModeToggle.vue +23 -0
  106. package/components/DarkModeToggle.vue +26 -0
  107. package/components/LinkIcon.vue +32 -0
  108. package/components/OgImage/ShadcnDocs.vue +55 -0
  109. package/components/ThemeCustomizer.vue +156 -0
  110. package/components/ThemePopover.vue +27 -0
  111. package/components/content/Accordion.vue +18 -0
  112. package/components/content/AccordionItem.vue +32 -0
  113. package/components/content/Alert.vue +100 -0
  114. package/components/content/Badge.vue +52 -0
  115. package/components/content/ButtonLink.vue +38 -0
  116. package/components/content/Callout.vue +17 -0
  117. package/components/content/Card.vue +173 -0
  118. package/components/content/CardGroup.vue +38 -0
  119. package/components/content/CodeCopy.vue +52 -0
  120. package/components/content/CodeGroup._vue +27 -0
  121. package/components/content/CodeSnippet._vue +78 -0
  122. package/components/content/Collapsible.vue +80 -0
  123. package/components/content/Field.vue +53 -0
  124. package/components/content/FieldGroup.vue +5 -0
  125. package/components/content/FileTree.vue +110 -0
  126. package/components/content/FileTreeItem.vue +64 -0
  127. package/components/content/FileTreeRoot.vue +27 -0
  128. package/components/content/Hero.vue +154 -0
  129. package/components/content/HeroAlt.vue +116 -0
  130. package/components/content/Icon.vue +69 -0
  131. package/components/content/Kbd.vue +20 -0
  132. package/components/content/PmInstall.vue +35 -0
  133. package/components/content/PmRun.vue +31 -0
  134. package/components/content/PmX.vue +31 -0
  135. package/components/content/ProseA.vue +21 -0
  136. package/components/content/ProseBlockquote.vue +5 -0
  137. package/components/content/ProseCode.vue +121 -0
  138. package/components/content/ProseCodeInline.vue +24 -0
  139. package/components/content/ProseEm.vue +5 -0
  140. package/components/content/ProseH1.vue +27 -0
  141. package/components/content/ProseH2.vue +22 -0
  142. package/components/content/ProseH3.vue +21 -0
  143. package/components/content/ProseH4.vue +21 -0
  144. package/components/content/ProseH5.vue +21 -0
  145. package/components/content/ProseH6.vue +21 -0
  146. package/components/content/ProseHr.vue +3 -0
  147. package/components/content/ProseImg.vue +42 -0
  148. package/components/content/ProseLi.vue +5 -0
  149. package/components/content/ProseOl.vue +5 -0
  150. package/components/content/ProseP.vue +5 -0
  151. package/components/content/ProsePre.vue +56 -0
  152. package/components/content/ProseSection.vue +27 -0
  153. package/components/content/ProseStrong.vue +5 -0
  154. package/components/content/ProseTable.vue +7 -0
  155. package/components/content/ProseTbody.vue +5 -0
  156. package/components/content/ProseTd.vue +5 -0
  157. package/components/content/ProseTh.vue +5 -0
  158. package/components/content/ProseThead.vue +5 -0
  159. package/components/content/ProseTr.vue +5 -0
  160. package/components/content/ProseUl.vue +5 -0
  161. package/components/content/ReadMore.vue +41 -0
  162. package/components/content/Shortcut.vue +20 -0
  163. package/components/content/Stack.vue +17 -0
  164. package/components/content/Steps.vue +23 -0
  165. package/components/content/Tabs.vue +52 -0
  166. package/components/content/TabsInner.vue +263 -0
  167. package/components/content/TeamCard.vue +52 -0
  168. package/components/content/TeamCardGroup.vue +5 -0
  169. package/components/content/global/AlertEditor.vue +58 -0
  170. package/components/content/global/BadgeEditor.vue +56 -0
  171. package/components/content/global/BrEditor.vue +3 -0
  172. package/components/content/global/CardEditor.vue +142 -0
  173. package/components/content/global/CardGroupEditor.vue +50 -0
  174. package/components/content/global/CodeGroup.vue +13 -0
  175. package/components/content/global/CodeGroupEditor.vue +50 -0
  176. package/components/content/global/DivEditor.vue +22 -0
  177. package/components/content/global/FieldEditor.vue +38 -0
  178. package/components/content/global/FieldGroupEditor.vue +24 -0
  179. package/components/content/global/HeroEditor.vue +67 -0
  180. package/components/content/global/ProseSectionEditor.vue +180 -0
  181. package/components/content/global/ReadMoreEditor.vue +70 -0
  182. package/components/content/global/SectionEditor.vue +22 -0
  183. package/components/content/global/StackEditor.vue +35 -0
  184. package/components/content/global/StepsEditor.vue +55 -0
  185. package/components/content/global/Tabs._vue +97 -0
  186. package/components/content/global/TabsEditor.vue +38 -0
  187. package/components/layout/Aside.vue +83 -0
  188. package/components/layout/AsideTree.vue +25 -0
  189. package/components/layout/AsideTreeItem.vue +86 -0
  190. package/components/layout/AsideTreeItemButton.vue +32 -0
  191. package/components/layout/Banner.vue +77 -0
  192. package/components/layout/Breadcrumb.vue +34 -0
  193. package/components/layout/DocsFooter.vue +6 -0
  194. package/components/layout/EditLink.vue +23 -0
  195. package/components/layout/Footer.vue +80 -0
  196. package/components/layout/FooterItem.vue +50 -0
  197. package/components/layout/FooterSubmenuItem.vue +39 -0
  198. package/components/layout/Header/Logo.vue +30 -0
  199. package/components/layout/Header/MenuItem.vue +83 -0
  200. package/components/layout/Header/Nav.vue +112 -0
  201. package/components/layout/Header/NavMobile.vue +14 -0
  202. package/components/layout/Header/NavMobileItem.vue +79 -0
  203. package/components/layout/Header/SubmenuItem.vue +39 -0
  204. package/components/layout/Header.vue +160 -0
  205. package/components/layout/LangSwitcher.vue +90 -0
  206. package/components/layout/MobileNav.vue +44 -0
  207. package/components/layout/PrevNext.vue +24 -0
  208. package/components/layout/PrevNextButton.vue +50 -0
  209. package/components/layout/SearchButton.vue +46 -0
  210. package/components/layout/SearchDialog.vue +217 -0
  211. package/components/layout/Title.vue +98 -0
  212. package/components/layout/Toc.vue +99 -0
  213. package/components/layout/TocTree.vue +42 -0
  214. package/components/ui/accordion/Accordion.vue +19 -0
  215. package/components/ui/accordion/AccordionContent.vue +24 -0
  216. package/components/ui/accordion/AccordionItem.vue +24 -0
  217. package/components/ui/accordion/AccordionTrigger.vue +39 -0
  218. package/components/ui/accordion/index.ts +4 -0
  219. package/components/ui/alert/Alert.vue +19 -0
  220. package/components/ui/alert/AlertDescription.vue +14 -0
  221. package/components/ui/alert/AlertTitle.vue +14 -0
  222. package/components/ui/alert/index.ts +23 -0
  223. package/components/ui/avatar/Avatar.vue +25 -0
  224. package/components/ui/avatar/AvatarFallback.vue +11 -0
  225. package/components/ui/avatar/AvatarImage.vue +12 -0
  226. package/components/ui/avatar/index.ts +24 -0
  227. package/components/ui/badge/Badge.vue +17 -0
  228. package/components/ui/badge/index.ts +71 -0
  229. package/components/ui/breadcrumb/Breadcrumb.vue +16 -0
  230. package/components/ui/breadcrumb/BreadcrumbItem.vue +16 -0
  231. package/components/ui/breadcrumb/BreadcrumbLink.vue +23 -0
  232. package/components/ui/breadcrumb/BreadcrumbList.vue +16 -0
  233. package/components/ui/breadcrumb/BreadcrumbPage.vue +19 -0
  234. package/components/ui/breadcrumb/BreadcrumbSeparator.vue +23 -0
  235. package/components/ui/breadcrumb/index.ts +6 -0
  236. package/components/ui/button/Button.vue +29 -0
  237. package/components/ui/button/index.ts +35 -0
  238. package/components/ui/card/Card.vue +21 -0
  239. package/components/ui/card/CardContent.vue +14 -0
  240. package/components/ui/card/CardDescription.vue +14 -0
  241. package/components/ui/card/CardFooter.vue +14 -0
  242. package/components/ui/card/CardHeader.vue +14 -0
  243. package/components/ui/card/CardTitle.vue +18 -0
  244. package/components/ui/card/index.ts +6 -0
  245. package/components/ui/collapsible/Collapsible.vue +18 -0
  246. package/components/ui/collapsible/CollapsibleContent.vue +14 -0
  247. package/components/ui/collapsible/CollapsibleTrigger.vue +11 -0
  248. package/components/ui/collapsible/index.ts +3 -0
  249. package/components/ui/command/Command.vue +89 -0
  250. package/components/ui/command/CommandEmpty.vue +30 -0
  251. package/components/ui/command/CommandGroup.vue +50 -0
  252. package/components/ui/command/CommandInput.vue +44 -0
  253. package/components/ui/command/CommandInputOnly.vue +50 -0
  254. package/components/ui/command/CommandItem.vue +79 -0
  255. package/components/ui/command/CommandList.vue +28 -0
  256. package/components/ui/command/CommandSeparator.vue +24 -0
  257. package/components/ui/command/index.ts +24 -0
  258. package/components/ui/dialog/Dialog.vue +14 -0
  259. package/components/ui/dialog/DialogClose.vue +11 -0
  260. package/components/ui/dialog/DialogContent.vue +52 -0
  261. package/components/ui/dialog/DialogDescription.vue +24 -0
  262. package/components/ui/dialog/DialogFooter.vue +19 -0
  263. package/components/ui/dialog/DialogHeader.vue +16 -0
  264. package/components/ui/dialog/DialogScrollContent.vue +61 -0
  265. package/components/ui/dialog/DialogTitle.vue +29 -0
  266. package/components/ui/dialog/DialogTrigger.vue +11 -0
  267. package/components/ui/dialog/index.ts +9 -0
  268. package/components/ui/input/Input.vue +27 -0
  269. package/components/ui/input/index.ts +1 -0
  270. package/components/ui/label/Label.vue +27 -0
  271. package/components/ui/label/index.ts +1 -0
  272. package/components/ui/navigation-menu/NavigationMenu.vue +33 -0
  273. package/components/ui/navigation-menu/NavigationMenuContent.vue +34 -0
  274. package/components/ui/navigation-menu/NavigationMenuIndicator.vue +24 -0
  275. package/components/ui/navigation-menu/NavigationMenuItem.vue +11 -0
  276. package/components/ui/navigation-menu/NavigationMenuLink.vue +19 -0
  277. package/components/ui/navigation-menu/NavigationMenuList.vue +33 -0
  278. package/components/ui/navigation-menu/NavigationMenuTrigger.vue +34 -0
  279. package/components/ui/navigation-menu/NavigationMenuViewport.vue +33 -0
  280. package/components/ui/navigation-menu/index.ts +14 -0
  281. package/components/ui/popover/Popover.vue +15 -0
  282. package/components/ui/popover/PopoverContent.vue +49 -0
  283. package/components/ui/popover/PopoverTrigger.vue +11 -0
  284. package/components/ui/popover/index.ts +4 -0
  285. package/components/ui/scroll-area/ScrollArea.vue +32 -0
  286. package/components/ui/scroll-area/ScrollBar.vue +41 -0
  287. package/components/ui/scroll-area/index.ts +2 -0
  288. package/components/ui/separator/Separator.vue +20 -0
  289. package/components/ui/separator/index.ts +1 -0
  290. package/components/ui/sheet/Sheet.vue +14 -0
  291. package/components/ui/sheet/SheetClose.vue +11 -0
  292. package/components/ui/sheet/SheetContent.vue +58 -0
  293. package/components/ui/sheet/SheetDescription.vue +22 -0
  294. package/components/ui/sheet/SheetFooter.vue +19 -0
  295. package/components/ui/sheet/SheetHeader.vue +16 -0
  296. package/components/ui/sheet/SheetTitle.vue +22 -0
  297. package/components/ui/sheet/SheetTrigger.vue +11 -0
  298. package/components/ui/sheet/index.ts +31 -0
  299. package/components/ui/slider/Slider.vue +36 -0
  300. package/components/ui/slider/index.ts +1 -0
  301. package/components/ui/tabs/Tabs.vue +15 -0
  302. package/components/ui/tabs/TabsContent.vue +22 -0
  303. package/components/ui/tabs/TabsList.vue +25 -0
  304. package/components/ui/tabs/TabsTrigger.vue +27 -0
  305. package/components/ui/tabs/index.ts +4 -0
  306. package/components/ui/textarea/Textarea.vue +27 -0
  307. package/components/ui/textarea/index.ts +1 -0
  308. package/components/ui/toast/Toast.vue +28 -0
  309. package/components/ui/toast/ToastAction.vue +22 -0
  310. package/components/ui/toast/ToastClose.vue +27 -0
  311. package/components/ui/toast/ToastDescription.vue +22 -0
  312. package/components/ui/toast/ToastProvider.vue +11 -0
  313. package/components/ui/toast/ToastTitle.vue +22 -0
  314. package/components/ui/toast/ToastViewport.vue +20 -0
  315. package/components/ui/toast/Toaster.vue +34 -0
  316. package/components/ui/toast/index.ts +38 -0
  317. package/components/ui/toast/use-toast.ts +165 -0
  318. package/components.json +18 -0
  319. package/composables/useBreadcrumb.ts +47 -0
  320. package/composables/useCollapsedMap.ts +3 -0
  321. package/composables/useConfig.ts +227 -0
  322. package/composables/useEditLink.ts +27 -0
  323. package/composables/useI18nDocs.ts +114 -0
  324. package/composables/useMdcMenu.ts +204 -0
  325. package/composables/usePm.ts +58 -0
  326. package/composables/useScrollspy.ts +51 -0
  327. package/composables/useThemes.ts +46 -0
  328. package/composables/useToast.ts +1 -0
  329. package/content/index.md +45 -0
  330. package/eslint.config.js +3 -0
  331. package/i18n/i18n.config.ts +414 -0
  332. package/index.d.ts +610 -0
  333. package/layouts/blank.vue +5 -0
  334. package/layouts/default.vue +9 -0
  335. package/layouts/editorial.vue +83 -0
  336. package/lib/registry/themes.ts +636 -0
  337. package/lib/uno-preset.ts +143 -0
  338. package/memory-bank/activeContext.md +17 -0
  339. package/memory-bank/productContext.md +21 -0
  340. package/memory-bank/progress.md +16 -0
  341. package/memory-bank/projectbrief.md +20 -0
  342. package/memory-bank/systemPatterns.md +25 -0
  343. package/memory-bank/techContext.md +29 -0
  344. package/modules/inject-css.ts +40 -0
  345. package/nuxt.config.ts +124 -0
  346. package/package.json +71 -0
  347. package/pages/[...slug].vue +109 -0
  348. package/pages/admin/[...slug].vue +145 -0
  349. package/pages/index.vue +24 -0
  350. package/plugins/injectCssHmr.ts +26 -0
  351. package/plugins/wordup.ts +130 -0
  352. package/public/content-doc.json +792 -0
  353. package/public/iconesjs.svg +4 -0
  354. package/scripts/buildContentDoc-cli.ts +8 -0
  355. package/scripts/buildContentDoc.ts +165 -0
  356. package/tailwind.config.js +1 -0
  357. package/tsconfig.json +3 -0
  358. package/uno.config.mjs +58 -0
  359. package/utils/index.ts +12 -0
@@ -0,0 +1,319 @@
1
+ <template>
2
+ <ClientOnly>
3
+ <UiCard class="relative px-8 py-4 [&:not(:first-child)]:mt-5 overflow-hidden">
4
+ <MdcEditor
5
+ v-model="markdown"
6
+ @editor-created="handleEditorCreated"
7
+ />
8
+
9
+ <div
10
+ v-if="isEditorReady"
11
+ class="absolute w-full flex items-center justify-center gap-2 mx--6 mt--10 [--primary:142_71%_45%] h-8"
12
+ >
13
+ <Shortcut
14
+ v-for="(char, index) in currentChars"
15
+ :key="index + currentPosition[0]"
16
+ :value="char || ''"
17
+ size="md"
18
+ class="min-w-6 justify-center"
19
+ :class="[
20
+ char === 'hidden' && '!hidden',
21
+ index === offset-1 && '!h-8 min-w-8 border-primary !font-bold animate-in slide-in-from-bottom-0.5',
22
+ index < offset && 'shadow-lg bg-primary/10',
23
+ index > offset-1 && 'border-none',
24
+ processedContent.markedPositions.has(currentPosition[0] - offset + index) && 'text-white !bg-blue !border-blue',
25
+ processedContent.markedPositions.has(currentPosition[0] - offset + index) && index === offset-1 && '!bg-blue',
26
+ ]"
27
+ :style="{
28
+ opacity: index === offset-1 ? 1
29
+ : index < offset-1 ? Math.max(0, 1 - (offset-2 - index) * 0.1)
30
+ : Math.max(0, 0.9 - (index - offset) * 0.1),
31
+ }"
32
+ />
33
+ </div>
34
+
35
+ <div class="flex items-center gap-2 mx--6 [--primary:142_71%_45%]">
36
+ <div class="flex items-center gap-1">
37
+ <UiButton
38
+ :disabled="currentPosition[0] <= 0"
39
+ size="xs"
40
+ variant="outline"
41
+ @click="firstChar"
42
+ >
43
+ <NuxtIcon name="lucide:chevron-first" />
44
+ </UiButton>
45
+
46
+ <UiButton
47
+ :disabled="currentPosition[0] <= 0"
48
+ size="xs"
49
+ variant="outline"
50
+ @click="prevChar"
51
+ >
52
+ <NuxtIcon name="lucide:chevron-left" />
53
+ </UiButton>
54
+
55
+ <UiButton
56
+ size="sm"
57
+ @click="togglePlayPause"
58
+ >
59
+ <NuxtIcon :name="isPlaying ? 'lucide:pause' : 'lucide:play'" />
60
+ </UiButton>
61
+
62
+ <UiButton
63
+ size="xs"
64
+ variant="outline"
65
+ :disabled="currentPosition[0] >= _content.length"
66
+ @click="nextChar"
67
+ >
68
+ <NuxtIcon name="lucide:chevron-right" />
69
+ </UiButton>
70
+
71
+ <UiButton
72
+ class="min-w-12"
73
+ size="xs"
74
+ variant="outline"
75
+ @click="cycleSpeed"
76
+ >
77
+ x{{ speedLabel }}
78
+ </UiButton>
79
+
80
+ <UiButton
81
+ class="min-w-12"
82
+ size="xs"
83
+ variant="outline"
84
+ @click="onReload"
85
+ >
86
+ <NuxtIcon name="lucide:rotate-cw" />
87
+ </UiButton>
88
+ </div>
89
+
90
+ <UiSlider
91
+ v-model="currentPosition"
92
+ :min="0"
93
+ :max="_content.length"
94
+ :disabled="isPlaying"
95
+ />
96
+ </div>
97
+ </UiCard>
98
+ </ClientOnly>
99
+ </template>
100
+
101
+ <script setup lang="ts">
102
+ import type { Editor } from 'prosekit/core'
103
+
104
+ const props = defineProps<{
105
+ content: string
106
+ defaultPosition?: number
107
+ }>()
108
+
109
+ // Add a function to process content and track marked positions
110
+ const processedContent = computed(() => {
111
+ const markedPositions = new Set<number>()
112
+ const contentArray: string[] = []
113
+ let inMark = false
114
+ let inKbd = false
115
+ let currentPos = 0
116
+ let currentKbdContent = ''
117
+
118
+ const content = props.content?.trim() || ''
119
+ for (let i = 0; i < content.length; i++) {
120
+ if (content.slice(i, i + 7) === '<Xmark>') {
121
+ inMark = true
122
+ i += 6 // Skip the <Xmark> tag
123
+ }
124
+ else if (content.slice(i, i + 8) === '</Xmark>') {
125
+ inMark = false
126
+ i += 7 // Skip the </Xmark> tag
127
+ }
128
+ else if (content.slice(i, i + 6) === '<Xkbd>' || content.slice(i, i + 11) === '<Xkbd mark>') {
129
+ inKbd = true
130
+ currentKbdContent = ''
131
+ if (content.slice(i, i + 11) === '<Xkbd mark>') {
132
+ inMark = true
133
+ i += 10
134
+ }
135
+ else {
136
+ i += 5
137
+ }
138
+ }
139
+ else if (content.slice(i, i + 7) === '</Xkbd>') {
140
+ inKbd = false
141
+ contentArray.push(currentKbdContent)
142
+ currentPos++
143
+ i += 6
144
+ }
145
+ else {
146
+ if (inMark) {
147
+ markedPositions.add(currentPos)
148
+ }
149
+ if (inKbd) {
150
+ inMark = false
151
+ currentKbdContent += content[i]
152
+ }
153
+ else {
154
+ contentArray.push(content[i])
155
+ }
156
+
157
+ currentPos++
158
+ }
159
+ }
160
+
161
+ return {
162
+ content: contentArray,
163
+ markedPositions,
164
+ }
165
+ })
166
+
167
+ // Update _content to use processed content
168
+ const _content = computed(() => processedContent.value.content)
169
+
170
+ const currentPosition = ref(props.defaultPosition ? [props.defaultPosition] : [0])
171
+
172
+ // Update getMdContent to use markedPositions
173
+ const getMdContent = (position: number) => {
174
+ return _content.value.slice(0, position).map((char) => {
175
+ return char.length > 1 ? '\\\n' : char
176
+ }).join('')
177
+ }
178
+
179
+ // Update the md ref
180
+ const markdown = ref(getMdContent(currentPosition.value[0]))
181
+ const isPlaying = ref(false)
182
+ const replayInterval = ref<ReturnType<typeof setInterval>>()
183
+
184
+ const baseSpeed = 250 // base interval in ms
185
+ const speeds = [0.5, 1, 2]
186
+ const currentSpeedIndex = ref(1) // start at 1x speed
187
+
188
+ const speed = computed(() => baseSpeed / speeds[currentSpeedIndex.value])
189
+ const speedLabel = computed(() => speeds[currentSpeedIndex.value])
190
+
191
+ const offset = 6
192
+ const currentChars = computed(() => {
193
+ const start = currentPosition.value[0] - offset
194
+
195
+ return Array.from({ length: offset * 2 + 1 }, (_, i) => {
196
+ const pos = start + i
197
+ if (pos < 0 || pos >= _content.value.length)
198
+ return 'hidden'
199
+ return getCurrentChar(pos + 1)
200
+ })
201
+ })
202
+
203
+ const cycleSpeed = () => {
204
+ currentSpeedIndex.value = (currentSpeedIndex.value + 1) % speeds.length
205
+ if (isPlaying.value) {
206
+ stopReplay()
207
+ startReplay()
208
+ }
209
+ }
210
+
211
+ const startReplay = () => {
212
+ isPlaying.value = true
213
+ replayInterval.value = setInterval(() => {
214
+ if (currentPosition.value[0] < _content.value.length) {
215
+ typeInEditor(_content.value[currentPosition.value[0]])
216
+ currentPosition.value = [currentPosition.value[0] + 1]
217
+ // markdown.value = getMdContent(currentPosition.value[0])
218
+ if (!editor.value?.editor?.focused)
219
+ editor.value?.editor?.focus()
220
+ }
221
+ else {
222
+ stopReplay()
223
+ }
224
+ }, speed.value)
225
+ }
226
+
227
+ const stopReplay = () => {
228
+ if (replayInterval.value) {
229
+ clearInterval(replayInterval.value)
230
+ }
231
+ isPlaying.value = false
232
+ }
233
+
234
+ const togglePlayPause = () => {
235
+ if (isPlaying.value) {
236
+ stopReplay()
237
+ }
238
+ else {
239
+ if (currentPosition.value[0] >= _content.value.length) {
240
+ currentPosition.value = [0]
241
+ markdown.value = ''
242
+ }
243
+ startReplay()
244
+ }
245
+ }
246
+
247
+ const nextChar = () => {
248
+ if (currentPosition.value[0] < _content.value.length) {
249
+ currentPosition.value = [currentPosition.value[0] + 1]
250
+ markdown.value = getMdContent(currentPosition.value[0])
251
+ }
252
+ }
253
+
254
+ const prevChar = () => {
255
+ if (currentPosition.value[0] > 0) {
256
+ currentPosition.value = [currentPosition.value[0] - 1]
257
+ markdown.value = getMdContent(currentPosition.value[0])
258
+ }
259
+ }
260
+
261
+ const firstChar = () => {
262
+ currentPosition.value = [0]
263
+ markdown.value = ''
264
+ }
265
+
266
+ const onReload = () => {
267
+ currentPosition.value = props.defaultPosition ? [props.defaultPosition] : [0]
268
+ }
269
+
270
+ // Watch for manual slider changes when not playing
271
+ watch(currentPosition, (newPos) => {
272
+ if (!isPlaying.value) {
273
+ markdown.value = getMdContent(newPos[0])
274
+ }
275
+ })
276
+
277
+ const getCurrentChar = (pos: number): string | null => {
278
+ const char = _content.value[pos - 1] || null
279
+ return char === ' ' ? '␣' : char === '\n' ? '↵' : char
280
+ }
281
+
282
+ const editor = ref<{ editor: Editor }>()
283
+ const isEditorReady = ref(false)
284
+ const handleEditorCreated = (_editor: { editor: Editor }) => {
285
+ editor.value = _editor
286
+ isEditorReady.value = true
287
+ }
288
+
289
+ const typeInEditor = (key: string) => {
290
+ if (!editor.value?.editor || !key) return
291
+ const _editor = toRaw(editor.value.editor)
292
+
293
+ if (key === '\n') {
294
+ const tr = _editor.view.state.tr.replaceSelectionWith(_editor.view.state.schema.nodes.paragraph.create())
295
+ _editor.view.dispatch(tr)
296
+ }
297
+ else if (key === 'Shift+Enter') {
298
+ const tr = _editor.view.state.tr.replaceSelectionWith(_editor.view.state.schema.node('hardBreak'))
299
+ _editor.view.dispatch(tr)
300
+ }
301
+ else if (key === 'Enter') {
302
+ // Handle space separately
303
+ const tr = _editor.view.state.tr.replaceSelectionWith(_editor.view.state.schema.node('hardBreak'))
304
+ _editor.view.dispatch(tr)
305
+ }
306
+ else {
307
+ // Insert text at current selection
308
+ // const { from, to } = _editor.view.state.selection
309
+ // const tr = _editor.view.state.tr.replaceWith(
310
+ // from,
311
+ // to,
312
+ // _editor.view.state.schema.text(key),
313
+ // )
314
+ const node = _editor.view.state.schema.text(key)
315
+ const tr = _editor.view.state.tr.replaceSelectionWith(node)
316
+ _editor.view.dispatch(tr)
317
+ }
318
+ }
319
+ </script>
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: Introduction
3
+ description: Documentation about how to write and configure the website.
4
+ icon: lucide:info
5
+ toc: false
6
+ ---
7
+
8
+ :card-group{data="/getting-started/writing"}
@@ -0,0 +1,56 @@
1
+ ---
2
+ title: Markdown
3
+ description: How to write content with Markdown syntax
4
+ icon: i-pajamas:markdown-mark-solid
5
+ ---
6
+
7
+ Markdown is a lightweight markup language designed to provide a simple and readable syntax with minimal markup.
8
+
9
+ Its goal is to allow users to write using an easy-to-read and easy-to-write plain text that can be easily converted to structurally valid HTML or other rich text formats, focusing on content over formatting.
10
+
11
+ This minimalism makes Markdown ideal for documentation, web writing, collaborative editing, bots and LLMs processing, AI content generation...
12
+
13
+ ::div{.w-full.flex.items-center.gap-2.mt-5}
14
+ :div[:robot:]{.text-3xl.mt--2}
15
+
16
+ :div[:heart:]{.text-xl}
17
+
18
+ :icon{name="vscode-icons:file-type-markdown" .text-4xl}
19
+ ::
20
+
21
+ ::alert
22
+ ---
23
+ to: /content-elements
24
+ icon: lucide:box
25
+ ---
26
+ Learn more about **markdown syntax**, and how to use it.
27
+ ::
28
+
29
+ ::alert
30
+ ---
31
+ to: https://daringfireball.net/projects/markdown/
32
+ icon: i-pajamas:markdown-mark-solid
33
+ ---
34
+ Open the original **Markdown specification**.
35
+ ::
36
+
37
+ ## MarkDown Components (MDC)
38
+
39
+ MarkDown Components (MDC) supercharges regular Markdown to allow writing interactive components.
40
+
41
+ ::alert
42
+ ---
43
+ to: /components
44
+ icon: lucide:box
45
+ ---
46
+ Learn more about **MDC components**, and how to use them.
47
+ ::
48
+
49
+ ::alert
50
+ ---
51
+ to: https://content.nuxt.com/usage/markdown
52
+ target: _blank
53
+ icon: lucide:arrow-big-down
54
+ ---
55
+ Read the detailed MDC usage guide in the **Nuxt Content** Docs.
56
+ ::
@@ -0,0 +1,177 @@
1
+ ---
2
+ title: Pages
3
+ description: Front matter attributes.
4
+ icon: lucide:file
5
+ key: example
6
+ ---
7
+
8
+ ## `^-` Frontmatter
9
+
10
+ Front-matter is a convention of Markdown-based CMS to provide metadata to documents, like description or title. Remark MDC uses the YAML syntax with `key: value` pairs.
11
+
12
+ To define frontmatter, start your document with `---\n---` section and put your desired data in YAML format within this section.
13
+
14
+ ```md
15
+ ---
16
+ title: Title of the page
17
+ description: meta description of the page
18
+ ---
19
+
20
+ <!-- Content of the page -->
21
+ ```
22
+
23
+ You can reuse the same frontmatter attributes in the content or in the components props.\
24
+ Add `:` before the key to bind the frontmatter value to the component.\
25
+ Or use the `{{ $doc.key }}` syntax to bind the value of the frontmatter.
26
+
27
+ ::stack
28
+ ::div{class="p-4"}
29
+ This is the title from the frontmatter: **Title of the page**.
30
+
31
+ ::alert
32
+ ---
33
+ :type: key
34
+ ---
35
+ With the property `:type: key`, it displays a **{{ $doc.key }} alert**.
36
+ ::
37
+
38
+ Or inline:
39
+
40
+ :alert[Title of the page]{:type="key" :icon="icon"}
41
+ ::
42
+
43
+ ```mdc
44
+ ---
45
+ title: Title of the page
46
+ icon: lucide:file
47
+ key: example
48
+ ---
49
+
50
+ This is the title from the frontmatter: **{{ $doc.title }}**.
51
+
52
+ ::alert
53
+ ---
54
+ :type: key
55
+ ---
56
+ With the property `:type: key`, it displays a **{{ $doc.key }} alert**.
57
+ ::
58
+
59
+ Or inline:
60
+
61
+ :alert[{{ $doc.title }}]{:type="key" :icon="icon"}
62
+ ```
63
+ ::
64
+
65
+ ## Available Frontmatter Attributes
66
+
67
+ ```md
68
+ ---
69
+ title: Front Matter
70
+ description: Front matter attributes used in shadcn-docs-nuxt.
71
+ icon: lucide:book-type
72
+
73
+ navTruncate: false
74
+ navBadges:
75
+ - value: New
76
+ type: lime
77
+
78
+ badges:
79
+ - value: Docus
80
+ to: https://docus.dev/api/components#alert
81
+ target: _blank
82
+ - value: Source
83
+ icon: lucide:code
84
+ to: https://github.com/ZTL-UwU/shadcn-docs-nuxt/blob/main/components/content/Alert.vue
85
+ target: _blank
86
+
87
+ authors:
88
+ - name: Tony Zhang
89
+ username: ZTL-UwU
90
+ avatar: https://www.github.com/ZTL-UwU.png
91
+ to: https://github.com/ZTL-UwU
92
+ target: _blank
93
+ ---
94
+
95
+ <!-- Content of the page -->
96
+ ```
97
+
98
+ ## Showcases
99
+
100
+ ::tabs{variant="line"}
101
+ ::stack{label="badges"}
102
+ ![badges-showcase](/front-matter-showcase/badges.png){class="w-full"}
103
+ ```yml
104
+ badges:
105
+ - value: 0.8.10
106
+ - value: Source
107
+ icon: lucide:code
108
+ to: https://github.com/ZTL-UwU/shadcn-docs-nuxt/blob/main/components/content/FileTree.vue
109
+ target: _blank
110
+ ```
111
+ ::
112
+
113
+ ::stack{label="authors"}
114
+ ![authors-showcase](/front-matter-showcase/authors.png){class="w-full"}
115
+ ```yml
116
+ authors:
117
+ - name: Tony Zhang
118
+ username: ZTL-UwU
119
+ avatar: https://www.github.com/ZTL-UwU.png
120
+ to: https://github.com/ZTL-UwU
121
+ target: _blank
122
+ ```
123
+ ::
124
+
125
+ ::stack{label="navBadges"}
126
+ ![nav-badges-showcase](/front-matter-showcase/nav-badges.png){class="w-full"}
127
+ ```yml
128
+ navBadges:
129
+ - value: New
130
+ type: lime
131
+ ```
132
+ ::
133
+ ::
134
+
135
+ ## Parameters
136
+
137
+ ::field-group
138
+ ::field{name="title" type="string"}
139
+ Title of the page. Defaults to the filename.
140
+ ::
141
+ ::field{name="description" type="string"}
142
+ Description of the page. Defaults to the first `<p>`{lang="html"} of the page.
143
+ ::
144
+ ::field{name="navigation" type="boolean" default-value="true"}
145
+ Define if the page is included in the sidebar. Set it to `false` in `index.md`.
146
+ ::
147
+ ::field{name="icon" type="string"}
148
+ The icon shown in the sidebar for the page.
149
+ ::
150
+ ::field{name="navBadges" type="[]"}
151
+ A list of badges appended to the end of the sidebar link.
152
+ ::
153
+ ::field{name="navTruncate" type="boolean" default-value="true"}
154
+ Whether to truncate the sidebar title.
155
+ ::
156
+ ::field{name="badges" type="[]"}
157
+ A list of badges shown at the bottom of page title.
158
+ ::
159
+ ::field{name="authors" type="[]"}
160
+ A list of authors shown at the bottom of page title.
161
+ ::
162
+ ::field{name="toc" type="boolean" default-value="true"}
163
+ Whether to show the toc section for this page.
164
+ ::
165
+ ::field{name="aside" type="boolean" default-value="true"}
166
+ Whether to show the aside section for this page.
167
+ ::
168
+ ::field{name="editLink" type="boolean" default-value="true"}
169
+ Whether to show the edit link for this page.
170
+ ::
171
+ ::field{name="prevNext" type="boolean" default-value="true"}
172
+ Whether to show the previous & next page buttons.
173
+ ::
174
+ ::field{name="breadcrumb" type="boolean" default-value="true"}
175
+ Whether to show the breadcrumb.
176
+ ::
177
+ ::
@@ -0,0 +1,56 @@
1
+ ---
2
+ title: Folders
3
+ icon: lucide:folder
4
+ description: Configure directory nodes via _dir.yml files.
5
+ ---
6
+
7
+ You can customize folders by creating a `_dir.yml` file in the folder.
8
+
9
+ ::code-group
10
+ ```yml [_dir.yml]
11
+ title: Folder
12
+ icon: lucide:folder
13
+ navigation.redirect: /frameworks/vue
14
+ navBadges:
15
+ - value: New
16
+ type: lime
17
+ sidebar:
18
+ style: group
19
+ collapse: false
20
+ ```
21
+ ```[Directory structure]
22
+ content/
23
+ 1.frameworks/
24
+ _dir.yml
25
+ 1.vue.md
26
+ 2.nuxt.md
27
+ ```
28
+ ::
29
+
30
+ ## Parameters
31
+
32
+ ::field-group
33
+ ::field{name="title" type="string"}
34
+ Title of the page. Defaults to the filename.
35
+ ::
36
+ ::field{name="icon" type="string"}
37
+ The icon shown in the sidebar for the page.
38
+ ::
39
+ ::field{name="navBadges" type="[]"}
40
+ A list of badges appended to the end of the sidebar link.
41
+ ::
42
+ ::field{name="collapse" type="boolean"}
43
+ Whether the folder should be collapsed by default.
44
+ ::
45
+ ::field{name="sidebar" type="object"}
46
+ ::collapsible{title="Details" default-open}
47
+ ::field{name="style" type="'default' | 'tree' | 'group'" default-value="default"}
48
+ The style used for the folder. The default value can be configured in the [appConfig](/development/configuration/overview#aside).
49
+
50
+ | `default` | `tree` | `group` |
51
+ | :-------------------------------------------------: | :-------------------------------------------: | :---------------------------------------------: |
52
+ | ![sidebar-default](/sidebar-default.png){width=400} | ![sidebar-tree](/sidebar-tree.png){width=400} | ![sidebar-group](/sidebar-group.png){width=400} |
53
+ ::
54
+ ::
55
+ ::
56
+ ::
@@ -0,0 +1,3 @@
1
+ title: Writing
2
+ icon: lucide:edit
3
+ navigation.redirect: /getting-started/writing/markdown
@@ -0,0 +1,3 @@
1
+ title: Getting started
2
+ icon: lucide:rocket
3
+ navigation.redirect: /getting-started/introduction
@@ -0,0 +1,60 @@
1
+ ---
2
+ title: Text Formatting
3
+ description: Text styling with bold and italic formatting.
4
+ icon: lucide:bold
5
+ ---
6
+
7
+ ## Usage
8
+
9
+ ### Strong
10
+
11
+ Wrap the text with double asterisks <kbd>\*</kbd><kbd>\*</kbd> to make text bold.\
12
+ Or (less used) use double underscores <kbd>\_</kbd><kbd>\_</kbd>.
13
+
14
+ ::stack
15
+ :::div{.p-4}
16
+ A strong **word**.
17
+
18
+ Another __strong__ word (less used).
19
+ :::
20
+
21
+ ```md
22
+ A strong **word**.
23
+
24
+ Another __strong__ word (less used).
25
+ ```
26
+ ::
27
+
28
+ ### Italic
29
+
30
+ Wrap the text with single underscores <kbd>_</kbd> to make text italic.\
31
+ Or (less used) use single asterisks <kbd>*</kbd>.
32
+
33
+ ::stack
34
+ :::div{.p-4}
35
+ An italic _word_.
36
+
37
+ Another *italic* word (less used).
38
+ :::
39
+
40
+ ```md
41
+ An italic _word_.
42
+
43
+ Another *italic* word (less used).
44
+ ```
45
+ ::
46
+
47
+
48
+ ## Tips
49
+
50
+ You can also use this syntax while writing content in `edition mode`.
51
+
52
+ ::mdc-replay
53
+ ---
54
+ content: |
55
+ A <Xmark>**</Xmark>strong<Xmark>**</Xmark> word.
56
+
57
+ An <Xmark>_</Xmark>italic<Xmark>_</Xmark> word.
58
+ default-position: 4
59
+ ---
60
+ ::