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.
- package/README.md +6 -4
- package/app/router.options.ts +18 -0
- package/assets/css/fonts.css +84 -0
- package/assets/css/main.css +11 -0
- package/assets/css/tailwind.css +282 -0
- package/components/app/Container.vue +25 -0
- package/components/app/Footer.vue +40 -0
- package/components/app/Navbar.vue +26 -0
- package/components/app/NavbarLogo.vue +33 -0
- package/components/app/Page.vue +7 -0
- package/components/app/PoweredByDocus.vue +11 -0
- package/components/content/Alert.vue +124 -0
- package/components/content/BlockHero.vue +54 -0
- package/components/content/ButtonLink.vue +45 -0
- package/components/content/Card.vue +46 -0
- package/components/content/CardGrid.vue +23 -0
- package/components/content/CodeBlock.vue +47 -0
- package/components/content/CodeGroup.vue +135 -0
- package/components/content/CopyButton.vue +49 -0
- package/{dist/runtime/app/components/prose/ProseOl.vue → components/content/List.vue} +2 -2
- package/components/content/NeedContribution.vue +23 -0
- package/components/content/ReadMore.vue +25 -0
- package/components/content/Sandbox.vue +102 -0
- package/components/content/TabsHeader.vue +44 -0
- package/components/content/Terminal.vue +64 -0
- package/components/content/VideoPlayer.vue +115 -0
- package/components/docs/DocsAside.vue +21 -0
- package/components/docs/DocsAsideTree.vue +102 -0
- package/components/docs/DocsHero.vue +39 -0
- package/components/docs/DocsPage.vue +22 -0
- package/components/docs/DocsPageContent.vue +31 -0
- package/components/docs/DocsToc.vue +74 -0
- package/components/globals/Icon.vue +24 -0
- package/{dist/runtime/app/components/prose/ProseHr.vue → components/globals/Logo.vue} +1 -1
- package/components/globals/NuxtImg.vue +45 -0
- package/components/globals/SocialIcons.vue +45 -0
- package/components/globals/ThemeSelect.vue +35 -0
- package/components/icons/IconAlgolia.vue +8 -0
- package/components/icons/IconArrowLeft.vue +10 -0
- package/components/icons/IconArrowRight.vue +10 -0
- package/components/icons/IconBadgeCheck.vue +14 -0
- package/components/icons/IconCheck.vue +10 -0
- package/components/icons/IconCheckCircle.vue +10 -0
- package/components/icons/IconChevronRight.vue +12 -0
- package/components/icons/IconClipboardCheck.vue +14 -0
- package/components/icons/IconClipboardCopy.vue +14 -0
- package/components/icons/IconCodeSandbox.vue +8 -0
- package/components/icons/IconCopy.vue +17 -0
- package/components/icons/IconDots.vue +10 -0
- package/components/icons/IconEdit.vue +18 -0
- package/components/icons/IconExclamationCircle.vue +12 -0
- package/components/icons/IconExclamationTriangle.vue +10 -0
- package/components/icons/IconExternalLink.vue +12 -0
- package/components/icons/IconGit.vue +7 -0
- package/components/icons/IconGitHub.vue +10 -0
- package/components/icons/IconHeart.vue +9 -0
- package/components/icons/IconInformationCircle.vue +10 -0
- package/components/icons/IconLighthouse.vue +83 -0
- package/components/icons/IconLine.vue +10 -0
- package/components/icons/IconMarkdown.vue +13 -0
- package/components/icons/IconMenu.vue +12 -0
- package/components/icons/IconMenuAlt.vue +10 -0
- package/components/icons/IconMinus.vue +10 -0
- package/components/icons/IconMoon.vue +10 -0
- package/components/icons/IconNuxt.vue +14 -0
- package/components/icons/IconNuxtContent.vue +20 -0
- package/components/icons/IconNuxtLabs.vue +21 -0
- package/components/icons/IconPlus.vue +10 -0
- package/components/icons/IconPuzzle.vue +8 -0
- package/components/icons/IconSSG.vue +7 -0
- package/components/icons/IconSearch.vue +12 -0
- package/components/icons/IconSun.vue +10 -0
- package/components/icons/IconTocBack.vue +21 -0
- package/components/icons/IconTocCurrent.vue +21 -0
- package/components/icons/IconTocNext.vue +8 -0
- package/components/icons/IconTranslate.vue +14 -0
- package/components/icons/IconTwitter.vue +8 -0
- package/components/icons/IconVite.vue +30 -0
- package/components/icons/IconVue.vue +6 -0
- package/components/icons/IconVueTelescope.vue +11 -0
- package/components/icons/IconWindi.vue +17 -0
- package/components/icons/IconX.vue +12 -0
- package/components/icons/IconXCircle.vue +10 -0
- package/components/icons/IconZap.vue +8 -0
- package/components/prose/ProseA.vue +66 -0
- package/components/prose/ProseBlockquote.vue +21 -0
- package/components/prose/ProseCode.vue +68 -0
- package/components/prose/ProseCodeInline.vue +38 -0
- package/components/prose/ProseEm.vue +11 -0
- package/components/prose/ProseH1.vue +22 -0
- package/components/prose/ProseH2.vue +22 -0
- package/components/prose/ProseH3.vue +24 -0
- package/components/prose/ProseH4.vue +24 -0
- package/components/prose/ProseHr.vue +13 -0
- package/components/prose/ProseImg.vue +30 -0
- package/components/prose/ProseLi.vue +31 -0
- package/components/prose/ProseOl.vue +16 -0
- package/components/prose/ProseP.vue +14 -0
- package/components/prose/ProseStrong.vue +14 -0
- package/components/prose/ProseTable.vue +13 -0
- package/{dist/runtime/app/components → components}/prose/ProseTbody.vue +0 -0
- package/components/prose/ProseTd.vue +11 -0
- package/components/prose/ProseTh.vue +11 -0
- package/components/prose/ProseThead.vue +11 -0
- package/components/prose/ProseTr.vue +11 -0
- package/components/prose/ProseUl.vue +15 -0
- package/composables/useContent.ts +156 -0
- package/composables/useMenu.ts +22 -0
- package/composables/useScrollToHeading.ts +35 -0
- package/composables/useScrollspy.ts +46 -0
- package/composables/useTheme.ts +12 -0
- package/layouts/default.vue +29 -0
- package/layouts/page.vue +11 -0
- package/nuxt.config.ts +151 -0
- package/package.json +46 -83
- package/pages/[...slug].vue +26 -0
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/site.webmanifest +1 -0
- package/LICENSE +0 -21
- package/dist/index.cjs +0 -549
- package/dist/index.d.ts +0 -25
- package/dist/index.mjs +0 -523
- package/dist/runtime/app/components/DocusContent.vue +0 -215
- package/dist/runtime/app/components/DocusContent.vue.d.ts +0 -25
- package/dist/runtime/app/components/Error.vue +0 -19
- package/dist/runtime/app/components/Error.vue.d.ts +0 -9
- package/dist/runtime/app/components/Markdown.vue +0 -56
- package/dist/runtime/app/components/Markdown.vue.d.ts +0 -25
- package/dist/runtime/app/components/Page.vue +0 -29
- package/dist/runtime/app/components/Page.vue.d.ts +0 -2
- package/dist/runtime/app/components/Props.vue +0 -130
- package/dist/runtime/app/components/Props.vue.d.ts +0 -80
- package/dist/runtime/app/components/prose/ProseA.vue +0 -41
- package/dist/runtime/app/components/prose/ProseA.vue.d.ts +0 -23
- package/dist/runtime/app/components/prose/ProseBlockquote.vue +0 -5
- package/dist/runtime/app/components/prose/ProseCode.vue +0 -5
- package/dist/runtime/app/components/prose/ProseCodeInline.vue +0 -5
- package/dist/runtime/app/components/prose/ProseEm.vue +0 -5
- package/dist/runtime/app/components/prose/ProseH1.vue +0 -3
- package/dist/runtime/app/components/prose/ProseH2.vue +0 -3
- package/dist/runtime/app/components/prose/ProseH3.vue +0 -3
- package/dist/runtime/app/components/prose/ProseH4.vue +0 -3
- package/dist/runtime/app/components/prose/ProseH5.vue +0 -3
- package/dist/runtime/app/components/prose/ProseH6.vue +0 -3
- package/dist/runtime/app/components/prose/ProseImg.vue +0 -32
- package/dist/runtime/app/components/prose/ProseImg.vue.d.ts +0 -21
- package/dist/runtime/app/components/prose/ProseLi.vue +0 -3
- package/dist/runtime/app/components/prose/ProseParagraph.vue +0 -3
- package/dist/runtime/app/components/prose/ProseStrong.vue +0 -5
- package/dist/runtime/app/components/prose/ProseTable.vue +0 -5
- package/dist/runtime/app/components/prose/ProseTd.vue +0 -5
- package/dist/runtime/app/components/prose/ProseTh.vue +0 -5
- package/dist/runtime/app/components/prose/ProseThead.vue +0 -5
- package/dist/runtime/app/components/prose/ProseTr.vue +0 -5
- package/dist/runtime/app/components/prose/ProseUl.vue +0 -5
- package/dist/runtime/app/composables/helpers.d.ts +0 -4
- package/dist/runtime/app/composables/helpers.js +0 -66
- package/dist/runtime/app/composables/helpers.mjs +0 -40
- package/dist/runtime/app/composables/index.d.ts +0 -90
- package/dist/runtime/app/composables/index.js +0 -108
- package/dist/runtime/app/composables/index.mjs +0 -63
- package/dist/runtime/app/composables/navigation.d.ts +0 -37
- package/dist/runtime/app/composables/navigation.js +0 -227
- package/dist/runtime/app/composables/navigation.mjs +0 -148
- package/dist/runtime/app/composables/store.d.ts +0 -7
- package/dist/runtime/app/composables/store.js +0 -52
- package/dist/runtime/app/composables/store.mjs +0 -35
- package/dist/runtime/app/composables/style.d.ts +0 -11
- package/dist/runtime/app/composables/style.js +0 -117
- package/dist/runtime/app/composables/style.mjs +0 -71
- package/dist/runtime/app/composables/theme-colors.d.ts +0 -30
- package/dist/runtime/app/composables/theme-colors.js +0 -80
- package/dist/runtime/app/composables/theme-colors.mjs +0 -48
- package/dist/runtime/app/composables/websocket.d.ts +0 -3
- package/dist/runtime/app/composables/websocket.js +0 -79
- package/dist/runtime/app/composables/websocket.mjs +0 -63
- package/dist/runtime/app/layouts/default.vue +0 -5
- package/dist/runtime/app/layouts/error.vue +0 -33
- package/dist/runtime/app/layouts/error.vue.d.ts +0 -21
- package/dist/runtime/app/pages/_.vue +0 -222
- package/dist/runtime/app/pages/_.vue.d.ts +0 -2
- package/dist/runtime/context.d.ts +0 -1
- package/dist/runtime/context.js +0 -17
- package/dist/runtime/context.mjs +0 -5
- package/dist/runtime/database/Query.d.ts +0 -18
- package/dist/runtime/database/Query.js +0 -68
- package/dist/runtime/database/Query.mjs +0 -49
- package/dist/runtime/database/index.d.ts +0 -4
- package/dist/runtime/database/index.js +0 -45
- package/dist/runtime/database/index.mjs +0 -25
- package/dist/runtime/database/providers/local/Query.d.ts +0 -14
- package/dist/runtime/database/providers/local/Query.js +0 -85
- package/dist/runtime/database/providers/local/Query.mjs +0 -60
- package/dist/runtime/database/providers/local/index.d.ts +0 -3
- package/dist/runtime/database/providers/local/index.js +0 -63
- package/dist/runtime/database/providers/local/index.mjs +0 -39
- package/dist/runtime/database/providers/local/operations.d.ts +0 -2
- package/dist/runtime/database/providers/local/operations.js +0 -83
- package/dist/runtime/database/providers/local/operations.mjs +0 -53
- package/dist/runtime/database/providers/local/utils.d.ts +0 -8
- package/dist/runtime/database/providers/local/utils.js +0 -28
- package/dist/runtime/database/providers/local/utils.mjs +0 -17
- package/dist/runtime/index.d.ts +0 -3
- package/dist/runtime/index.js +0 -44
- package/dist/runtime/index.mjs +0 -3
- package/dist/runtime/navigation.d.ts +0 -4
- package/dist/runtime/navigation.js +0 -176
- package/dist/runtime/navigation.mjs +0 -137
- package/dist/runtime/server/api/get.d.ts +0 -10
- package/dist/runtime/server/api/get.js +0 -24
- package/dist/runtime/server/api/get.mjs +0 -13
- package/dist/runtime/server/api/list.d.ts +0 -9
- package/dist/runtime/server/api/list.js +0 -34
- package/dist/runtime/server/api/list.mjs +0 -18
- package/dist/runtime/server/api/navigation.d.ts +0 -7
- package/dist/runtime/server/api/navigation.js +0 -20
- package/dist/runtime/server/api/navigation.mjs +0 -10
- package/dist/runtime/server/api/preview.d.ts +0 -3
- package/dist/runtime/server/api/preview.js +0 -54
- package/dist/runtime/server/api/preview.mjs +0 -31
- package/dist/runtime/server/api/reload.d.ts +0 -6
- package/dist/runtime/server/api/reload.js +0 -27
- package/dist/runtime/server/api/reload.mjs +0 -11
- package/dist/runtime/server/api/search.d.ts +0 -6
- package/dist/runtime/server/api/search.js +0 -27
- package/dist/runtime/server/api/search.mjs +0 -13
- package/dist/runtime/server/content.d.ts +0 -46
- package/dist/runtime/server/content.js +0 -175
- package/dist/runtime/server/content.mjs +0 -114
- package/dist/runtime/server/socket.d.ts +0 -9
- package/dist/runtime/server/socket.js +0 -33
- package/dist/runtime/server/socket.mjs +0 -20
- package/dist/runtime/server/utils/cache.d.ts +0 -19
- package/dist/runtime/server/utils/cache.js +0 -110
- package/dist/runtime/server/utils/cache.mjs +0 -75
- package/dist/runtime/server/utils/index.d.ts +0 -4
- package/dist/runtime/server/utils/index.js +0 -18
- package/dist/runtime/server/utils/index.mjs +0 -8
- package/dist/runtime/transformers/index.d.ts +0 -1
- package/dist/runtime/transformers/index.js +0 -26
- package/dist/runtime/transformers/index.mjs +0 -11
- package/dist/runtime/transformers/json.d.ts +0 -3
- package/dist/runtime/transformers/json.js +0 -15
- package/dist/runtime/transformers/json.mjs +0 -5
- package/dist/runtime/transformers/markdown/index.d.ts +0 -8
- package/dist/runtime/transformers/markdown/index.js +0 -25
- package/dist/runtime/transformers/markdown/index.mjs +0 -16
- package/dist/runtime/transformers/utils/index.d.ts +0 -1
- package/dist/runtime/transformers/utils/index.js +0 -18
- package/dist/runtime/transformers/utils/index.mjs +0 -1
- package/dist/runtime/transformers/utils/path.d.ts +0 -26
- package/dist/runtime/transformers/utils/path.js +0 -88
- package/dist/runtime/transformers/utils/path.mjs +0 -56
- package/dist/runtime/utils/index.d.ts +0 -1
- package/dist/runtime/utils/index.js +0 -18
- package/dist/runtime/utils/index.mjs +0 -1
- package/dist/runtime/utils/log.d.ts +0 -1
- package/dist/runtime/utils/log.js +0 -14
- package/dist/runtime/utils/log.mjs +0 -2
- package/dist/runtime/utils/object.d.ts +0 -9
- package/dist/runtime/utils/object.js +0 -22
- package/dist/runtime/utils/object.mjs +0 -4
- package/dist/templates/content.mjs +0 -50
- package/dist/templates/docus.mjs +0 -13
- package/dist/templates/hot.mjs +0 -16
- package/dist/templates/i18n.mjs +0 -23
- package/dist/templates/options.mjs +0 -46
- package/shims.d.ts +0 -24
- 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>
|
package/layouts/page.vue
ADDED
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": "
|
|
26
|
-
"dev": "
|
|
27
|
-
"
|
|
28
|
-
"
|
|
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
|
-
"
|
|
36
|
-
"
|
|
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
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@nuxtjs/
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
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
|
-
"
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
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
|
|
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.
|