@md-plugins/quasar-app-extension-q-press 0.1.0-alpha.10
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/LICENSE.md +21 -0
- package/README.md +230 -0
- package/old/prompts.js +44 -0
- package/old/uninstall.js +9 -0
- package/package.json +60 -0
- package/scripts/build.js +33 -0
- package/src/index.js +63 -0
- package/src/install.js +49 -0
- package/src/templates/.gitkeep +0 -0
- package/src/templates/init/src/_q-press/.gitkeep +0 -0
- package/src/templates/init/src/_q-press/api/components/DarkModeToggle.json +37 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownApi.json +67 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownApiEntry.json +76 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownCardLink.json +28 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownCardTitle.json +48 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownCode.json +37 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownCodePrism.json +29 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownCodepen.json +21 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownCopyButton.json +36 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownDrawerSidebar.json +17 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownDrawerToc.json +17 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownExample.json +22 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownHeader.json +28 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownHeaderIconLinks.json +16 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownHeaderMenu.json +77 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownHeaderTextLinks.json +33 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownInstallation.json +33 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownLayout.json +52 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownLink.json +23 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownPage.json +71 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownPageFooter.json +21 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownPageSidebar.json +56 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownPageToc.json +17 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownPrerender.json +25 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownTree.json +27 -0
- package/src/templates/init/src/_q-press/api/composables/dark.json +29 -0
- package/src/templates/init/src/_q-press/api/composables/scroll.json +34 -0
- package/src/templates/init/src/_q-press/assets/get-meta.ts +29 -0
- package/src/templates/init/src/_q-press/components/DarkModeToggle.vue +105 -0
- package/src/templates/init/src/_q-press/components/MarkdownApi.vue +588 -0
- package/src/templates/init/src/_q-press/components/MarkdownApiEntry.ts +594 -0
- package/src/templates/init/src/_q-press/components/MarkdownCardLink.vue +25 -0
- package/src/templates/init/src/_q-press/components/MarkdownCardTitle.vue +21 -0
- package/src/templates/init/src/_q-press/components/MarkdownCode.vue +25 -0
- package/src/templates/init/src/_q-press/components/MarkdownCodePrism.ts +36 -0
- package/src/templates/init/src/_q-press/components/MarkdownCodepen.vue +183 -0
- package/src/templates/init/src/_q-press/components/MarkdownCopyButton.vue +104 -0
- package/src/templates/init/src/_q-press/components/MarkdownExample.vue +221 -0
- package/src/templates/init/src/_q-press/components/MarkdownInstallation.vue +166 -0
- package/src/templates/init/src/_q-press/components/MarkdownLink.vue +38 -0
- package/src/templates/init/src/_q-press/components/MarkdownPrerender.ts +82 -0
- package/src/templates/init/src/_q-press/components/MarkdownTree.vue +105 -0
- package/src/templates/init/src/_q-press/components/markdown-utils.ts +105 -0
- package/src/templates/init/src/_q-press/composables/dark.ts +39 -0
- package/src/templates/init/src/_q-press/composables/scroll.ts +115 -0
- package/src/templates/init/src/_q-press/css/app.scss +662 -0
- package/src/templates/init/src/_q-press/css/fonts.scss +100 -0
- package/src/templates/init/src/_q-press/css/prism-theme.scss +298 -0
- package/src/templates/init/src/_q-press/css/themes/default.scss +68 -0
- package/src/templates/init/src/_q-press/css/themes/newspaper.scss +69 -0
- package/src/templates/init/src/_q-press/css/themes/sunrise.scss +67 -0
- package/src/templates/init/src/_q-press/css/themes/tawny.scss +69 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownDrawerSidebar.vue +32 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownDrawerToc.vue +37 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownHeader.vue +412 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownHeaderIconLinks.vue +31 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownHeaderMenu.ts +93 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownHeaderTextLinks.vue +37 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownLayout.vue +239 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownPage.vue +307 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownPageFooter.vue +187 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownPageSidebar.scss +54 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownPageSidebar.ts +218 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownPageToc.vue +23 -0
- package/src/templates/init/src/_q-press/layouts/MarkdownSearch.vue +449 -0
- package/src/templates/init/src/_q-press/stores/markdown.ts +101 -0
- package/src/templates/init/src/components/LandingPage/LandingPage.vue +341 -0
- package/src/templates/init/src/components/Releases/PackageReleases.vue +164 -0
- package/src/templates/init/src/components/Releases/PublicReleases.vue +149 -0
- package/src/templates/init/src/components/Releases/ReleasesAvailable.vue +74 -0
- package/src/templates/init/src/examples/QAvatar/BasicExample.vue +11 -0
- package/src/templates/init/src/markdown/__elements.md +548 -0
- package/src/templates/init/src/markdown/__elements2.md +347 -0
- package/src/templates/init/src/markdown/faq/best-practices.md +0 -0
- package/src/templates/init/src/markdown/faq/general.md +0 -0
- package/src/templates/init/src/markdown/faq/troubleshooting.md +0 -0
- package/src/templates/init/src/markdown/getting-started/introduction.md +67 -0
- package/src/templates/init/src/markdown/guides/contributing.md +101 -0
- package/src/templates/init/src/markdown/guides/faq.md +115 -0
- package/src/templates/init/src/markdown/guides/release-notes.md +0 -0
- package/src/templates/init/src/markdown/guides/style-guide.md +0 -0
- package/src/templates/init/src/markdown/landing-page.md +11 -0
- package/src/templates/init/src/markdown/listing.ts +3 -0
- package/src/templates/init/src/markdown/md-plugins/blockquote/advanced.md +83 -0
- package/src/templates/init/src/markdown/md-plugins/blockquote/overview.md +183 -0
- package/src/templates/init/src/markdown/md-plugins/codeblocks/advanced.md +210 -0
- package/src/templates/init/src/markdown/md-plugins/codeblocks/overview.md +616 -0
- package/src/templates/init/src/markdown/md-plugins/containers/advanced.md +301 -0
- package/src/templates/init/src/markdown/md-plugins/containers/overview.md +206 -0
- package/src/templates/init/src/markdown/md-plugins/frontmatter/advanced.md +164 -0
- package/src/templates/init/src/markdown/md-plugins/frontmatter/overview.md +131 -0
- package/src/templates/init/src/markdown/md-plugins/headers/advanced.md +236 -0
- package/src/templates/init/src/markdown/md-plugins/headers/overview.md +134 -0
- package/src/templates/init/src/markdown/md-plugins/image/advanced.md +114 -0
- package/src/templates/init/src/markdown/md-plugins/image/overview.md +124 -0
- package/src/templates/init/src/markdown/md-plugins/imports/advanced.md +105 -0
- package/src/templates/init/src/markdown/md-plugins/imports/overview.md +80 -0
- package/src/templates/init/src/markdown/md-plugins/inline-code/advanced.md +133 -0
- package/src/templates/init/src/markdown/md-plugins/inline-code/overview.md +101 -0
- package/src/templates/init/src/markdown/md-plugins/link/advanced.md +157 -0
- package/src/templates/init/src/markdown/md-plugins/link/overview.md +126 -0
- package/src/templates/init/src/markdown/md-plugins/shared/overview.md +175 -0
- package/src/templates/init/src/markdown/md-plugins/table/advanced.md +190 -0
- package/src/templates/init/src/markdown/md-plugins/table/overview.md +186 -0
- package/src/templates/init/src/markdown/md-plugins/title/advanced.md +88 -0
- package/src/templates/init/src/markdown/md-plugins/title/overview.md +99 -0
- package/src/templates/init/src/markdown/other/release-notes.md +12 -0
- package/src/templates/init/src/markdown/privacy-policy.md +12 -0
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/advanced.md +101 -0
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/components.md +69 -0
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +254 -0
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/themes.md +4 -0
- package/src/templates/init/src/markdown/quasar-app-extensions/vitemdpluginappext/advanced.md +4 -0
- package/src/templates/init/src/markdown/quasar-app-extensions/vitemdpluginappext/overview.md +103 -0
- package/src/templates/init/src/markdown/vite-plugins/index.md +6 -0
- package/src/templates/init/src/markdown/vite-plugins/viteexamplesplugin/advanced.md +138 -0
- package/src/templates/init/src/markdown/vite-plugins/viteexamplesplugin/overview.md +88 -0
- package/src/templates/init/src/markdown/vite-plugins/vitemdplugin/advanced.md +226 -0
- package/src/templates/init/src/markdown/vite-plugins/vitemdplugin/index.md +6 -0
- package/src/templates/init/src/markdown/vite-plugins/vitemdplugin/overview.md +166 -0
- package/src/templates/init/src/q-press.globals.d.ts +36 -0
- package/src/templates/init/src/siteConfig/index.ts +440 -0
- package/src/templates/update/src/_q-press/.gitkeep +0 -0
- package/src/templates/update/src/_q-press/api/components/DarkModeToggle.json +37 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownApi.json +67 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownApiEntry.json +76 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownCardLink.json +28 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownCardTitle.json +48 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownCode.json +37 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownCodePrism.json +29 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownCodepen.json +21 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownCopyButton.json +36 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownDrawerSidebar.json +17 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownDrawerToc.json +17 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownExample.json +22 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownHeader.json +28 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownHeaderIconLinks.json +16 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownHeaderMenu.json +77 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownHeaderTextLinks.json +33 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownInstallation.json +33 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownLayout.json +52 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownLink.json +23 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownPage.json +71 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownPageFooter.json +21 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownPageSidebar.json +56 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownPageToc.json +17 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownPrerender.json +25 -0
- package/src/templates/update/src/_q-press/api/components/MarkdownTree.json +27 -0
- package/src/templates/update/src/_q-press/api/composables/dark.json +29 -0
- package/src/templates/update/src/_q-press/api/composables/scroll.json +34 -0
- package/src/templates/update/src/_q-press/assets/get-meta.ts +29 -0
- package/src/templates/update/src/_q-press/components/DarkModeToggle.vue +105 -0
- package/src/templates/update/src/_q-press/components/MarkdownApi.vue +588 -0
- package/src/templates/update/src/_q-press/components/MarkdownApiEntry.ts +594 -0
- package/src/templates/update/src/_q-press/components/MarkdownCardLink.vue +25 -0
- package/src/templates/update/src/_q-press/components/MarkdownCardTitle.vue +21 -0
- package/src/templates/update/src/_q-press/components/MarkdownCode.vue +25 -0
- package/src/templates/update/src/_q-press/components/MarkdownCodePrism.ts +36 -0
- package/src/templates/update/src/_q-press/components/MarkdownCodepen.vue +183 -0
- package/src/templates/update/src/_q-press/components/MarkdownCopyButton.vue +104 -0
- package/src/templates/update/src/_q-press/components/MarkdownExample.vue +221 -0
- package/src/templates/update/src/_q-press/components/MarkdownInstallation.vue +166 -0
- package/src/templates/update/src/_q-press/components/MarkdownLink.vue +38 -0
- package/src/templates/update/src/_q-press/components/MarkdownPrerender.ts +82 -0
- package/src/templates/update/src/_q-press/components/MarkdownTree.vue +105 -0
- package/src/templates/update/src/_q-press/components/markdown-utils.ts +105 -0
- package/src/templates/update/src/_q-press/composables/dark.ts +39 -0
- package/src/templates/update/src/_q-press/composables/scroll.ts +115 -0
- package/src/templates/update/src/_q-press/css/app.scss +662 -0
- package/src/templates/update/src/_q-press/css/fonts.scss +100 -0
- package/src/templates/update/src/_q-press/css/prism-theme.scss +298 -0
- package/src/templates/update/src/_q-press/css/themes/default.scss +68 -0
- package/src/templates/update/src/_q-press/css/themes/newspaper.scss +69 -0
- package/src/templates/update/src/_q-press/css/themes/sunrise.scss +67 -0
- package/src/templates/update/src/_q-press/css/themes/tawny.scss +69 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownDrawerSidebar.vue +32 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownDrawerToc.vue +37 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownHeader.vue +412 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownHeaderIconLinks.vue +31 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownHeaderMenu.ts +93 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownHeaderTextLinks.vue +37 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownLayout.vue +239 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownPage.vue +307 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownPageFooter.vue +187 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownPageSidebar.scss +54 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownPageSidebar.ts +218 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownPageToc.vue +23 -0
- package/src/templates/update/src/_q-press/layouts/MarkdownSearch.vue +449 -0
- package/src/templates/update/src/_q-press/stores/markdown.ts +101 -0
- package/src/templates/update/src/q-press.globals.d.ts +36 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="siteConfig.config.useFooter" class="markdown-page-footer markdown-brand">
|
|
3
|
+
<template v-if="props.fullscreen">
|
|
4
|
+
<nav class="markdown-page-footer__nav" v-once>
|
|
5
|
+
<q-list v-for="entry in links" :key="entry.name" role="list">
|
|
6
|
+
<q-item-label
|
|
7
|
+
class="markdown-page-footer__title markdown-page-footer__margin row items-end text-weight-bold letter-spacing-225 q-mb-md"
|
|
8
|
+
>{{ entry.name }}</q-item-label
|
|
9
|
+
>
|
|
10
|
+
|
|
11
|
+
<q-item
|
|
12
|
+
v-for="(item, index) in entry.children"
|
|
13
|
+
:key="index"
|
|
14
|
+
dense
|
|
15
|
+
:flat="item.image"
|
|
16
|
+
clickable
|
|
17
|
+
:to="item.path"
|
|
18
|
+
:href="item.external ? item.path : void 0"
|
|
19
|
+
:target="item.external ? '_blank' : void 0"
|
|
20
|
+
class="markdown-layout__item"
|
|
21
|
+
>
|
|
22
|
+
<q-item-section v-if="item.image" class="letter-spacing-100"
|
|
23
|
+
><q-img :src="item.image" :style="{ maxWidth: item.maxWidth ?? '150px' }"
|
|
24
|
+
/></q-item-section>
|
|
25
|
+
<q-item-section v-else class="letter-spacing-100">{{ item.name }}</q-item-section>
|
|
26
|
+
</q-item>
|
|
27
|
+
</q-list>
|
|
28
|
+
</nav>
|
|
29
|
+
|
|
30
|
+
<q-separator class="landing-mx--large" />
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<div
|
|
34
|
+
v-if="!!siteConfig.license"
|
|
35
|
+
class="markdown-page-footer__license row justify-center q-mt-md letter-spacing-225"
|
|
36
|
+
>
|
|
37
|
+
<q-btn
|
|
38
|
+
v-if="!!siteConfig.license.label && !!siteConfig.license.link"
|
|
39
|
+
no-caps
|
|
40
|
+
flat
|
|
41
|
+
:href="siteConfig.license.link"
|
|
42
|
+
target="_blank"
|
|
43
|
+
class="header-btn text-weight-bold"
|
|
44
|
+
:label="siteConfig.license.label"
|
|
45
|
+
/>
|
|
46
|
+
<template
|
|
47
|
+
v-if="!!siteConfig.privacy && !!siteConfig.privacy.label && !!siteConfig.privacy.link"
|
|
48
|
+
>
|
|
49
|
+
<q-btn
|
|
50
|
+
v-if="isPrivacyLocal"
|
|
51
|
+
no-caps
|
|
52
|
+
flat
|
|
53
|
+
:to="siteConfig.privacy.link"
|
|
54
|
+
class="header-btn text-weight-bold"
|
|
55
|
+
:label="siteConfig.privacy.label"
|
|
56
|
+
/>
|
|
57
|
+
<q-btn
|
|
58
|
+
v-else
|
|
59
|
+
no-caps
|
|
60
|
+
flat
|
|
61
|
+
:href="siteConfig.privacy.link"
|
|
62
|
+
target="_blank"
|
|
63
|
+
class="header-btn text-weight-bold"
|
|
64
|
+
:label="siteConfig.privacy.label"
|
|
65
|
+
/>
|
|
66
|
+
</template>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="markdown-page-footer__copyright text-center q-pa-lg letter-spacing-100">
|
|
70
|
+
<div v-if="siteConfig.copyright.line1">
|
|
71
|
+
{{ siteConfig.copyright.line1 }}
|
|
72
|
+
</div>
|
|
73
|
+
<div v-if="siteConfig.copyright.line2">
|
|
74
|
+
{{ siteConfig.copyright.line2 }}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<script setup lang="ts">
|
|
81
|
+
import { computed } from 'vue'
|
|
82
|
+
import siteConfig from '../../siteConfig'
|
|
83
|
+
import type { SiteMenuItem } from '../../siteConfig'
|
|
84
|
+
|
|
85
|
+
const isPrivacyLocal = computed(() => {
|
|
86
|
+
return siteConfig?.privacy?.link?.startsWith('/') || siteConfig?.privacy?.link?.startsWith('.')
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Loop through the menus and extract all menu items therein, including children to a flat array of menu items
|
|
91
|
+
* @param menus menu items to extract from
|
|
92
|
+
* @return {*[]} An array of flattened menu items (no more children, they move up to the same level as others)
|
|
93
|
+
*/
|
|
94
|
+
function getMenu(path: string): SiteMenuItem[] {
|
|
95
|
+
const children: SiteMenuItem[] = []
|
|
96
|
+
const menuItem: SiteMenuItem | undefined = siteConfig.sidebar.find(
|
|
97
|
+
(item) => item.path === path,
|
|
98
|
+
) as SiteMenuItem
|
|
99
|
+
|
|
100
|
+
if (menuItem !== void 0 && menuItem.children) {
|
|
101
|
+
for (const item of menuItem.children) {
|
|
102
|
+
if (item.children === void 0) {
|
|
103
|
+
children.push({
|
|
104
|
+
name: item.name,
|
|
105
|
+
path: item.external === true ? item.path : `/${path}/${item.path}`,
|
|
106
|
+
external: item.external,
|
|
107
|
+
image: item.image ?? void 0,
|
|
108
|
+
} as SiteMenuItem)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return children
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const links = siteConfig.links.footerLinks.flatMap((nav) => ({
|
|
117
|
+
name: nav.name,
|
|
118
|
+
children: [...(nav.children || []), ...((nav.extract !== void 0 && getMenu(nav.extract)) || [])],
|
|
119
|
+
}))
|
|
120
|
+
|
|
121
|
+
const props = defineProps({
|
|
122
|
+
fullscreen: Boolean,
|
|
123
|
+
})
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<style lang="scss">
|
|
127
|
+
.markdown-page-footer {
|
|
128
|
+
position: relative;
|
|
129
|
+
background-color: $brand-light;
|
|
130
|
+
width: 100%;
|
|
131
|
+
z-index: 1;
|
|
132
|
+
border-top: 1px solid $separator-color;
|
|
133
|
+
|
|
134
|
+
&__margin {
|
|
135
|
+
margin-left: 6px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.markdown-layout__item,
|
|
139
|
+
&__title {
|
|
140
|
+
font-size: ($font-size - 2px);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&__nav {
|
|
144
|
+
display: grid;
|
|
145
|
+
grid-row-gap: 64px;
|
|
146
|
+
grid-column-gap: 32px;
|
|
147
|
+
padding: 64px 32px;
|
|
148
|
+
grid-template-columns: 1fr;
|
|
149
|
+
|
|
150
|
+
@media (min-width: 720px) {
|
|
151
|
+
padding-left: 64px;
|
|
152
|
+
padding-right: 64px;
|
|
153
|
+
grid-template-columns: repeat(2, 1fr);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@media (min-width: 830px) {
|
|
157
|
+
grid-column-gap: 64px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media (min-width: 1070px) {
|
|
161
|
+
padding-top: 100px;
|
|
162
|
+
padding-bottom: 100px;
|
|
163
|
+
grid-row-gap: 64px;
|
|
164
|
+
grid-template-columns: repeat(3, 1fr);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@media (min-width: 1417px) {
|
|
168
|
+
grid-template-columns: repeat(4, 1fr);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@media (min-width: 2060px) {
|
|
172
|
+
grid-template-columns: repeat(5, 1fr);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&__copyright {
|
|
177
|
+
font-size: ($font-size - 2px);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
body.body--dark {
|
|
182
|
+
.markdown-page-footer {
|
|
183
|
+
background-color: $dark-bg;
|
|
184
|
+
border-top-color: $separator-dark-color;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
</style>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.markdown-page-menu {
|
|
2
|
+
font-size: ($font-size - 2px);
|
|
3
|
+
|
|
4
|
+
.q-icon {
|
|
5
|
+
font-size: 24px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.q-item__section--avatar {
|
|
9
|
+
color: $brand-primary;
|
|
10
|
+
min-width: 28px;
|
|
11
|
+
padding-right: 12px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.q-expansion-item__content {
|
|
15
|
+
margin-left: 18px;
|
|
16
|
+
padding-left: 4px;
|
|
17
|
+
border-left: 1px solid $separator-color;
|
|
18
|
+
|
|
19
|
+
.q-expansion-item__content {
|
|
20
|
+
margin-left: 26px;
|
|
21
|
+
padding-left: 2px !important;
|
|
22
|
+
|
|
23
|
+
.q-item {
|
|
24
|
+
padding-left: 16px !important;
|
|
25
|
+
margin-left: 2px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.q-expansion-item__toggle-icon {
|
|
31
|
+
color: $grey-5;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.q-expansion-item--expanded > div > .q-item {
|
|
35
|
+
> .q-item__section--main {
|
|
36
|
+
color: $brand-primary;
|
|
37
|
+
}
|
|
38
|
+
> .q-item__section--side .q-expansion-item__toggle-icon {
|
|
39
|
+
color: $brand-primary;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__deep-expansion > .q-expansion-item__container > .q-item {
|
|
44
|
+
.q-item__section--avatar {
|
|
45
|
+
min-width: 16px;
|
|
46
|
+
padding-left: 8px;
|
|
47
|
+
padding-right: 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
body.body--dark .markdown-page-menu .q-expansion-item__content {
|
|
53
|
+
border-left-color: $separator-dark-color;
|
|
54
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { QExpansionItem, QList, QItem, QItemSection, QIcon, QBadge, Ripple } from 'quasar'
|
|
2
|
+
|
|
3
|
+
import { mdiMenuDown } from '@quasar/extras/mdi-v7'
|
|
4
|
+
import { h, ref, watch, onBeforeUpdate, withDirectives, type VNode } from 'vue'
|
|
5
|
+
import { useRoute } from 'vue-router'
|
|
6
|
+
|
|
7
|
+
import siteConfig from '../../siteConfig'
|
|
8
|
+
|
|
9
|
+
import './MarkdownPageSidebar.scss'
|
|
10
|
+
|
|
11
|
+
interface ComponentProxy {
|
|
12
|
+
$parent?: ComponentProxy
|
|
13
|
+
$: {
|
|
14
|
+
parent?: {
|
|
15
|
+
proxy?: ComponentProxy
|
|
16
|
+
parent?: ComponentProxy
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
show?: () => void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function getParentProxy(proxy: ComponentProxy): ComponentProxy | undefined {
|
|
23
|
+
if (Object(proxy.$parent) === proxy.$parent) {
|
|
24
|
+
return proxy.$parent
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let parent = proxy.$?.parent
|
|
28
|
+
|
|
29
|
+
if (parent) {
|
|
30
|
+
while (Object(parent) === parent) {
|
|
31
|
+
if (Object(parent.proxy) === parent.proxy) {
|
|
32
|
+
return parent.proxy
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
parent = parent.parent as { proxy?: ComponentProxy; parent?: ComponentProxy } | undefined
|
|
36
|
+
if (!parent) {
|
|
37
|
+
break
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return undefined
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
setup() {
|
|
47
|
+
const $route = useRoute()
|
|
48
|
+
const routePath = $route.path
|
|
49
|
+
|
|
50
|
+
const rootRef = ref(null)
|
|
51
|
+
|
|
52
|
+
watch(
|
|
53
|
+
() => $route.path,
|
|
54
|
+
(val: string) => {
|
|
55
|
+
showMenu(childRefs[val] as ComponentProxy | null)
|
|
56
|
+
},
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
let childRefs: { [key: string]: ComponentProxy } = {}
|
|
60
|
+
|
|
61
|
+
onBeforeUpdate(() => {
|
|
62
|
+
childRefs = {}
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
function showMenu(proxy: ComponentProxy | null): void {
|
|
66
|
+
if (proxy !== undefined && proxy !== rootRef.value) {
|
|
67
|
+
if (proxy.show !== undefined) proxy.show()
|
|
68
|
+
const parent = getParentProxy(proxy)
|
|
69
|
+
if (parent !== undefined) {
|
|
70
|
+
showMenu(parent)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function getDrawerMenu(menu: MenuItem, path: string, level: number): VNode {
|
|
76
|
+
if (menu.children !== void 0) {
|
|
77
|
+
return h(
|
|
78
|
+
QExpansionItem,
|
|
79
|
+
{
|
|
80
|
+
class:
|
|
81
|
+
'markdown-layout__item non-selectable' +
|
|
82
|
+
(level !== 0 ? ' markdown-page-menu__deep-expansion' : ''),
|
|
83
|
+
ref: (vm: any) => {
|
|
84
|
+
if (vm) {
|
|
85
|
+
childRefs[path] = vm
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
key: `${menu.name}-${path}`,
|
|
89
|
+
label: menu.name,
|
|
90
|
+
icon: menu.icon,
|
|
91
|
+
expandIcon: mdiMenuDown,
|
|
92
|
+
defaultOpened: menu.expanded || routePath.startsWith(path),
|
|
93
|
+
switchToggleSide: level !== 0,
|
|
94
|
+
denseToggle: level !== 0,
|
|
95
|
+
activeClass: 'markdown-layout__item--active',
|
|
96
|
+
},
|
|
97
|
+
() =>
|
|
98
|
+
menu.children?.map(
|
|
99
|
+
(item: MenuItem) =>
|
|
100
|
+
item.name &&
|
|
101
|
+
getDrawerMenu(
|
|
102
|
+
item,
|
|
103
|
+
path + (item.path !== void 0 ? '/' + item.path : ''),
|
|
104
|
+
level / 2 + 0.1,
|
|
105
|
+
),
|
|
106
|
+
),
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const props: any = {
|
|
111
|
+
ref: (vm: any) => {
|
|
112
|
+
if (vm) {
|
|
113
|
+
childRefs[path] = vm
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
key: path,
|
|
117
|
+
class: 'markdown-layout__item non-selectable',
|
|
118
|
+
to: path,
|
|
119
|
+
activeClass: 'markdown-layout__item--active',
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (level !== 0) {
|
|
123
|
+
props.insetLevel = Math.min(level, 1)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (menu.external === true) {
|
|
127
|
+
Object.assign(props, {
|
|
128
|
+
to: void 0,
|
|
129
|
+
clickable: true,
|
|
130
|
+
tag: 'a',
|
|
131
|
+
href: menu.path,
|
|
132
|
+
target: '_blank',
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const child: any[] = []
|
|
137
|
+
|
|
138
|
+
if (menu.icon !== void 0) {
|
|
139
|
+
child.push(
|
|
140
|
+
h(
|
|
141
|
+
QItemSection,
|
|
142
|
+
{
|
|
143
|
+
avatar: true,
|
|
144
|
+
},
|
|
145
|
+
() => h(QIcon, { name: menu.icon, color: menu.iconColor ? menu.iconColor : undefined }),
|
|
146
|
+
),
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
child.push(h(QItemSection, () => menu.name))
|
|
151
|
+
|
|
152
|
+
if (menu.rightIcon !== void 0) {
|
|
153
|
+
child.push(
|
|
154
|
+
h(
|
|
155
|
+
QItemSection,
|
|
156
|
+
{
|
|
157
|
+
avatar: true,
|
|
158
|
+
},
|
|
159
|
+
() =>
|
|
160
|
+
h(QIcon, {
|
|
161
|
+
name: menu.rightIcon,
|
|
162
|
+
color: menu.rightIconColor ? menu.rightIconColor : undefined,
|
|
163
|
+
}),
|
|
164
|
+
),
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (menu.badge !== void 0) {
|
|
169
|
+
child.push(
|
|
170
|
+
h(
|
|
171
|
+
QItemSection,
|
|
172
|
+
{
|
|
173
|
+
side: true,
|
|
174
|
+
},
|
|
175
|
+
() => h(QBadge, { label: menu.badge, class: 'header-badge' }),
|
|
176
|
+
),
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return withDirectives(
|
|
181
|
+
h(QItem, props, () => child),
|
|
182
|
+
[[Ripple]],
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function showDrawerVersion(): VNode | undefined {
|
|
187
|
+
if (
|
|
188
|
+
siteConfig.versionConfig.showOnSidebar === true &&
|
|
189
|
+
(siteConfig.versionConfig.showVersion === true ||
|
|
190
|
+
siteConfig.versionConfig.showTitle === true)
|
|
191
|
+
) {
|
|
192
|
+
return h(QItem, { class: 'markdown-layout__item non-selectable' }, () => [
|
|
193
|
+
siteConfig.versionConfig.showTitle &&
|
|
194
|
+
h(QItemSection, { class: 'text-right' }, () => siteConfig.title),
|
|
195
|
+
siteConfig.versionConfig.showVersion &&
|
|
196
|
+
h(QItemSection, { class: 'text-left' }, () => 'v' + siteConfig.version),
|
|
197
|
+
])
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function showDrawerMenu(): VNode {
|
|
202
|
+
return h(QList, { ref: rootRef, class: 'markdown-page-menu', dense: true }, () => [
|
|
203
|
+
siteConfig.sidebar.map((item) => getDrawerMenu(item, '/' + item.path, 0)),
|
|
204
|
+
])
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return () => {
|
|
208
|
+
if (
|
|
209
|
+
siteConfig.config.useSidebar === true &&
|
|
210
|
+
siteConfig.sidebar &&
|
|
211
|
+
Array.isArray(siteConfig.sidebar) &&
|
|
212
|
+
siteConfig.sidebar.length > 0
|
|
213
|
+
) {
|
|
214
|
+
return h('div', { class: 'markdown-layout' }, [showDrawerVersion(), showDrawerMenu()])
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-list class="markdown-page__toc">
|
|
3
|
+
<q-item
|
|
4
|
+
v-for="tocItem in markdownStore.toc"
|
|
5
|
+
:key="tocItem.id"
|
|
6
|
+
:id="`toc--${tocItem.id}`"
|
|
7
|
+
clickable
|
|
8
|
+
class="markdown-layout__item"
|
|
9
|
+
active-class="markdown-layout__item--active"
|
|
10
|
+
v-ripple
|
|
11
|
+
:active="markdownStore.activeToc === tocItem.id"
|
|
12
|
+
@click="tocItem.onClick"
|
|
13
|
+
>
|
|
14
|
+
<q-item-section v-if="tocItem.sub === true" side />
|
|
15
|
+
<q-item-section>{{ tocItem.title }}</q-item-section>
|
|
16
|
+
</q-item>
|
|
17
|
+
</q-list>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import { useMarkdownStore } from '../stores/markdown'
|
|
22
|
+
const markdownStore = useMarkdownStore()
|
|
23
|
+
</script>
|