@md-plugins/quasar-app-extension-q-press 0.1.0-beta.2 → 0.1.0-beta.21
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 +20 -15
- package/dist/index.js +41 -7
- package/dist/install.js +7 -5
- package/dist/q-press-globals.d.ts +49 -0
- package/dist/templates/init/src/_q-press/api/components/MarkdownCode.json +2 -2
- package/dist/templates/init/src/_q-press/api/components/MarkdownCodepen.json +6 -9
- package/dist/templates/init/src/_q-press/api/components/MarkdownExample.json +27 -2
- package/dist/templates/init/src/_q-press/components/MarkdownApi.vue +129 -84
- package/dist/templates/init/src/_q-press/components/MarkdownCardLink.vue +1 -1
- package/dist/templates/init/src/_q-press/components/MarkdownCardTitle.vue +1 -1
- package/dist/templates/init/src/_q-press/components/MarkdownCode.vue +71 -3
- package/dist/templates/init/src/_q-press/components/MarkdownCodepen.vue +316 -59
- package/dist/templates/init/src/_q-press/components/MarkdownCopyButton.vue +1 -1
- package/dist/templates/init/src/_q-press/components/MarkdownExample.vue +54 -19
- package/dist/templates/init/src/_q-press/components/MarkdownLink.vue +5 -5
- package/dist/templates/init/src/_q-press/components/MarkdownMermaid.vue +123 -0
- package/dist/templates/init/src/_q-press/components/MarkdownTree.vue +2 -2
- package/dist/templates/init/src/_q-press/components/markdown-utils.ts +27 -3
- package/dist/templates/init/src/_q-press/css/app.scss +38 -26
- package/dist/templates/init/src/_q-press/css/code-theme.scss +634 -0
- package/dist/templates/init/src/_q-press/css/themes/default.scss +1 -1
- package/dist/templates/init/src/_q-press/css/themes/evergreen.scss +69 -0
- package/dist/templates/init/src/_q-press/css/themes/mystic.scss +1 -1
- package/dist/templates/init/src/_q-press/css/themes/newspaper.scss +1 -1
- package/dist/templates/init/src/_q-press/css/themes/sunrise.scss +1 -1
- package/dist/templates/init/src/_q-press/css/themes/tawny.scss +1 -1
- package/dist/templates/init/src/_q-press/layouts/MarkdownDrawerSidebar.vue +1 -1
- package/dist/templates/init/src/_q-press/layouts/MarkdownDrawerToc.vue +1 -1
- package/dist/templates/init/src/_q-press/layouts/MarkdownHeader.vue +1 -1
- package/dist/templates/init/src/_q-press/layouts/MarkdownLayout.vue +2 -2
- package/dist/templates/init/src/_q-press/layouts/MarkdownPage.vue +4 -3
- package/dist/templates/init/src/_q-press/layouts/MarkdownSearch.vue +1 -1
- package/dist/templates/init/src/_q-press/stores/markdown.ts +1 -2
- package/dist/templates/init/src/components/LandingPage/LandingPage.vue +15 -1
- package/dist/templates/init/src/components/QPressThemeGallery.vue +336 -0
- package/dist/templates/init/src/components/page-parts/releases/GitHubReleases.vue +121 -0
- package/dist/templates/init/src/components/page-parts/releases/PackageReleases.vue +191 -0
- package/dist/templates/init/src/components/page-parts/releases/md-table-parser.ts +52 -0
- package/dist/templates/init/src/components/page-parts/releases/sanitize.ts +132 -0
- package/dist/templates/init/src/markdown/__elements.md +8 -8
- package/dist/templates/init/src/markdown/__elements2.md +4 -4
- package/dist/templates/init/src/markdown/faq/best-practices.md +27 -0
- package/dist/templates/init/src/markdown/faq/general.md +27 -0
- package/dist/templates/init/src/markdown/faq/troubleshooting.md +27 -0
- package/dist/templates/init/src/markdown/getting-started/introduction.md +7 -5
- package/dist/templates/init/src/markdown/md-plugins/blockquote/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/codeblocks/advanced.md +19 -15
- package/dist/templates/init/src/markdown/md-plugins/codeblocks/overview.md +45 -8
- package/dist/templates/init/src/markdown/md-plugins/containers/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/frontmatter/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/headers/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/image/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/imports/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/inline-code/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/link/advanced.md +2 -2
- package/dist/templates/init/src/markdown/md-plugins/link/overview.md +6 -4
- package/dist/templates/init/src/markdown/md-plugins/mermaid/advanced.md +69 -0
- package/dist/templates/init/src/markdown/md-plugins/mermaid/overview.md +73 -0
- package/dist/templates/init/src/markdown/md-plugins/shared/overview.md +28 -13
- package/dist/templates/init/src/markdown/md-plugins/table/overview.md +3 -1
- package/dist/templates/init/src/markdown/md-plugins/title/overview.md +3 -1
- package/dist/templates/init/src/markdown/other/contact.md +37 -0
- package/dist/templates/init/src/markdown/other/contributing/bugs-and-feature-requests.md +33 -0
- package/dist/templates/init/src/markdown/other/contributing/call-to-action.md +25 -0
- package/dist/templates/init/src/markdown/other/contributing/documentation.md +31 -0
- package/dist/templates/init/src/markdown/other/contributing/overview.md +41 -0
- package/dist/templates/init/src/markdown/other/contributing/packages.md +28 -0
- package/dist/templates/init/src/markdown/other/contributing/sponsor.md +23 -0
- package/dist/templates/init/src/markdown/other/faq.md +179 -0
- package/dist/templates/init/src/markdown/other/releases.md +11 -0
- package/dist/templates/init/src/markdown/other/upgrade-guide.md +165 -0
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/advanced.md +11 -3
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/components.md +25 -29
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +20 -20
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/site-config.md +17 -3
- package/dist/templates/init/src/markdown/quasar-app-extensions/qpress/themes.md +101 -9
- package/dist/templates/init/src/markdown/quasar-app-extensions/vite-md-plugin-app-ext/advanced.md +158 -0
- package/dist/templates/init/src/markdown/quasar-app-extensions/vite-md-plugin-app-ext/overview.md +1 -1
- package/dist/templates/init/src/markdown/vite-plugins/vite-examples-plugin/advanced.md +8 -3
- package/dist/templates/init/src/markdown/vite-plugins/vite-examples-plugin/overview.md +19 -5
- package/dist/templates/init/src/markdown/vite-plugins/vite-md-plugin/advanced.md +84 -54
- package/dist/templates/init/src/markdown/vite-plugins/vite-md-plugin/overview.md +19 -3
- package/dist/templates/init/src/siteConfig/index.ts +52 -23
- package/dist/templates/update/src/_q-press/api/components/MarkdownCode.json +2 -2
- package/dist/templates/update/src/_q-press/api/components/MarkdownCodepen.json +6 -9
- package/dist/templates/update/src/_q-press/api/components/MarkdownExample.json +27 -2
- package/dist/templates/update/src/_q-press/components/MarkdownApi.vue +129 -84
- package/dist/templates/update/src/_q-press/components/MarkdownCardLink.vue +1 -1
- package/dist/templates/update/src/_q-press/components/MarkdownCardTitle.vue +1 -1
- package/dist/templates/update/src/_q-press/components/MarkdownCode.vue +71 -3
- package/dist/templates/update/src/_q-press/components/MarkdownCodepen.vue +316 -59
- package/dist/templates/update/src/_q-press/components/MarkdownCopyButton.vue +1 -1
- package/dist/templates/update/src/_q-press/components/MarkdownExample.vue +54 -19
- package/dist/templates/update/src/_q-press/components/MarkdownLink.vue +5 -5
- package/dist/templates/update/src/_q-press/components/MarkdownMermaid.vue +123 -0
- package/dist/templates/update/src/_q-press/components/MarkdownTree.vue +2 -2
- package/dist/templates/update/src/_q-press/components/markdown-utils.ts +27 -3
- package/dist/templates/update/src/_q-press/css/app.scss +38 -26
- package/dist/templates/update/src/_q-press/css/code-theme.scss +634 -0
- package/dist/templates/update/src/_q-press/css/themes/default.scss +1 -1
- package/dist/templates/update/src/_q-press/css/themes/evergreen.scss +69 -0
- package/dist/templates/update/src/_q-press/css/themes/mystic.scss +1 -1
- package/dist/templates/update/src/_q-press/css/themes/newspaper.scss +1 -1
- package/dist/templates/update/src/_q-press/css/themes/sunrise.scss +1 -1
- package/dist/templates/update/src/_q-press/css/themes/tawny.scss +1 -1
- package/dist/templates/update/src/_q-press/layouts/MarkdownDrawerSidebar.vue +1 -1
- package/dist/templates/update/src/_q-press/layouts/MarkdownDrawerToc.vue +1 -1
- package/dist/templates/update/src/_q-press/layouts/MarkdownHeader.vue +1 -1
- package/dist/templates/update/src/_q-press/layouts/MarkdownLayout.vue +2 -2
- package/dist/templates/update/src/_q-press/layouts/MarkdownPage.vue +4 -3
- package/dist/templates/update/src/_q-press/layouts/MarkdownSearch.vue +1 -1
- package/dist/templates/update/src/_q-press/stores/markdown.ts +1 -2
- package/package.json +22 -21
- package/src/index.ts +80 -11
- package/src/install.ts +10 -9
- package/src/q-press-globals.d.ts +49 -0
- package/src/templates/init/src/_q-press/api/components/MarkdownCode.json +2 -2
- package/src/templates/init/src/_q-press/api/components/MarkdownCodepen.json +6 -9
- package/src/templates/init/src/_q-press/api/components/MarkdownExample.json +27 -2
- package/src/templates/init/src/_q-press/components/MarkdownApi.vue +129 -84
- package/src/templates/init/src/_q-press/components/MarkdownCardLink.vue +1 -1
- package/src/templates/init/src/_q-press/components/MarkdownCardTitle.vue +1 -1
- package/src/templates/init/src/_q-press/components/MarkdownCode.vue +71 -3
- package/src/templates/init/src/_q-press/components/MarkdownCodepen.vue +316 -59
- package/src/templates/init/src/_q-press/components/MarkdownCopyButton.vue +1 -1
- package/src/templates/init/src/_q-press/components/MarkdownExample.vue +54 -19
- package/src/templates/init/src/_q-press/components/MarkdownLink.vue +5 -5
- package/src/templates/init/src/_q-press/components/MarkdownMermaid.vue +123 -0
- package/src/templates/init/src/_q-press/components/MarkdownTree.vue +2 -2
- package/src/templates/init/src/_q-press/components/markdown-utils.ts +27 -3
- package/src/templates/init/src/_q-press/css/app.scss +38 -26
- package/src/templates/init/src/_q-press/css/code-theme.scss +634 -0
- package/src/templates/init/src/_q-press/css/themes/default.scss +1 -1
- package/src/templates/init/src/_q-press/css/themes/evergreen.scss +69 -0
- package/src/templates/init/src/_q-press/css/themes/mystic.scss +1 -1
- package/src/templates/init/src/_q-press/css/themes/newspaper.scss +1 -1
- package/src/templates/init/src/_q-press/css/themes/sunrise.scss +1 -1
- package/src/templates/init/src/_q-press/css/themes/tawny.scss +1 -1
- package/src/templates/init/src/_q-press/layouts/MarkdownDrawerSidebar.vue +1 -1
- package/src/templates/init/src/_q-press/layouts/MarkdownDrawerToc.vue +1 -1
- package/src/templates/init/src/_q-press/layouts/MarkdownHeader.vue +1 -1
- package/src/templates/init/src/_q-press/layouts/MarkdownLayout.vue +2 -2
- package/src/templates/init/src/_q-press/layouts/MarkdownPage.vue +4 -3
- package/src/templates/init/src/_q-press/layouts/MarkdownSearch.vue +1 -1
- package/src/templates/init/src/_q-press/stores/markdown.ts +1 -2
- package/src/templates/init/src/components/LandingPage/LandingPage.vue +15 -1
- package/src/templates/init/src/components/QPressThemeGallery.vue +336 -0
- package/src/templates/init/src/components/page-parts/releases/GitHubReleases.vue +121 -0
- package/src/templates/init/src/components/page-parts/releases/PackageReleases.vue +191 -0
- package/src/templates/init/src/components/page-parts/releases/md-table-parser.ts +52 -0
- package/src/templates/init/src/components/page-parts/releases/sanitize.ts +132 -0
- package/src/templates/init/src/markdown/__elements.md +8 -8
- package/src/templates/init/src/markdown/__elements2.md +4 -4
- package/src/templates/init/src/markdown/faq/best-practices.md +27 -0
- package/src/templates/init/src/markdown/faq/general.md +27 -0
- package/src/templates/init/src/markdown/faq/troubleshooting.md +27 -0
- package/src/templates/init/src/markdown/getting-started/introduction.md +7 -5
- package/src/templates/init/src/markdown/md-plugins/blockquote/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/codeblocks/advanced.md +19 -15
- package/src/templates/init/src/markdown/md-plugins/codeblocks/overview.md +45 -8
- package/src/templates/init/src/markdown/md-plugins/containers/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/frontmatter/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/headers/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/image/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/imports/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/inline-code/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/link/advanced.md +2 -2
- package/src/templates/init/src/markdown/md-plugins/link/overview.md +6 -4
- package/src/templates/init/src/markdown/md-plugins/mermaid/advanced.md +69 -0
- package/src/templates/init/src/markdown/md-plugins/mermaid/overview.md +73 -0
- package/src/templates/init/src/markdown/md-plugins/shared/overview.md +28 -13
- package/src/templates/init/src/markdown/md-plugins/table/overview.md +3 -1
- package/src/templates/init/src/markdown/md-plugins/title/overview.md +3 -1
- package/src/templates/init/src/markdown/other/contact.md +37 -0
- package/src/templates/init/src/markdown/other/contributing/bugs-and-feature-requests.md +33 -0
- package/src/templates/init/src/markdown/other/contributing/call-to-action.md +25 -0
- package/src/templates/init/src/markdown/other/contributing/documentation.md +31 -0
- package/src/templates/init/src/markdown/other/contributing/overview.md +41 -0
- package/src/templates/init/src/markdown/other/contributing/packages.md +28 -0
- package/src/templates/init/src/markdown/other/contributing/sponsor.md +23 -0
- package/src/templates/init/src/markdown/other/faq.md +179 -0
- package/src/templates/init/src/markdown/other/releases.md +11 -0
- package/src/templates/init/src/markdown/other/upgrade-guide.md +165 -0
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/advanced.md +11 -3
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/components.md +25 -29
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +20 -20
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/site-config.md +17 -3
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/themes.md +101 -9
- package/src/templates/init/src/markdown/quasar-app-extensions/vite-md-plugin-app-ext/advanced.md +158 -0
- package/src/templates/init/src/markdown/quasar-app-extensions/vite-md-plugin-app-ext/overview.md +1 -1
- package/src/templates/init/src/markdown/vite-plugins/vite-examples-plugin/advanced.md +8 -3
- package/src/templates/init/src/markdown/vite-plugins/vite-examples-plugin/overview.md +19 -5
- package/src/templates/init/src/markdown/vite-plugins/vite-md-plugin/advanced.md +84 -54
- package/src/templates/init/src/markdown/vite-plugins/vite-md-plugin/overview.md +19 -3
- package/src/templates/init/src/siteConfig/index.ts +52 -23
- package/src/templates/update/src/_q-press/api/components/MarkdownCode.json +2 -2
- package/src/templates/update/src/_q-press/api/components/MarkdownCodepen.json +6 -9
- package/src/templates/update/src/_q-press/api/components/MarkdownExample.json +27 -2
- package/src/templates/update/src/_q-press/components/MarkdownApi.vue +129 -84
- package/src/templates/update/src/_q-press/components/MarkdownCardLink.vue +1 -1
- package/src/templates/update/src/_q-press/components/MarkdownCardTitle.vue +1 -1
- package/src/templates/update/src/_q-press/components/MarkdownCode.vue +71 -3
- package/src/templates/update/src/_q-press/components/MarkdownCodepen.vue +316 -59
- package/src/templates/update/src/_q-press/components/MarkdownCopyButton.vue +1 -1
- package/src/templates/update/src/_q-press/components/MarkdownExample.vue +54 -19
- package/src/templates/update/src/_q-press/components/MarkdownLink.vue +5 -5
- package/src/templates/update/src/_q-press/components/MarkdownMermaid.vue +123 -0
- package/src/templates/update/src/_q-press/components/MarkdownTree.vue +2 -2
- package/src/templates/update/src/_q-press/components/markdown-utils.ts +27 -3
- package/src/templates/update/src/_q-press/css/app.scss +38 -26
- package/src/templates/update/src/_q-press/css/code-theme.scss +634 -0
- package/src/templates/update/src/_q-press/css/themes/default.scss +1 -1
- package/src/templates/update/src/_q-press/css/themes/evergreen.scss +69 -0
- package/src/templates/update/src/_q-press/css/themes/mystic.scss +1 -1
- package/src/templates/update/src/_q-press/css/themes/newspaper.scss +1 -1
- package/src/templates/update/src/_q-press/css/themes/sunrise.scss +1 -1
- package/src/templates/update/src/_q-press/css/themes/tawny.scss +1 -1
- package/src/templates/update/src/_q-press/layouts/MarkdownDrawerSidebar.vue +1 -1
- package/src/templates/update/src/_q-press/layouts/MarkdownDrawerToc.vue +1 -1
- package/src/templates/update/src/_q-press/layouts/MarkdownHeader.vue +1 -1
- package/src/templates/update/src/_q-press/layouts/MarkdownLayout.vue +2 -2
- package/src/templates/update/src/_q-press/layouts/MarkdownPage.vue +4 -3
- package/src/templates/update/src/_q-press/layouts/MarkdownSearch.vue +1 -1
- package/src/templates/update/src/_q-press/stores/markdown.ts +1 -2
- package/tsconfig.json +1 -1
- package/dist/templates/init/src/_q-press/api/components/MarkdownCodePrism.json +0 -29
- package/dist/templates/init/src/_q-press/components/MarkdownCodePrism.ts +0 -36
- package/dist/templates/init/src/_q-press/css/prism-theme.scss +0 -298
- package/dist/templates/init/src/markdown/guides/contributing.md +0 -101
- package/dist/templates/init/src/markdown/guides/faq.md +0 -115
- package/dist/templates/init/src/markdown/guides/release-notes.md +0 -0
- package/dist/templates/init/src/markdown/guides/style-guide.md +0 -0
- package/dist/templates/init/src/markdown/guides/upgrade-guide.md +0 -92
- package/dist/templates/init/src/markdown/other/release-notes.md +0 -8
- package/dist/templates/init/src/q-press.globals.d.ts +0 -36
- package/dist/templates/update/src/_q-press/api/components/MarkdownCodePrism.json +0 -29
- package/dist/templates/update/src/_q-press/components/MarkdownCodePrism.ts +0 -36
- package/dist/templates/update/src/_q-press/css/prism-theme.scss +0 -298
- package/dist/templates/update/src/q-press.globals.d.ts +0 -36
- package/src/templates/init/src/_q-press/api/components/MarkdownCodePrism.json +0 -29
- package/src/templates/init/src/_q-press/components/MarkdownCodePrism.ts +0 -36
- package/src/templates/init/src/_q-press/css/prism-theme.scss +0 -298
- package/src/templates/init/src/markdown/guides/contributing.md +0 -101
- package/src/templates/init/src/markdown/guides/faq.md +0 -115
- 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/guides/upgrade-guide.md +0 -92
- package/src/templates/init/src/markdown/other/release-notes.md +0 -8
- package/src/templates/init/src/q-press.globals.d.ts +0 -36
- package/src/templates/update/src/_q-press/api/components/MarkdownCodePrism.json +0 -29
- package/src/templates/update/src/_q-press/components/MarkdownCodePrism.ts +0 -36
- package/src/templates/update/src/_q-press/css/prism-theme.scss +0 -298
- package/src/templates/update/src/q-press.globals.d.ts +0 -36
|
@@ -34,7 +34,7 @@ $light-pill: $brand-light;
|
|
|
34
34
|
$light-text: $brand-light-text;
|
|
35
35
|
$light-bg: $brand-light-bg;
|
|
36
36
|
|
|
37
|
-
$dark-pill: scale
|
|
37
|
+
$dark-pill: color.scale($brand-dark-bg, $lightness: 12%);
|
|
38
38
|
$dark-text: $brand-dark-text;
|
|
39
39
|
$dark-bg: $brand-dark-bg;
|
|
40
40
|
|
|
@@ -34,7 +34,7 @@ $light-pill: $brand-light;
|
|
|
34
34
|
$light-text: $brand-light-text;
|
|
35
35
|
$light-bg: $brand-light-bg;
|
|
36
36
|
|
|
37
|
-
$dark-pill: scale
|
|
37
|
+
$dark-pill: color.scale($brand-dark-bg, $lightness: 12%);
|
|
38
38
|
$dark-text: $brand-dark-text;
|
|
39
39
|
$dark-bg: $brand-dark-bg;
|
|
40
40
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<script setup lang="ts">
|
|
26
26
|
import { mdiClose } from '@quasar/extras/mdi-v7'
|
|
27
27
|
|
|
28
|
-
import { useMarkdownStore } from '
|
|
28
|
+
import { useMarkdownStore } from '@/.q-press/stores/markdown'
|
|
29
29
|
import MarkdownPageSidebar from './MarkdownPageSidebar'
|
|
30
30
|
|
|
31
31
|
const markdownStore = useMarkdownStore()
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<script setup lang="ts">
|
|
30
30
|
import { mdiClose } from '@quasar/extras/mdi-v7'
|
|
31
31
|
|
|
32
|
-
import { useMarkdownStore } from '
|
|
32
|
+
import { useMarkdownStore } from '@/.q-press/stores/markdown'
|
|
33
33
|
|
|
34
34
|
import MarkdownPageToc from './MarkdownPageToc.vue'
|
|
35
35
|
|
|
@@ -38,7 +38,7 @@ import { computed } from 'vue'
|
|
|
38
38
|
import { useRoute } from 'vue-router'
|
|
39
39
|
import { mdiArrowUp } from '@quasar/extras/mdi-v7'
|
|
40
40
|
|
|
41
|
-
// import { useMarkdownStore } from '
|
|
41
|
+
// import { useMarkdownStore } from '@/.q-press/stores/doc'
|
|
42
42
|
import { useScroll } from '../composables/scroll'
|
|
43
43
|
|
|
44
44
|
import MarkdownHeader from './MarkdownHeader.vue'
|
|
@@ -101,7 +101,7 @@ const pageContentClass = computed(
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
@media (max-width: 1845px) {
|
|
104
|
-
justify-content: start;
|
|
104
|
+
justify-content: flex-start;
|
|
105
105
|
|
|
106
106
|
.markdown-page__toc-container--flowing {
|
|
107
107
|
display: none;
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|
<slot />
|
|
51
51
|
|
|
52
|
-
<div v-if="
|
|
52
|
+
<div v-if="showFooterNav" class="markdown-page__nav markdown-page__nav--footer">
|
|
53
53
|
<div class="text-h6 q-pb-md markdown-heading">Ready for more?</div>
|
|
54
54
|
<div class="q-gutter-sm flex">
|
|
55
55
|
<router-link
|
|
@@ -94,7 +94,6 @@ import { useRoute } from 'vue-router'
|
|
|
94
94
|
import { mdiPencil, mdiFlash, mdiLaunch } from '@quasar/extras/mdi-v7'
|
|
95
95
|
|
|
96
96
|
import type { NavItem, RelatedItem } from '@md-plugins/vite-md-plugin'
|
|
97
|
-
import type { TocItem } from '@md-plugins/md-plugin-headers'
|
|
98
97
|
import MarkdownLink from '../components/MarkdownLink.vue'
|
|
99
98
|
import MarkdownPageToc from './MarkdownPageToc.vue'
|
|
100
99
|
|
|
@@ -129,7 +128,7 @@ const props = defineProps({
|
|
|
129
128
|
},
|
|
130
129
|
|
|
131
130
|
toc: {
|
|
132
|
-
type: Array<
|
|
131
|
+
type: Array<TocMenuItem>,
|
|
133
132
|
default: () => [],
|
|
134
133
|
},
|
|
135
134
|
related: {
|
|
@@ -164,6 +163,8 @@ const editHref = computed(() => `${siteConfig.githubEditRootSrc}/markdown/${prop
|
|
|
164
163
|
|
|
165
164
|
const isFullscreen = computed(() => route.meta.fullscreen === true || props.fullscreen)
|
|
166
165
|
|
|
166
|
+
const showFooterNav = computed(() => isFullscreen.value !== true && props.nav.length > 0)
|
|
167
|
+
|
|
167
168
|
const hasToc = computed(
|
|
168
169
|
() =>
|
|
169
170
|
route.meta.fullwidth !== true &&
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineStore, acceptHMRUpdate } from 'pinia'
|
|
2
2
|
import { useRoute } from 'vue-router'
|
|
3
3
|
import { useScroll } from '../composables/scroll'
|
|
4
|
-
import type { TocItem } from '@md-plugins/md-plugin-headers'
|
|
5
4
|
|
|
6
5
|
export const useMarkdownStore = defineStore('markdown-store', {
|
|
7
6
|
state: () => ({
|
|
@@ -60,7 +59,7 @@ export const useMarkdownStore = defineStore('markdown-store', {
|
|
|
60
59
|
}
|
|
61
60
|
},
|
|
62
61
|
|
|
63
|
-
setToc(toc:
|
|
62
|
+
setToc(toc: TocMenuItem[]) {
|
|
64
63
|
const { scrollTo } = useScroll()
|
|
65
64
|
this.toc =
|
|
66
65
|
toc !== void 0
|
|
@@ -25,6 +25,16 @@
|
|
|
25
25
|
Get Started
|
|
26
26
|
</span>
|
|
27
27
|
</router-link>
|
|
28
|
+
<router-link
|
|
29
|
+
to="/other/upgrade-guide"
|
|
30
|
+
class="hero-button q-btn q-btn-item non-selectable no-outline q-btn--standard q-btn--rectangle q-btn--actionable q-focusable q-hoverable q-btn--no-uppercase q-btn--rounded q-btn--dense"
|
|
31
|
+
>
|
|
32
|
+
<span
|
|
33
|
+
class="q-btn__content text-center col items-center q-anchor--skip justify-center row"
|
|
34
|
+
>
|
|
35
|
+
Upgrade Guide
|
|
36
|
+
</span>
|
|
37
|
+
</router-link>
|
|
28
38
|
<a
|
|
29
39
|
href="https://github.com/md-plugins/md-plugins"
|
|
30
40
|
target="_blank"
|
|
@@ -44,6 +54,10 @@
|
|
|
44
54
|
Markdown Plugins go beyond the standard Markdown syntax.<br />Discover the power of Markdown
|
|
45
55
|
Plugins and enhance your documentation experience!
|
|
46
56
|
</p>
|
|
57
|
+
<p>
|
|
58
|
+
Use the Markdown-it and Vite plugins in Vue/Vite projects, or choose the Quasar app
|
|
59
|
+
extensions when you want Q-Press and Quasar CLI Vite integration.
|
|
60
|
+
</p>
|
|
47
61
|
</div>
|
|
48
62
|
<div class="row justify-center hero">
|
|
49
63
|
<div class="hero-title">Markdown-It! Plugins</div>
|
|
@@ -113,7 +127,7 @@
|
|
|
113
127
|
|
|
114
128
|
<script setup lang="ts">
|
|
115
129
|
import { QIcon } from 'quasar'
|
|
116
|
-
import { fabGithub } from '@quasar/extras/fontawesome-
|
|
130
|
+
import { fabGithub } from '@quasar/extras/fontawesome-v7'
|
|
117
131
|
import { useRouter } from 'vue-router'
|
|
118
132
|
import siteConfig from '../../siteConfig'
|
|
119
133
|
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="qpress-theme-gallery">
|
|
3
|
+
<article
|
|
4
|
+
v-for="theme in themes"
|
|
5
|
+
:key="theme.name"
|
|
6
|
+
class="qpress-theme-preview"
|
|
7
|
+
:style="getThemeStyle(theme)"
|
|
8
|
+
>
|
|
9
|
+
<div class="qpress-theme-preview__heading">
|
|
10
|
+
<span class="qpress-theme-preview__eyebrow">{{ theme.name }}</span>
|
|
11
|
+
<strong>{{ theme.tagline }}</strong>
|
|
12
|
+
<p>{{ theme.description }}</p>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="qpress-theme-preview__pair">
|
|
16
|
+
<section class="qpress-theme-preview__panel qpress-theme-preview__panel--light">
|
|
17
|
+
<span class="qpress-theme-preview__surface">Light</span>
|
|
18
|
+
<div class="qpress-theme-preview__swatches" aria-label="Light theme color swatches">
|
|
19
|
+
<span class="qpress-theme-preview__swatch qpress-theme-preview__swatch--primary"></span>
|
|
20
|
+
<span
|
|
21
|
+
class="qpress-theme-preview__swatch qpress-theme-preview__swatch--secondary"
|
|
22
|
+
></span>
|
|
23
|
+
<span class="qpress-theme-preview__swatch qpress-theme-preview__swatch--accent"></span>
|
|
24
|
+
</div>
|
|
25
|
+
<p>Light surface, body text, and inline token treatment.</p>
|
|
26
|
+
<code class="qpress-theme-preview__code qpress-theme-preview__code--light"
|
|
27
|
+
>markdown-token</code
|
|
28
|
+
>
|
|
29
|
+
</section>
|
|
30
|
+
|
|
31
|
+
<section class="qpress-theme-preview__panel qpress-theme-preview__panel--dark">
|
|
32
|
+
<span class="qpress-theme-preview__surface">Dark</span>
|
|
33
|
+
<div class="qpress-theme-preview__swatches" aria-label="Dark theme color swatches">
|
|
34
|
+
<span class="qpress-theme-preview__swatch qpress-theme-preview__swatch--primary"></span>
|
|
35
|
+
<span
|
|
36
|
+
class="qpress-theme-preview__swatch qpress-theme-preview__swatch--secondary"
|
|
37
|
+
></span>
|
|
38
|
+
<span class="qpress-theme-preview__swatch qpress-theme-preview__swatch--accent"></span>
|
|
39
|
+
</div>
|
|
40
|
+
<p>Dark surface, body text, and inline token treatment.</p>
|
|
41
|
+
<code class="qpress-theme-preview__code qpress-theme-preview__code--dark"
|
|
42
|
+
>markdown-token</code
|
|
43
|
+
>
|
|
44
|
+
</section>
|
|
45
|
+
</div>
|
|
46
|
+
</article>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script setup lang="ts">
|
|
51
|
+
type ThemePalette = {
|
|
52
|
+
primary: string
|
|
53
|
+
secondary: string
|
|
54
|
+
accent: string
|
|
55
|
+
lightBg: string
|
|
56
|
+
lightText: string
|
|
57
|
+
lightCodeBg: string
|
|
58
|
+
lightCodeText: string
|
|
59
|
+
darkBg: string
|
|
60
|
+
darkText: string
|
|
61
|
+
darkCodeBg: string
|
|
62
|
+
darkCodeText: string
|
|
63
|
+
shadow: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type ThemePreview = {
|
|
67
|
+
name: string
|
|
68
|
+
tagline: string
|
|
69
|
+
description: string
|
|
70
|
+
palette: ThemePalette
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const themes: ThemePreview[] = [
|
|
74
|
+
{
|
|
75
|
+
name: 'Default',
|
|
76
|
+
tagline: 'Clean technical docs',
|
|
77
|
+
description: 'A crisp blue and orange palette with neutral surfaces.',
|
|
78
|
+
palette: {
|
|
79
|
+
primary: '#00bfff',
|
|
80
|
+
secondary: '#4b555c',
|
|
81
|
+
accent: '#ea5e13',
|
|
82
|
+
lightBg: '#fefefe',
|
|
83
|
+
lightText: '#4d4d4d',
|
|
84
|
+
lightCodeBg: '#f5f5f5',
|
|
85
|
+
lightCodeText: '#4d4d4d',
|
|
86
|
+
darkBg: '#080e1a',
|
|
87
|
+
darkText: '#cbcbcb',
|
|
88
|
+
darkCodeBg: '#121212',
|
|
89
|
+
darkCodeText: '#e6e6e6',
|
|
90
|
+
shadow: 'rgba(0, 191, 255, 0.22)',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'Mystic',
|
|
95
|
+
tagline: 'Vivid reference sites',
|
|
96
|
+
description: 'A purple, cyan, and ember palette with a more expressive voice.',
|
|
97
|
+
palette: {
|
|
98
|
+
primary: '#8a2be2',
|
|
99
|
+
secondary: '#00ced1',
|
|
100
|
+
accent: '#ff4500',
|
|
101
|
+
lightBg: '#e6e6fa',
|
|
102
|
+
lightText: '#4b0082',
|
|
103
|
+
lightCodeBg: '#f8f8ff',
|
|
104
|
+
lightCodeText: '#9370db',
|
|
105
|
+
darkBg: '#171122',
|
|
106
|
+
darkText: '#e6e6fa',
|
|
107
|
+
darkCodeBg: '#4b0082',
|
|
108
|
+
darkCodeText: '#e6e6fa',
|
|
109
|
+
shadow: 'rgba(138, 43, 226, 0.32)',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'Newspaper',
|
|
114
|
+
tagline: 'Editorial documentation',
|
|
115
|
+
description: 'A restrained black, white, and slate palette for classic docs.',
|
|
116
|
+
palette: {
|
|
117
|
+
primary: '#8793fc',
|
|
118
|
+
secondary: '#333333',
|
|
119
|
+
accent: '#666666',
|
|
120
|
+
lightBg: '#f5f5f5',
|
|
121
|
+
lightText: '#333333',
|
|
122
|
+
lightCodeBg: '#f5f5f5',
|
|
123
|
+
lightCodeText: '#333333',
|
|
124
|
+
darkBg: '#000000',
|
|
125
|
+
darkText: '#ffffff',
|
|
126
|
+
darkCodeBg: '#1a1a1a',
|
|
127
|
+
darkCodeText: '#e6e6e6',
|
|
128
|
+
shadow: 'rgba(0, 0, 0, 0.24)',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'Sunrise',
|
|
133
|
+
tagline: 'Warm product guides',
|
|
134
|
+
description: 'A red, blue, and amber palette with bright approachable contrast.',
|
|
135
|
+
palette: {
|
|
136
|
+
primary: '#e74c3c',
|
|
137
|
+
secondary: '#5186bb',
|
|
138
|
+
accent: '#f39c12',
|
|
139
|
+
lightBg: '#ecf0f1',
|
|
140
|
+
lightText: '#2c3e50',
|
|
141
|
+
lightCodeBg: '#ecf0f1',
|
|
142
|
+
lightCodeText: '#2c3e50',
|
|
143
|
+
darkBg: '#34495e',
|
|
144
|
+
darkText: '#ecf0f1',
|
|
145
|
+
darkCodeBg: '#2c3e50',
|
|
146
|
+
darkCodeText: '#ecf0f1',
|
|
147
|
+
shadow: 'rgba(231, 76, 60, 0.26)',
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'Tawny',
|
|
152
|
+
tagline: 'Earthy knowledge bases',
|
|
153
|
+
description: 'A grounded brown and sand palette for warm, calm documentation.',
|
|
154
|
+
palette: {
|
|
155
|
+
primary: '#8b4513',
|
|
156
|
+
secondary: '#a0522d',
|
|
157
|
+
accent: '#d2691e',
|
|
158
|
+
lightBg: '#f5f5dc',
|
|
159
|
+
lightText: '#5c4033',
|
|
160
|
+
lightCodeBg: '#fdfdfd',
|
|
161
|
+
lightCodeText: '#5c4033',
|
|
162
|
+
darkBg: '#3e2723',
|
|
163
|
+
darkText: '#f5f5dc',
|
|
164
|
+
darkCodeBg: '#5c4033',
|
|
165
|
+
darkCodeText: '#f5f5dc',
|
|
166
|
+
shadow: 'rgba(139, 69, 19, 0.3)',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'Evergreen',
|
|
171
|
+
tagline: 'Durable field manuals',
|
|
172
|
+
description: 'A spruce, moss, and amber palette for calm long-lived docs.',
|
|
173
|
+
palette: {
|
|
174
|
+
primary: '#14b8a6',
|
|
175
|
+
secondary: '#3f8f68',
|
|
176
|
+
accent: '#f59e0b',
|
|
177
|
+
lightBg: '#f3faf6',
|
|
178
|
+
lightText: '#173b2f',
|
|
179
|
+
lightCodeBg: '#e6f6ee',
|
|
180
|
+
lightCodeText: '#0f5132',
|
|
181
|
+
darkBg: '#071914',
|
|
182
|
+
darkText: '#d7f3e6',
|
|
183
|
+
darkCodeBg: '#0e2a22',
|
|
184
|
+
darkCodeText: '#b8f5d4',
|
|
185
|
+
shadow: 'rgba(20, 184, 166, 0.28)',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
]
|
|
189
|
+
|
|
190
|
+
function getThemeStyle(theme: ThemePreview): Record<string, string> {
|
|
191
|
+
return {
|
|
192
|
+
'--qpress-theme-primary': theme.palette.primary,
|
|
193
|
+
'--qpress-theme-secondary': theme.palette.secondary,
|
|
194
|
+
'--qpress-theme-accent': theme.palette.accent,
|
|
195
|
+
'--qpress-theme-light-bg': theme.palette.lightBg,
|
|
196
|
+
'--qpress-theme-light-text': theme.palette.lightText,
|
|
197
|
+
'--qpress-theme-light-code-bg': theme.palette.lightCodeBg,
|
|
198
|
+
'--qpress-theme-light-code-text': theme.palette.lightCodeText,
|
|
199
|
+
'--qpress-theme-dark-bg': theme.palette.darkBg,
|
|
200
|
+
'--qpress-theme-dark-text': theme.palette.darkText,
|
|
201
|
+
'--qpress-theme-dark-code-bg': theme.palette.darkCodeBg,
|
|
202
|
+
'--qpress-theme-dark-code-text': theme.palette.darkCodeText,
|
|
203
|
+
'--qpress-theme-shadow': theme.palette.shadow,
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
</script>
|
|
207
|
+
|
|
208
|
+
<style scoped lang="scss">
|
|
209
|
+
.qpress-theme-gallery {
|
|
210
|
+
display: grid;
|
|
211
|
+
grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
|
|
212
|
+
gap: 18px;
|
|
213
|
+
margin: 24px 0 32px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.qpress-theme-preview {
|
|
217
|
+
overflow: hidden;
|
|
218
|
+
border: 1px solid var(--qpress-theme-accent);
|
|
219
|
+
border-radius: 16px;
|
|
220
|
+
background: var(--qpress-theme-light-bg);
|
|
221
|
+
box-shadow: 0 18px 36px -28px var(--qpress-theme-shadow);
|
|
222
|
+
|
|
223
|
+
&__heading {
|
|
224
|
+
display: grid;
|
|
225
|
+
gap: 6px;
|
|
226
|
+
padding: 18px 20px;
|
|
227
|
+
color: var(--qpress-theme-dark-text);
|
|
228
|
+
background:
|
|
229
|
+
linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 42%),
|
|
230
|
+
var(--qpress-theme-dark-bg);
|
|
231
|
+
border-bottom: 5px solid var(--qpress-theme-accent);
|
|
232
|
+
|
|
233
|
+
p {
|
|
234
|
+
margin: 0;
|
|
235
|
+
opacity: 0.86;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
&__eyebrow,
|
|
240
|
+
&__surface {
|
|
241
|
+
color: var(--qpress-theme-primary);
|
|
242
|
+
font-size: 0.76rem;
|
|
243
|
+
font-weight: 700;
|
|
244
|
+
letter-spacing: 0.16em;
|
|
245
|
+
text-transform: uppercase;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
&__pair {
|
|
249
|
+
display: grid;
|
|
250
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
&__panel {
|
|
254
|
+
display: grid;
|
|
255
|
+
align-content: start;
|
|
256
|
+
gap: 12px;
|
|
257
|
+
min-height: 230px;
|
|
258
|
+
padding: 18px;
|
|
259
|
+
|
|
260
|
+
p {
|
|
261
|
+
margin: 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&--light {
|
|
265
|
+
color: var(--qpress-theme-light-text);
|
|
266
|
+
background: var(--qpress-theme-light-bg);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
&--dark {
|
|
270
|
+
color: var(--qpress-theme-dark-text);
|
|
271
|
+
background: var(--qpress-theme-dark-bg);
|
|
272
|
+
border-left: 1px solid var(--qpress-theme-accent);
|
|
273
|
+
|
|
274
|
+
.qpress-theme-preview__swatch {
|
|
275
|
+
border-color: rgba(255, 255, 255, 0.22);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
&__swatches {
|
|
281
|
+
display: flex;
|
|
282
|
+
gap: 8px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&__swatch {
|
|
286
|
+
width: 34px;
|
|
287
|
+
height: 34px;
|
|
288
|
+
border: 2px solid rgba(0, 0, 0, 0.16);
|
|
289
|
+
border-radius: 50%;
|
|
290
|
+
|
|
291
|
+
&--primary {
|
|
292
|
+
background: var(--qpress-theme-primary);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&--secondary {
|
|
296
|
+
background: var(--qpress-theme-secondary);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
&--accent {
|
|
300
|
+
background: var(--qpress-theme-accent);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
&__code {
|
|
305
|
+
width: fit-content;
|
|
306
|
+
padding: 5px 8px;
|
|
307
|
+
border: 1px solid var(--qpress-theme-primary);
|
|
308
|
+
border-radius: 6px;
|
|
309
|
+
|
|
310
|
+
&--light {
|
|
311
|
+
color: var(--qpress-theme-light-code-text);
|
|
312
|
+
background: var(--qpress-theme-light-code-bg);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
&--dark {
|
|
316
|
+
color: var(--qpress-theme-dark-code-text);
|
|
317
|
+
background: var(--qpress-theme-dark-code-bg);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@media (max-width: 600px) {
|
|
323
|
+
.qpress-theme-gallery {
|
|
324
|
+
grid-template-columns: 1fr;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.qpress-theme-preview__pair {
|
|
328
|
+
grid-template-columns: 1fr;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.qpress-theme-preview__panel--dark {
|
|
332
|
+
border-top: 1px solid var(--qpress-theme-accent);
|
|
333
|
+
border-left: 0;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
</style>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-card flat bordered>
|
|
3
|
+
<q-card-section v-if="error" class="row no-wrap items-center">
|
|
4
|
+
<q-icon name="warning" size="24px" color="negative" class="q-mr-sm" />
|
|
5
|
+
<div>Cannot connect to GitHub. Try again later.</div>
|
|
6
|
+
</q-card-section>
|
|
7
|
+
<q-card-section v-else-if="loading" class="row no-wrap items-center">
|
|
8
|
+
<q-spinner size="24px" color="primary" class="q-mr-sm" />
|
|
9
|
+
<div>Loading release notes from GitHub</div>
|
|
10
|
+
</q-card-section>
|
|
11
|
+
<template v-else>
|
|
12
|
+
<q-separator />
|
|
13
|
+
<q-tab-panels v-model="currentPackage" animated class="packages-container">
|
|
14
|
+
<q-tab-panel
|
|
15
|
+
v-for="(packageReleases, packageName) in packages"
|
|
16
|
+
:key="packageName"
|
|
17
|
+
:name="packageName"
|
|
18
|
+
class="q-pa-none"
|
|
19
|
+
>
|
|
20
|
+
<PackageReleases
|
|
21
|
+
:latest-version="latestVersions[packageName]"
|
|
22
|
+
:releases="packageReleases"
|
|
23
|
+
repo-url="https://github.com/md-plugins/md-plugins"
|
|
24
|
+
/>
|
|
25
|
+
</q-tab-panel>
|
|
26
|
+
</q-tab-panels>
|
|
27
|
+
</template>
|
|
28
|
+
</q-card>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import { onMounted, ref } from 'vue'
|
|
33
|
+
import { date } from 'quasar'
|
|
34
|
+
|
|
35
|
+
import PackageReleases from './PackageReleases.vue'
|
|
36
|
+
import type { ReleaseInfo } from './PackageReleases.vue'
|
|
37
|
+
|
|
38
|
+
const { extractDate, formatDate } = date
|
|
39
|
+
const packageName = 'MD-Plugins'
|
|
40
|
+
|
|
41
|
+
interface GitHubRelease {
|
|
42
|
+
name?: string
|
|
43
|
+
tag_name?: string
|
|
44
|
+
published_at: string
|
|
45
|
+
body?: string
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type ReleasePackageMap = Record<string, ReleaseInfo[]>
|
|
49
|
+
|
|
50
|
+
const loading = ref(false)
|
|
51
|
+
const error = ref(false)
|
|
52
|
+
const packages = ref<ReleasePackageMap>({ [packageName]: [] })
|
|
53
|
+
const currentPackage = ref(packageName)
|
|
54
|
+
const latestVersions = ref<Record<string, string>>({})
|
|
55
|
+
|
|
56
|
+
function getReleaseVersion(release: GitHubRelease): string | undefined {
|
|
57
|
+
const name = release.name || release.tag_name || ''
|
|
58
|
+
const match = name.match(/(?:^|\s)v?(\d+\.\d+\.\d+(?:[-\w.]+)?)/)
|
|
59
|
+
|
|
60
|
+
return match?.[1] ?? release.tag_name?.replace(/^v/, '')
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function queryReleases(): Promise<void> {
|
|
64
|
+
loading.value = true
|
|
65
|
+
error.value = false
|
|
66
|
+
|
|
67
|
+
try {
|
|
68
|
+
const response = await fetch(
|
|
69
|
+
'https://api.github.com/repos/md-plugins/md-plugins/releases?per_page=100',
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
if (response.ok === false) {
|
|
73
|
+
throw new Error(`GitHub request failed with ${response.status}`)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const releases = (await response.json()) as GitHubRelease[]
|
|
77
|
+
const parsedReleases = releases
|
|
78
|
+
.map((release) => {
|
|
79
|
+
const version = getReleaseVersion(release)
|
|
80
|
+
|
|
81
|
+
if (version === undefined) {
|
|
82
|
+
return null
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
version,
|
|
87
|
+
date: formatDate(extractDate(release.published_at, 'YYYY-MM-DD'), 'YYYY-MM-DD'),
|
|
88
|
+
body: release.body || '',
|
|
89
|
+
label: version,
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
.filter((release): release is ReleaseInfo => release !== null)
|
|
93
|
+
.sort((a, b) => {
|
|
94
|
+
return (
|
|
95
|
+
Number.parseInt(b.date.replace(/-/g, ''), 10) -
|
|
96
|
+
Number.parseInt(a.date.replace(/-/g, ''), 10)
|
|
97
|
+
)
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
if (parsedReleases.length === 0) {
|
|
101
|
+
throw new Error('No releases returned from GitHub')
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
packages.value = { [packageName]: parsedReleases }
|
|
105
|
+
latestVersions.value = { [packageName]: parsedReleases[0]?.label ?? '' }
|
|
106
|
+
} catch {
|
|
107
|
+
error.value = true
|
|
108
|
+
} finally {
|
|
109
|
+
loading.value = false
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
onMounted(queryReleases)
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<style lang="scss">
|
|
117
|
+
.packages-container .q-tab-panel {
|
|
118
|
+
padding-right: 0;
|
|
119
|
+
padding-top: 0;
|
|
120
|
+
}
|
|
121
|
+
</style>
|