docus 2.1.0 → 3.0.0-beta.3

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 (274) hide show
  1. package/README.md +6 -4
  2. package/app/router.options.ts +18 -0
  3. package/assets/css/fonts.css +84 -0
  4. package/assets/css/main.css +11 -0
  5. package/assets/css/tailwind.css +282 -0
  6. package/components/app/Container.vue +25 -0
  7. package/components/app/Footer.vue +40 -0
  8. package/components/app/Navbar.vue +26 -0
  9. package/components/app/NavbarLogo.vue +33 -0
  10. package/components/app/Page.vue +7 -0
  11. package/components/app/PoweredByDocus.vue +11 -0
  12. package/components/content/Alert.vue +124 -0
  13. package/components/content/BlockHero.vue +54 -0
  14. package/components/content/ButtonLink.vue +45 -0
  15. package/components/content/Card.vue +46 -0
  16. package/components/content/CardGrid.vue +23 -0
  17. package/components/content/CodeBlock.vue +47 -0
  18. package/components/content/CodeGroup.vue +135 -0
  19. package/components/content/CopyButton.vue +49 -0
  20. package/{dist/runtime/app/components/prose/ProseOl.vue → components/content/List.vue} +2 -2
  21. package/components/content/NeedContribution.vue +23 -0
  22. package/components/content/ReadMore.vue +25 -0
  23. package/components/content/Sandbox.vue +102 -0
  24. package/components/content/TabsHeader.vue +44 -0
  25. package/components/content/Terminal.vue +64 -0
  26. package/components/content/VideoPlayer.vue +115 -0
  27. package/components/docs/DocsAside.vue +21 -0
  28. package/components/docs/DocsAsideTree.vue +102 -0
  29. package/components/docs/DocsHero.vue +39 -0
  30. package/components/docs/DocsPage.vue +22 -0
  31. package/components/docs/DocsPageContent.vue +31 -0
  32. package/components/docs/DocsToc.vue +74 -0
  33. package/components/globals/Icon.vue +24 -0
  34. package/{dist/runtime/app/components/prose/ProseHr.vue → components/globals/Logo.vue} +1 -1
  35. package/components/globals/NuxtImg.vue +45 -0
  36. package/components/globals/SocialIcons.vue +45 -0
  37. package/components/globals/ThemeSelect.vue +35 -0
  38. package/components/icons/IconAlgolia.vue +8 -0
  39. package/components/icons/IconArrowLeft.vue +10 -0
  40. package/components/icons/IconArrowRight.vue +10 -0
  41. package/components/icons/IconBadgeCheck.vue +14 -0
  42. package/components/icons/IconCheck.vue +10 -0
  43. package/components/icons/IconCheckCircle.vue +10 -0
  44. package/components/icons/IconChevronRight.vue +12 -0
  45. package/components/icons/IconClipboardCheck.vue +14 -0
  46. package/components/icons/IconClipboardCopy.vue +14 -0
  47. package/components/icons/IconCodeSandbox.vue +8 -0
  48. package/components/icons/IconCopy.vue +17 -0
  49. package/components/icons/IconDots.vue +10 -0
  50. package/components/icons/IconEdit.vue +18 -0
  51. package/components/icons/IconExclamationCircle.vue +12 -0
  52. package/components/icons/IconExclamationTriangle.vue +10 -0
  53. package/components/icons/IconExternalLink.vue +12 -0
  54. package/components/icons/IconGit.vue +7 -0
  55. package/components/icons/IconGitHub.vue +10 -0
  56. package/components/icons/IconHeart.vue +9 -0
  57. package/components/icons/IconInformationCircle.vue +10 -0
  58. package/components/icons/IconLighthouse.vue +83 -0
  59. package/components/icons/IconLine.vue +10 -0
  60. package/components/icons/IconMarkdown.vue +13 -0
  61. package/components/icons/IconMenu.vue +12 -0
  62. package/components/icons/IconMenuAlt.vue +10 -0
  63. package/components/icons/IconMinus.vue +10 -0
  64. package/components/icons/IconMoon.vue +10 -0
  65. package/components/icons/IconNuxt.vue +14 -0
  66. package/components/icons/IconNuxtContent.vue +20 -0
  67. package/components/icons/IconNuxtLabs.vue +21 -0
  68. package/components/icons/IconPlus.vue +10 -0
  69. package/components/icons/IconPuzzle.vue +8 -0
  70. package/components/icons/IconSSG.vue +7 -0
  71. package/components/icons/IconSearch.vue +12 -0
  72. package/components/icons/IconSun.vue +10 -0
  73. package/components/icons/IconTocBack.vue +21 -0
  74. package/components/icons/IconTocCurrent.vue +21 -0
  75. package/components/icons/IconTocNext.vue +8 -0
  76. package/components/icons/IconTranslate.vue +14 -0
  77. package/components/icons/IconTwitter.vue +8 -0
  78. package/components/icons/IconVite.vue +30 -0
  79. package/components/icons/IconVue.vue +6 -0
  80. package/components/icons/IconVueTelescope.vue +11 -0
  81. package/components/icons/IconWindi.vue +17 -0
  82. package/components/icons/IconX.vue +12 -0
  83. package/components/icons/IconXCircle.vue +10 -0
  84. package/components/icons/IconZap.vue +8 -0
  85. package/components/prose/ProseA.vue +66 -0
  86. package/components/prose/ProseBlockquote.vue +21 -0
  87. package/components/prose/ProseCode.vue +68 -0
  88. package/components/prose/ProseCodeInline.vue +38 -0
  89. package/components/prose/ProseEm.vue +11 -0
  90. package/components/prose/ProseH1.vue +22 -0
  91. package/components/prose/ProseH2.vue +22 -0
  92. package/components/prose/ProseH3.vue +24 -0
  93. package/components/prose/ProseH4.vue +24 -0
  94. package/components/prose/ProseHr.vue +13 -0
  95. package/components/prose/ProseImg.vue +30 -0
  96. package/components/prose/ProseLi.vue +31 -0
  97. package/components/prose/ProseOl.vue +16 -0
  98. package/components/prose/ProseP.vue +14 -0
  99. package/components/prose/ProseStrong.vue +14 -0
  100. package/components/prose/ProseTable.vue +13 -0
  101. package/{dist/runtime/app/components → components}/prose/ProseTbody.vue +0 -0
  102. package/components/prose/ProseTd.vue +11 -0
  103. package/components/prose/ProseTh.vue +11 -0
  104. package/components/prose/ProseThead.vue +11 -0
  105. package/components/prose/ProseTr.vue +11 -0
  106. package/components/prose/ProseUl.vue +15 -0
  107. package/composables/useContent.ts +156 -0
  108. package/composables/useMenu.ts +22 -0
  109. package/composables/useScrollToHeading.ts +35 -0
  110. package/composables/useScrollspy.ts +46 -0
  111. package/composables/useTheme.ts +12 -0
  112. package/layouts/default.vue +29 -0
  113. package/layouts/page.vue +11 -0
  114. package/nuxt.config.ts +151 -0
  115. package/package.json +46 -83
  116. package/pages/[...slug].vue +26 -0
  117. package/public/android-chrome-192x192.png +0 -0
  118. package/public/android-chrome-512x512.png +0 -0
  119. package/public/apple-touch-icon.png +0 -0
  120. package/public/favicon-16x16.png +0 -0
  121. package/public/favicon-32x32.png +0 -0
  122. package/public/favicon.ico +0 -0
  123. package/public/site.webmanifest +1 -0
  124. package/LICENSE +0 -21
  125. package/dist/index.cjs +0 -549
  126. package/dist/index.d.ts +0 -25
  127. package/dist/index.mjs +0 -523
  128. package/dist/runtime/app/components/DocusContent.vue +0 -215
  129. package/dist/runtime/app/components/DocusContent.vue.d.ts +0 -25
  130. package/dist/runtime/app/components/Error.vue +0 -19
  131. package/dist/runtime/app/components/Error.vue.d.ts +0 -9
  132. package/dist/runtime/app/components/Markdown.vue +0 -56
  133. package/dist/runtime/app/components/Markdown.vue.d.ts +0 -25
  134. package/dist/runtime/app/components/Page.vue +0 -29
  135. package/dist/runtime/app/components/Page.vue.d.ts +0 -2
  136. package/dist/runtime/app/components/Props.vue +0 -130
  137. package/dist/runtime/app/components/Props.vue.d.ts +0 -80
  138. package/dist/runtime/app/components/prose/ProseA.vue +0 -41
  139. package/dist/runtime/app/components/prose/ProseA.vue.d.ts +0 -23
  140. package/dist/runtime/app/components/prose/ProseBlockquote.vue +0 -5
  141. package/dist/runtime/app/components/prose/ProseCode.vue +0 -5
  142. package/dist/runtime/app/components/prose/ProseCodeInline.vue +0 -5
  143. package/dist/runtime/app/components/prose/ProseEm.vue +0 -5
  144. package/dist/runtime/app/components/prose/ProseH1.vue +0 -3
  145. package/dist/runtime/app/components/prose/ProseH2.vue +0 -3
  146. package/dist/runtime/app/components/prose/ProseH3.vue +0 -3
  147. package/dist/runtime/app/components/prose/ProseH4.vue +0 -3
  148. package/dist/runtime/app/components/prose/ProseH5.vue +0 -3
  149. package/dist/runtime/app/components/prose/ProseH6.vue +0 -3
  150. package/dist/runtime/app/components/prose/ProseImg.vue +0 -32
  151. package/dist/runtime/app/components/prose/ProseImg.vue.d.ts +0 -21
  152. package/dist/runtime/app/components/prose/ProseLi.vue +0 -3
  153. package/dist/runtime/app/components/prose/ProseParagraph.vue +0 -3
  154. package/dist/runtime/app/components/prose/ProseStrong.vue +0 -5
  155. package/dist/runtime/app/components/prose/ProseTable.vue +0 -5
  156. package/dist/runtime/app/components/prose/ProseTd.vue +0 -5
  157. package/dist/runtime/app/components/prose/ProseTh.vue +0 -5
  158. package/dist/runtime/app/components/prose/ProseThead.vue +0 -5
  159. package/dist/runtime/app/components/prose/ProseTr.vue +0 -5
  160. package/dist/runtime/app/components/prose/ProseUl.vue +0 -5
  161. package/dist/runtime/app/composables/helpers.d.ts +0 -4
  162. package/dist/runtime/app/composables/helpers.js +0 -66
  163. package/dist/runtime/app/composables/helpers.mjs +0 -40
  164. package/dist/runtime/app/composables/index.d.ts +0 -90
  165. package/dist/runtime/app/composables/index.js +0 -108
  166. package/dist/runtime/app/composables/index.mjs +0 -63
  167. package/dist/runtime/app/composables/navigation.d.ts +0 -37
  168. package/dist/runtime/app/composables/navigation.js +0 -227
  169. package/dist/runtime/app/composables/navigation.mjs +0 -148
  170. package/dist/runtime/app/composables/store.d.ts +0 -7
  171. package/dist/runtime/app/composables/store.js +0 -52
  172. package/dist/runtime/app/composables/store.mjs +0 -35
  173. package/dist/runtime/app/composables/style.d.ts +0 -11
  174. package/dist/runtime/app/composables/style.js +0 -117
  175. package/dist/runtime/app/composables/style.mjs +0 -71
  176. package/dist/runtime/app/composables/theme-colors.d.ts +0 -30
  177. package/dist/runtime/app/composables/theme-colors.js +0 -80
  178. package/dist/runtime/app/composables/theme-colors.mjs +0 -48
  179. package/dist/runtime/app/composables/websocket.d.ts +0 -3
  180. package/dist/runtime/app/composables/websocket.js +0 -79
  181. package/dist/runtime/app/composables/websocket.mjs +0 -63
  182. package/dist/runtime/app/layouts/default.vue +0 -5
  183. package/dist/runtime/app/layouts/error.vue +0 -33
  184. package/dist/runtime/app/layouts/error.vue.d.ts +0 -21
  185. package/dist/runtime/app/pages/_.vue +0 -222
  186. package/dist/runtime/app/pages/_.vue.d.ts +0 -2
  187. package/dist/runtime/context.d.ts +0 -1
  188. package/dist/runtime/context.js +0 -17
  189. package/dist/runtime/context.mjs +0 -5
  190. package/dist/runtime/database/Query.d.ts +0 -18
  191. package/dist/runtime/database/Query.js +0 -68
  192. package/dist/runtime/database/Query.mjs +0 -49
  193. package/dist/runtime/database/index.d.ts +0 -4
  194. package/dist/runtime/database/index.js +0 -45
  195. package/dist/runtime/database/index.mjs +0 -25
  196. package/dist/runtime/database/providers/local/Query.d.ts +0 -14
  197. package/dist/runtime/database/providers/local/Query.js +0 -85
  198. package/dist/runtime/database/providers/local/Query.mjs +0 -60
  199. package/dist/runtime/database/providers/local/index.d.ts +0 -3
  200. package/dist/runtime/database/providers/local/index.js +0 -63
  201. package/dist/runtime/database/providers/local/index.mjs +0 -39
  202. package/dist/runtime/database/providers/local/operations.d.ts +0 -2
  203. package/dist/runtime/database/providers/local/operations.js +0 -83
  204. package/dist/runtime/database/providers/local/operations.mjs +0 -53
  205. package/dist/runtime/database/providers/local/utils.d.ts +0 -8
  206. package/dist/runtime/database/providers/local/utils.js +0 -28
  207. package/dist/runtime/database/providers/local/utils.mjs +0 -17
  208. package/dist/runtime/index.d.ts +0 -3
  209. package/dist/runtime/index.js +0 -44
  210. package/dist/runtime/index.mjs +0 -3
  211. package/dist/runtime/navigation.d.ts +0 -4
  212. package/dist/runtime/navigation.js +0 -176
  213. package/dist/runtime/navigation.mjs +0 -137
  214. package/dist/runtime/server/api/get.d.ts +0 -10
  215. package/dist/runtime/server/api/get.js +0 -24
  216. package/dist/runtime/server/api/get.mjs +0 -13
  217. package/dist/runtime/server/api/list.d.ts +0 -9
  218. package/dist/runtime/server/api/list.js +0 -34
  219. package/dist/runtime/server/api/list.mjs +0 -18
  220. package/dist/runtime/server/api/navigation.d.ts +0 -7
  221. package/dist/runtime/server/api/navigation.js +0 -20
  222. package/dist/runtime/server/api/navigation.mjs +0 -10
  223. package/dist/runtime/server/api/preview.d.ts +0 -3
  224. package/dist/runtime/server/api/preview.js +0 -54
  225. package/dist/runtime/server/api/preview.mjs +0 -31
  226. package/dist/runtime/server/api/reload.d.ts +0 -6
  227. package/dist/runtime/server/api/reload.js +0 -27
  228. package/dist/runtime/server/api/reload.mjs +0 -11
  229. package/dist/runtime/server/api/search.d.ts +0 -6
  230. package/dist/runtime/server/api/search.js +0 -27
  231. package/dist/runtime/server/api/search.mjs +0 -13
  232. package/dist/runtime/server/content.d.ts +0 -46
  233. package/dist/runtime/server/content.js +0 -175
  234. package/dist/runtime/server/content.mjs +0 -114
  235. package/dist/runtime/server/socket.d.ts +0 -9
  236. package/dist/runtime/server/socket.js +0 -33
  237. package/dist/runtime/server/socket.mjs +0 -20
  238. package/dist/runtime/server/utils/cache.d.ts +0 -19
  239. package/dist/runtime/server/utils/cache.js +0 -110
  240. package/dist/runtime/server/utils/cache.mjs +0 -75
  241. package/dist/runtime/server/utils/index.d.ts +0 -4
  242. package/dist/runtime/server/utils/index.js +0 -18
  243. package/dist/runtime/server/utils/index.mjs +0 -8
  244. package/dist/runtime/transformers/index.d.ts +0 -1
  245. package/dist/runtime/transformers/index.js +0 -26
  246. package/dist/runtime/transformers/index.mjs +0 -11
  247. package/dist/runtime/transformers/json.d.ts +0 -3
  248. package/dist/runtime/transformers/json.js +0 -15
  249. package/dist/runtime/transformers/json.mjs +0 -5
  250. package/dist/runtime/transformers/markdown/index.d.ts +0 -8
  251. package/dist/runtime/transformers/markdown/index.js +0 -25
  252. package/dist/runtime/transformers/markdown/index.mjs +0 -16
  253. package/dist/runtime/transformers/utils/index.d.ts +0 -1
  254. package/dist/runtime/transformers/utils/index.js +0 -18
  255. package/dist/runtime/transformers/utils/index.mjs +0 -1
  256. package/dist/runtime/transformers/utils/path.d.ts +0 -26
  257. package/dist/runtime/transformers/utils/path.js +0 -88
  258. package/dist/runtime/transformers/utils/path.mjs +0 -56
  259. package/dist/runtime/utils/index.d.ts +0 -1
  260. package/dist/runtime/utils/index.js +0 -18
  261. package/dist/runtime/utils/index.mjs +0 -1
  262. package/dist/runtime/utils/log.d.ts +0 -1
  263. package/dist/runtime/utils/log.js +0 -14
  264. package/dist/runtime/utils/log.mjs +0 -2
  265. package/dist/runtime/utils/object.d.ts +0 -9
  266. package/dist/runtime/utils/object.js +0 -22
  267. package/dist/runtime/utils/object.mjs +0 -4
  268. package/dist/templates/content.mjs +0 -50
  269. package/dist/templates/docus.mjs +0 -13
  270. package/dist/templates/hot.mjs +0 -16
  271. package/dist/templates/i18n.mjs +0 -23
  272. package/dist/templates/options.mjs +0 -46
  273. package/shims.d.ts +0 -24
  274. package/types.d.ts +0 -397
@@ -0,0 +1,22 @@
1
+ import { useState } from '#imports'
2
+
3
+ export const useMenu = () => {
4
+ // Menu visible reference
5
+ const visible = useState('menu-visible', () => false)
6
+
7
+ // Open the menu
8
+ const open = () => (visible.value = true)
9
+
10
+ // Close the menu
11
+ const close = () => (visible.value = false)
12
+
13
+ // Toggle the menu (useful for one-off buttons)
14
+ const toggle = () => (visible.value = !visible.value)
15
+
16
+ return {
17
+ open,
18
+ close,
19
+ toggle,
20
+ visible,
21
+ }
22
+ }
@@ -0,0 +1,35 @@
1
+ export const useConvertPropToPixels = (prop: string): number => {
2
+ const tempDiv = document.createElement('div')
3
+
4
+ tempDiv.style.position = 'absolute'
5
+ tempDiv.style.opacity = '0'
6
+ tempDiv.style.height = getComputedStyle(document.documentElement).getPropertyValue(prop)
7
+
8
+ document.body.appendChild(tempDiv)
9
+
10
+ const pixels = parseInt(getComputedStyle(tempDiv).height)
11
+
12
+ document.body.removeChild(tempDiv)
13
+
14
+ return pixels
15
+ }
16
+
17
+ export const useScrollToHeading = (id: string, scrollMarginCssVar: string) => {
18
+ // Use replaceState to prevent page jump when adding hash
19
+ history.replaceState({}, '', `#${id}`)
20
+
21
+ // Do not remove setTimeout (does not work in Safari)
22
+ setTimeout(() => {
23
+ const escapedId = id.replace(/\./g, '\\.')
24
+
25
+ const heading = document.querySelector(`#${escapedId}`) as any
26
+
27
+ const offset = heading.offsetTop - useConvertPropToPixels(scrollMarginCssVar)
28
+
29
+ window.scrollTo({
30
+ top: offset,
31
+ left: 0,
32
+ behavior: 'smooth',
33
+ })
34
+ })
35
+ }
@@ -0,0 +1,46 @@
1
+ import type { Ref } from 'vue'
2
+ import { onBeforeMount, onBeforeUnmount, ref, watch } from '#imports'
3
+
4
+ /**
5
+ * Scrollspy allows you to watch visible headings in a specific page.
6
+ * Useful for table of contents live style updates.
7
+ */
8
+ export const useScrollspy = () => {
9
+ const observer = ref() as Ref<IntersectionObserver>
10
+ const visibleHeadings = ref([]) as Ref<string[]>
11
+ const activeHeadings = ref([]) as Ref<string[]>
12
+
13
+ const observerCallback = (entries: IntersectionObserverEntry[]) =>
14
+ entries.forEach((entry) => {
15
+ const id = entry.target.id
16
+
17
+ if (entry.isIntersecting)
18
+ visibleHeadings.value.push(id)
19
+ else
20
+ visibleHeadings.value = visibleHeadings.value.filter(t => t !== id)
21
+ })
22
+
23
+ const updateHeadings = (headings: Element[]) =>
24
+ headings.forEach((heading) => {
25
+ observer.value.observe(heading)
26
+ })
27
+
28
+ watch(visibleHeadings, (val, oldVal) => {
29
+ if (val.length === 0)
30
+ activeHeadings.value = oldVal
31
+ else
32
+ activeHeadings.value = val
33
+ })
34
+
35
+ // Create intersection observer
36
+ onBeforeMount(() => (observer.value = new IntersectionObserver(observerCallback)))
37
+
38
+ // Destroy it
39
+ onBeforeUnmount(() => observer.value?.disconnect())
40
+
41
+ return {
42
+ visibleHeadings,
43
+ activeHeadings,
44
+ updateHeadings,
45
+ }
46
+ }
@@ -0,0 +1,12 @@
1
+ import { useRuntimeConfig } from '#imports'
2
+
3
+ export const useTheme = () => {
4
+ const { theme } = useRuntimeConfig()
5
+
6
+ return theme
7
+ }
8
+
9
+ export const classNames = (...args: any[]) => {
10
+ const classes = args.filter(Boolean).join(' ')
11
+ return classes.length ? classes : undefined
12
+ }
@@ -0,0 +1,29 @@
1
+ <script setup>
2
+ import { useContent } from '#imports'
3
+
4
+ const { page, fetchNavigation } = useContent()
5
+
6
+ await fetchNavigation()
7
+ </script>
8
+
9
+ <template>
10
+ <div class="w-full flex min-h-screen flex-col">
11
+ <Navbar />
12
+
13
+ <div class="min-h-[calc(100vh-12rem)] sm:min-h-[calc(100vh-8rem)] flex flex-col">
14
+ <DocsPage>
15
+ <template #aside>
16
+ <DocsAside v-if="page?.value?.aside || typeof page?.value?.aside === 'undefined'" />
17
+ </template>
18
+
19
+ <DocsPageContent>
20
+ <div class="max-w-none">
21
+ <NuxtPage />
22
+ </div>
23
+ </DocsPageContent>
24
+ </DocsPage>
25
+ </div>
26
+
27
+ <Footer />
28
+ </div>
29
+ </template>
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <div class="w-full flex min-h-screen flex-col">
3
+ <Navbar />
4
+
5
+ <div class="min-h-[calc(100vh-12rem)] sm:min-h-[calc(100vh-8rem)] flex flex-col ">
6
+ <NuxtPage />
7
+ </div>
8
+
9
+ <Footer />
10
+ </div>
11
+ </template>
package/nuxt.config.ts ADDED
@@ -0,0 +1,151 @@
1
+ import { fileURLToPath } from 'url'
2
+ import { defineNuxtConfig } from 'nuxt'
3
+ import colors from 'tailwindcss/colors.js'
4
+ import { resolve } from 'pathe'
5
+
6
+ const themeDir = fileURLToPath(new URL('./', import.meta.url))
7
+ const resolveThemeDir = (path: string) => resolve(themeDir, path)
8
+
9
+ export default defineNuxtConfig({
10
+ runtimeConfig: {
11
+ public: {
12
+ plausible: {
13
+ domain: process.env.PLAUSIBLE_DOMAIN,
14
+ },
15
+ theme: {
16
+ title: 'Docus',
17
+ twitter: '@docus_',
18
+ github: 'nuxtlabs/docus',
19
+ header: {
20
+ title: false,
21
+ logo: true,
22
+ },
23
+ footer: {
24
+ credits: {
25
+ icon: 'IconNuxtLabs',
26
+ text: 'Made by Nuxt Labs',
27
+ },
28
+ icons: [
29
+ {
30
+ label: 'NuxtJS',
31
+ href: 'https://nuxtjs.org',
32
+ component: 'IconNuxt',
33
+ },
34
+ {
35
+ label: 'Vue Telescope',
36
+ href: 'https://vuetelescope.com',
37
+ component: 'IconVueTelescope',
38
+ },
39
+ ],
40
+ },
41
+ },
42
+ },
43
+ },
44
+ head: {
45
+ title: 'Docus',
46
+ link: [
47
+ {
48
+ rel: 'stylesheet',
49
+ href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap',
50
+ },
51
+ { rel: 'preconnect', href: 'https://fonts.gstatic.com' },
52
+ ],
53
+ meta: [
54
+ { hid: 'og:site_name', property: 'og:site_name', content: 'Nuxt 3' },
55
+ { hid: 'og:type', property: 'og:type', content: 'website' },
56
+ ],
57
+ },
58
+ loading: {
59
+ color: '#00DC82',
60
+ },
61
+ /**
62
+ * Components
63
+ */
64
+ components: [
65
+ {
66
+ prefix: '',
67
+ path: './components/app',
68
+ global: true,
69
+ },
70
+ {
71
+ prefix: '',
72
+ path: './components/docs',
73
+ global: true,
74
+ },
75
+ {
76
+ prefix: '',
77
+ path: './components/prose',
78
+ global: true,
79
+ },
80
+ {
81
+ prefix: '',
82
+ path: './components/globals',
83
+ global: true,
84
+ },
85
+ {
86
+ prefix: '',
87
+ path: './components/content',
88
+ global: true,
89
+ },
90
+ {
91
+ prefix: '',
92
+ path: './components/icons',
93
+ global: true,
94
+ },
95
+ ],
96
+ css: [
97
+ resolveThemeDir('assets/css/main.css'),
98
+ resolveThemeDir('assets/css/fonts.css'),
99
+ resolveThemeDir('assets/css/tailwind.css'),
100
+ ],
101
+ tailwindcss: {
102
+ viewer: false,
103
+
104
+ config: {
105
+ darkMode: 'class',
106
+ theme: {
107
+ extend: {
108
+ colors: {
109
+ gray: colors.gray,
110
+ primary: colors.indigo,
111
+ },
112
+ fontFamily: {
113
+ sans: 'Inter, sans-serif',
114
+ },
115
+ },
116
+ },
117
+ plugins: [
118
+ require('@tailwindcss/typography'),
119
+ require('@tailwindcss/forms'),
120
+ require('@tailwindcss/line-clamp'),
121
+ require('@tailwindcss/aspect-ratio'),
122
+ ],
123
+ content: [
124
+ resolveThemeDir('components/**/*.{mjs,vue,js,ts}'),
125
+ resolveThemeDir('layouts/**/*.{mjs,vue,js,ts}'),
126
+ resolveThemeDir('pages/**/*.{mjs,vue,js,ts}'),
127
+ ],
128
+ safelist: [24, 36, 48, 60, 72, 84, 96, 108, 120].map(number => `pl-[${number}px]`),
129
+ cssPath: resolveThemeDir('assets/css/tailwind.css'),
130
+ },
131
+ },
132
+ content: {
133
+ highlight: {
134
+ theme: 'one-dark-pro',
135
+ preload: ['json', 'js', 'ts', 'html', 'css', 'vue', 'diff', 'shell', 'markdown', 'yaml', 'bash'],
136
+ },
137
+ },
138
+ colorMode: {
139
+ classSuffix: '',
140
+ },
141
+ /**
142
+ * Modules
143
+ */
144
+ modules: [
145
+ '@nuxt/content',
146
+ '@nuxtjs/tailwindcss',
147
+ '@nuxtjs/color-mode',
148
+ '@nuxthq/admin',
149
+ 'vue-plausible',
150
+ ],
151
+ })
package/package.json CHANGED
@@ -1,91 +1,54 @@
1
1
  {
2
+ "version": "3.0.0-beta.3",
2
3
  "name": "docus",
3
- "version": "2.1.0",
4
- "description": "The Modern Website Generator.",
5
- "keywords": [
6
- "nuxt",
7
- "module",
8
- "nuxt-module",
9
- "docus-core"
10
- ],
11
- "repository": "https://github.com/docusgen/docus",
12
- "license": "MIT",
13
- "exports": {
14
- ".": "./dist/index.mjs"
15
- },
16
- "main": "./dist/index.mjs",
17
- "module": "./dist/index.mjs",
18
- "types": "./types.d.ts",
19
- "files": [
20
- "dist",
21
- "types.d.ts",
22
- "shims.d.ts"
23
- ],
24
4
  "scripts": {
25
- "build": "unbuild",
26
- "dev": "nuxt dev example",
27
- "generate": "nuxt generate example",
28
- "start": "nuxt start example",
29
- "lint": "eslint --ext .js,.ts,.vue .",
30
- "test": "yarn lint && mocha --timeout 10000 --exit -r jiti/register test/**/*.test.ts",
31
- "clean:example": "rm -rf example/.nuxt example/node_modules",
32
- "clean:dist": "rm -rf dist node_modules",
33
- "clean": "yarn clean:example && yarn clean:dist"
5
+ "build": "nuxi build",
6
+ "dev": "nuxi dev",
7
+ "preview": "nuxi preview",
8
+ "lint": "eslint --ext .ts,.js,.vue,.css ."
34
9
  },
35
- "resolutions": {
36
- "mdast-util-from-markdown": "1.0.4"
10
+ "devDependencies": {
11
+ "@antfu/eslint-config": "^0.20.6",
12
+ "@nuxtjs/eslint-config-typescript": "^9.0.0",
13
+ "eslint": "^8.13.0",
14
+ "nuxt": "^3.0.0-rc.1",
15
+ "parse-entities": "^4.0.0",
16
+ "typescript": "^4.6.3"
37
17
  },
38
18
  "dependencies": {
39
- "@docus/cli": "^1.1.0",
40
- "@docus/mdc": "npm:@docus/mdc-edge@latest",
41
- "@nuxt/image": "^0.6.0",
42
- "@nuxt/kit": "npm:@nuxt/kit-edge@latest",
43
- "@nuxtjs/i18n": "^7.2.0",
44
- "chalk": "^4.1.2",
45
- "clear-module": "^4.1.2",
46
- "consola": "^2.15.3",
47
- "core-js": "3",
48
- "debounce": "^1.2.1",
49
- "defu": "^5.0.0",
50
- "glob": "^7.2.0",
51
- "h3": "^0.3.3",
52
- "iso-639-1": "^2.1.10",
53
- "jiti": "^1.12.9",
54
- "micromatch": "^4.0.4",
55
- "murmurhash-es": "^0.1.1",
56
- "node-fetch": "^2.6.6",
57
- "nuxt-component-meta": "^0.0.7",
58
- "pathe": "^0.2.0",
59
- "property-information": "6.1.1",
60
- "scule": "^0.2.1",
61
- "ufo": "^0.7.9",
62
- "unctx": "^1.0.2",
63
- "unstorage": "^0.3.3",
64
- "ws": "^8.3.0"
19
+ "@iconify/vue": "^3.2.1",
20
+ "@nuxt/content": "npm:@nuxt/content-edge@latest",
21
+ "@nuxthq/admin": "npm:@nuxthq/admin-edge@latest",
22
+ "@nuxtjs/color-mode": "^3.0.2",
23
+ "@nuxtjs/tailwindcss": "^5.0.3",
24
+ "@tailwindcss/aspect-ratio": "^0.4.0",
25
+ "@tailwindcss/forms": "^0.5.0",
26
+ "@tailwindcss/line-clamp": "^0.3.1",
27
+ "@tailwindcss/typography": "^0.5.2",
28
+ "@vueuse/core": "^8.3.0",
29
+ "@vueuse/motion": "2.0.0-beta.12",
30
+ "clipboard": "^2.0.10",
31
+ "defu": "^6.0.0",
32
+ "lodash-es": "^4.17.21",
33
+ "tailwindcss": "^3.0.24",
34
+ "vue-plausible": "^1.3.1"
65
35
  },
66
- "devDependencies": {
67
- "@babel/preset-env": "latest",
68
- "@babel/preset-typescript": "latest",
69
- "@nuxt/bridge": "npm:@nuxt/bridge-edge@latest",
70
- "@nuxt/test-utils": "latest",
71
- "@nuxt/types": "^2.15.8",
72
- "@nuxtjs/eslint-config-typescript": "latest",
73
- "@types/chai": "^4.2.22",
74
- "@types/debounce": "^1.2.1",
75
- "@types/glob": "^7.2.0",
76
- "@types/micromatch": "^4.0.2",
77
- "@types/mocha": "^9.0.0",
78
- "@types/node-fetch": "^3.0.3",
79
- "@types/ws": "^8.2.0",
80
- "chai": "^4.3.4",
81
- "eslint": "^8.3.0",
82
- "eslint-config-prettier": "^8.3.0",
83
- "eslint-plugin-nuxt": "^3.0.0",
84
- "eslint-plugin-prettier": "^4.0.0",
85
- "mocha": "^9.1.3",
86
- "nuxt-edge": "^2.16.0-27295215.ab1c6cb4",
87
- "playwright": "^1.16.3",
88
- "prettier": "^2.4.1",
89
- "unbuild": "^0.5.13"
90
- }
36
+ "main": "./nuxt.config.ts",
37
+ "exports": {
38
+ ".": {
39
+ "require": "./nuxt.config.ts",
40
+ "import": "./nuxt.config.ts"
41
+ }
42
+ },
43
+ "files": [
44
+ "README.md",
45
+ "app",
46
+ "assets",
47
+ "components",
48
+ "composables",
49
+ "layouts",
50
+ "pages",
51
+ "public",
52
+ "nuxt.config.ts"
53
+ ]
91
54
  }
@@ -0,0 +1,26 @@
1
+ <script setup lang="ts">
2
+ import { useContent, useRouter } from '#imports'
3
+
4
+ const router = useRouter()
5
+
6
+ const { page, fetchPage } = useContent()
7
+
8
+ await fetchPage()
9
+
10
+ if (page.value && page.value.layout)
11
+ router.currentRoute.value.meta.layout = page.value.layout
12
+ else
13
+ router.currentRoute.value.meta.layout = 'default'
14
+ </script>
15
+
16
+ <template>
17
+ <Content v-if="page" class="content" :document="page" />
18
+ </template>
19
+
20
+ <style scoped>
21
+ .content {
22
+ & > :first-child {
23
+ margin-top: 0 !important;
24
+ }
25
+ }
26
+ </style>
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.