@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.
Files changed (200) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +230 -0
  3. package/old/prompts.js +44 -0
  4. package/old/uninstall.js +9 -0
  5. package/package.json +60 -0
  6. package/scripts/build.js +33 -0
  7. package/src/index.js +63 -0
  8. package/src/install.js +49 -0
  9. package/src/templates/.gitkeep +0 -0
  10. package/src/templates/init/src/_q-press/.gitkeep +0 -0
  11. package/src/templates/init/src/_q-press/api/components/DarkModeToggle.json +37 -0
  12. package/src/templates/init/src/_q-press/api/components/MarkdownApi.json +67 -0
  13. package/src/templates/init/src/_q-press/api/components/MarkdownApiEntry.json +76 -0
  14. package/src/templates/init/src/_q-press/api/components/MarkdownCardLink.json +28 -0
  15. package/src/templates/init/src/_q-press/api/components/MarkdownCardTitle.json +48 -0
  16. package/src/templates/init/src/_q-press/api/components/MarkdownCode.json +37 -0
  17. package/src/templates/init/src/_q-press/api/components/MarkdownCodePrism.json +29 -0
  18. package/src/templates/init/src/_q-press/api/components/MarkdownCodepen.json +21 -0
  19. package/src/templates/init/src/_q-press/api/components/MarkdownCopyButton.json +36 -0
  20. package/src/templates/init/src/_q-press/api/components/MarkdownDrawerSidebar.json +17 -0
  21. package/src/templates/init/src/_q-press/api/components/MarkdownDrawerToc.json +17 -0
  22. package/src/templates/init/src/_q-press/api/components/MarkdownExample.json +22 -0
  23. package/src/templates/init/src/_q-press/api/components/MarkdownHeader.json +28 -0
  24. package/src/templates/init/src/_q-press/api/components/MarkdownHeaderIconLinks.json +16 -0
  25. package/src/templates/init/src/_q-press/api/components/MarkdownHeaderMenu.json +77 -0
  26. package/src/templates/init/src/_q-press/api/components/MarkdownHeaderTextLinks.json +33 -0
  27. package/src/templates/init/src/_q-press/api/components/MarkdownInstallation.json +33 -0
  28. package/src/templates/init/src/_q-press/api/components/MarkdownLayout.json +52 -0
  29. package/src/templates/init/src/_q-press/api/components/MarkdownLink.json +23 -0
  30. package/src/templates/init/src/_q-press/api/components/MarkdownPage.json +71 -0
  31. package/src/templates/init/src/_q-press/api/components/MarkdownPageFooter.json +21 -0
  32. package/src/templates/init/src/_q-press/api/components/MarkdownPageSidebar.json +56 -0
  33. package/src/templates/init/src/_q-press/api/components/MarkdownPageToc.json +17 -0
  34. package/src/templates/init/src/_q-press/api/components/MarkdownPrerender.json +25 -0
  35. package/src/templates/init/src/_q-press/api/components/MarkdownTree.json +27 -0
  36. package/src/templates/init/src/_q-press/api/composables/dark.json +29 -0
  37. package/src/templates/init/src/_q-press/api/composables/scroll.json +34 -0
  38. package/src/templates/init/src/_q-press/assets/get-meta.ts +29 -0
  39. package/src/templates/init/src/_q-press/components/DarkModeToggle.vue +105 -0
  40. package/src/templates/init/src/_q-press/components/MarkdownApi.vue +588 -0
  41. package/src/templates/init/src/_q-press/components/MarkdownApiEntry.ts +594 -0
  42. package/src/templates/init/src/_q-press/components/MarkdownCardLink.vue +25 -0
  43. package/src/templates/init/src/_q-press/components/MarkdownCardTitle.vue +21 -0
  44. package/src/templates/init/src/_q-press/components/MarkdownCode.vue +25 -0
  45. package/src/templates/init/src/_q-press/components/MarkdownCodePrism.ts +36 -0
  46. package/src/templates/init/src/_q-press/components/MarkdownCodepen.vue +183 -0
  47. package/src/templates/init/src/_q-press/components/MarkdownCopyButton.vue +104 -0
  48. package/src/templates/init/src/_q-press/components/MarkdownExample.vue +221 -0
  49. package/src/templates/init/src/_q-press/components/MarkdownInstallation.vue +166 -0
  50. package/src/templates/init/src/_q-press/components/MarkdownLink.vue +38 -0
  51. package/src/templates/init/src/_q-press/components/MarkdownPrerender.ts +82 -0
  52. package/src/templates/init/src/_q-press/components/MarkdownTree.vue +105 -0
  53. package/src/templates/init/src/_q-press/components/markdown-utils.ts +105 -0
  54. package/src/templates/init/src/_q-press/composables/dark.ts +39 -0
  55. package/src/templates/init/src/_q-press/composables/scroll.ts +115 -0
  56. package/src/templates/init/src/_q-press/css/app.scss +662 -0
  57. package/src/templates/init/src/_q-press/css/fonts.scss +100 -0
  58. package/src/templates/init/src/_q-press/css/prism-theme.scss +298 -0
  59. package/src/templates/init/src/_q-press/css/themes/default.scss +68 -0
  60. package/src/templates/init/src/_q-press/css/themes/newspaper.scss +69 -0
  61. package/src/templates/init/src/_q-press/css/themes/sunrise.scss +67 -0
  62. package/src/templates/init/src/_q-press/css/themes/tawny.scss +69 -0
  63. package/src/templates/init/src/_q-press/layouts/MarkdownDrawerSidebar.vue +32 -0
  64. package/src/templates/init/src/_q-press/layouts/MarkdownDrawerToc.vue +37 -0
  65. package/src/templates/init/src/_q-press/layouts/MarkdownHeader.vue +412 -0
  66. package/src/templates/init/src/_q-press/layouts/MarkdownHeaderIconLinks.vue +31 -0
  67. package/src/templates/init/src/_q-press/layouts/MarkdownHeaderMenu.ts +93 -0
  68. package/src/templates/init/src/_q-press/layouts/MarkdownHeaderTextLinks.vue +37 -0
  69. package/src/templates/init/src/_q-press/layouts/MarkdownLayout.vue +239 -0
  70. package/src/templates/init/src/_q-press/layouts/MarkdownPage.vue +307 -0
  71. package/src/templates/init/src/_q-press/layouts/MarkdownPageFooter.vue +187 -0
  72. package/src/templates/init/src/_q-press/layouts/MarkdownPageSidebar.scss +54 -0
  73. package/src/templates/init/src/_q-press/layouts/MarkdownPageSidebar.ts +218 -0
  74. package/src/templates/init/src/_q-press/layouts/MarkdownPageToc.vue +23 -0
  75. package/src/templates/init/src/_q-press/layouts/MarkdownSearch.vue +449 -0
  76. package/src/templates/init/src/_q-press/stores/markdown.ts +101 -0
  77. package/src/templates/init/src/components/LandingPage/LandingPage.vue +341 -0
  78. package/src/templates/init/src/components/Releases/PackageReleases.vue +164 -0
  79. package/src/templates/init/src/components/Releases/PublicReleases.vue +149 -0
  80. package/src/templates/init/src/components/Releases/ReleasesAvailable.vue +74 -0
  81. package/src/templates/init/src/examples/QAvatar/BasicExample.vue +11 -0
  82. package/src/templates/init/src/markdown/__elements.md +548 -0
  83. package/src/templates/init/src/markdown/__elements2.md +347 -0
  84. package/src/templates/init/src/markdown/faq/best-practices.md +0 -0
  85. package/src/templates/init/src/markdown/faq/general.md +0 -0
  86. package/src/templates/init/src/markdown/faq/troubleshooting.md +0 -0
  87. package/src/templates/init/src/markdown/getting-started/introduction.md +67 -0
  88. package/src/templates/init/src/markdown/guides/contributing.md +101 -0
  89. package/src/templates/init/src/markdown/guides/faq.md +115 -0
  90. package/src/templates/init/src/markdown/guides/release-notes.md +0 -0
  91. package/src/templates/init/src/markdown/guides/style-guide.md +0 -0
  92. package/src/templates/init/src/markdown/landing-page.md +11 -0
  93. package/src/templates/init/src/markdown/listing.ts +3 -0
  94. package/src/templates/init/src/markdown/md-plugins/blockquote/advanced.md +83 -0
  95. package/src/templates/init/src/markdown/md-plugins/blockquote/overview.md +183 -0
  96. package/src/templates/init/src/markdown/md-plugins/codeblocks/advanced.md +210 -0
  97. package/src/templates/init/src/markdown/md-plugins/codeblocks/overview.md +616 -0
  98. package/src/templates/init/src/markdown/md-plugins/containers/advanced.md +301 -0
  99. package/src/templates/init/src/markdown/md-plugins/containers/overview.md +206 -0
  100. package/src/templates/init/src/markdown/md-plugins/frontmatter/advanced.md +164 -0
  101. package/src/templates/init/src/markdown/md-plugins/frontmatter/overview.md +131 -0
  102. package/src/templates/init/src/markdown/md-plugins/headers/advanced.md +236 -0
  103. package/src/templates/init/src/markdown/md-plugins/headers/overview.md +134 -0
  104. package/src/templates/init/src/markdown/md-plugins/image/advanced.md +114 -0
  105. package/src/templates/init/src/markdown/md-plugins/image/overview.md +124 -0
  106. package/src/templates/init/src/markdown/md-plugins/imports/advanced.md +105 -0
  107. package/src/templates/init/src/markdown/md-plugins/imports/overview.md +80 -0
  108. package/src/templates/init/src/markdown/md-plugins/inline-code/advanced.md +133 -0
  109. package/src/templates/init/src/markdown/md-plugins/inline-code/overview.md +101 -0
  110. package/src/templates/init/src/markdown/md-plugins/link/advanced.md +157 -0
  111. package/src/templates/init/src/markdown/md-plugins/link/overview.md +126 -0
  112. package/src/templates/init/src/markdown/md-plugins/shared/overview.md +175 -0
  113. package/src/templates/init/src/markdown/md-plugins/table/advanced.md +190 -0
  114. package/src/templates/init/src/markdown/md-plugins/table/overview.md +186 -0
  115. package/src/templates/init/src/markdown/md-plugins/title/advanced.md +88 -0
  116. package/src/templates/init/src/markdown/md-plugins/title/overview.md +99 -0
  117. package/src/templates/init/src/markdown/other/release-notes.md +12 -0
  118. package/src/templates/init/src/markdown/privacy-policy.md +12 -0
  119. package/src/templates/init/src/markdown/quasar-app-extensions/qpress/advanced.md +101 -0
  120. package/src/templates/init/src/markdown/quasar-app-extensions/qpress/components.md +69 -0
  121. package/src/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +254 -0
  122. package/src/templates/init/src/markdown/quasar-app-extensions/qpress/themes.md +4 -0
  123. package/src/templates/init/src/markdown/quasar-app-extensions/vitemdpluginappext/advanced.md +4 -0
  124. package/src/templates/init/src/markdown/quasar-app-extensions/vitemdpluginappext/overview.md +103 -0
  125. package/src/templates/init/src/markdown/vite-plugins/index.md +6 -0
  126. package/src/templates/init/src/markdown/vite-plugins/viteexamplesplugin/advanced.md +138 -0
  127. package/src/templates/init/src/markdown/vite-plugins/viteexamplesplugin/overview.md +88 -0
  128. package/src/templates/init/src/markdown/vite-plugins/vitemdplugin/advanced.md +226 -0
  129. package/src/templates/init/src/markdown/vite-plugins/vitemdplugin/index.md +6 -0
  130. package/src/templates/init/src/markdown/vite-plugins/vitemdplugin/overview.md +166 -0
  131. package/src/templates/init/src/q-press.globals.d.ts +36 -0
  132. package/src/templates/init/src/siteConfig/index.ts +440 -0
  133. package/src/templates/update/src/_q-press/.gitkeep +0 -0
  134. package/src/templates/update/src/_q-press/api/components/DarkModeToggle.json +37 -0
  135. package/src/templates/update/src/_q-press/api/components/MarkdownApi.json +67 -0
  136. package/src/templates/update/src/_q-press/api/components/MarkdownApiEntry.json +76 -0
  137. package/src/templates/update/src/_q-press/api/components/MarkdownCardLink.json +28 -0
  138. package/src/templates/update/src/_q-press/api/components/MarkdownCardTitle.json +48 -0
  139. package/src/templates/update/src/_q-press/api/components/MarkdownCode.json +37 -0
  140. package/src/templates/update/src/_q-press/api/components/MarkdownCodePrism.json +29 -0
  141. package/src/templates/update/src/_q-press/api/components/MarkdownCodepen.json +21 -0
  142. package/src/templates/update/src/_q-press/api/components/MarkdownCopyButton.json +36 -0
  143. package/src/templates/update/src/_q-press/api/components/MarkdownDrawerSidebar.json +17 -0
  144. package/src/templates/update/src/_q-press/api/components/MarkdownDrawerToc.json +17 -0
  145. package/src/templates/update/src/_q-press/api/components/MarkdownExample.json +22 -0
  146. package/src/templates/update/src/_q-press/api/components/MarkdownHeader.json +28 -0
  147. package/src/templates/update/src/_q-press/api/components/MarkdownHeaderIconLinks.json +16 -0
  148. package/src/templates/update/src/_q-press/api/components/MarkdownHeaderMenu.json +77 -0
  149. package/src/templates/update/src/_q-press/api/components/MarkdownHeaderTextLinks.json +33 -0
  150. package/src/templates/update/src/_q-press/api/components/MarkdownInstallation.json +33 -0
  151. package/src/templates/update/src/_q-press/api/components/MarkdownLayout.json +52 -0
  152. package/src/templates/update/src/_q-press/api/components/MarkdownLink.json +23 -0
  153. package/src/templates/update/src/_q-press/api/components/MarkdownPage.json +71 -0
  154. package/src/templates/update/src/_q-press/api/components/MarkdownPageFooter.json +21 -0
  155. package/src/templates/update/src/_q-press/api/components/MarkdownPageSidebar.json +56 -0
  156. package/src/templates/update/src/_q-press/api/components/MarkdownPageToc.json +17 -0
  157. package/src/templates/update/src/_q-press/api/components/MarkdownPrerender.json +25 -0
  158. package/src/templates/update/src/_q-press/api/components/MarkdownTree.json +27 -0
  159. package/src/templates/update/src/_q-press/api/composables/dark.json +29 -0
  160. package/src/templates/update/src/_q-press/api/composables/scroll.json +34 -0
  161. package/src/templates/update/src/_q-press/assets/get-meta.ts +29 -0
  162. package/src/templates/update/src/_q-press/components/DarkModeToggle.vue +105 -0
  163. package/src/templates/update/src/_q-press/components/MarkdownApi.vue +588 -0
  164. package/src/templates/update/src/_q-press/components/MarkdownApiEntry.ts +594 -0
  165. package/src/templates/update/src/_q-press/components/MarkdownCardLink.vue +25 -0
  166. package/src/templates/update/src/_q-press/components/MarkdownCardTitle.vue +21 -0
  167. package/src/templates/update/src/_q-press/components/MarkdownCode.vue +25 -0
  168. package/src/templates/update/src/_q-press/components/MarkdownCodePrism.ts +36 -0
  169. package/src/templates/update/src/_q-press/components/MarkdownCodepen.vue +183 -0
  170. package/src/templates/update/src/_q-press/components/MarkdownCopyButton.vue +104 -0
  171. package/src/templates/update/src/_q-press/components/MarkdownExample.vue +221 -0
  172. package/src/templates/update/src/_q-press/components/MarkdownInstallation.vue +166 -0
  173. package/src/templates/update/src/_q-press/components/MarkdownLink.vue +38 -0
  174. package/src/templates/update/src/_q-press/components/MarkdownPrerender.ts +82 -0
  175. package/src/templates/update/src/_q-press/components/MarkdownTree.vue +105 -0
  176. package/src/templates/update/src/_q-press/components/markdown-utils.ts +105 -0
  177. package/src/templates/update/src/_q-press/composables/dark.ts +39 -0
  178. package/src/templates/update/src/_q-press/composables/scroll.ts +115 -0
  179. package/src/templates/update/src/_q-press/css/app.scss +662 -0
  180. package/src/templates/update/src/_q-press/css/fonts.scss +100 -0
  181. package/src/templates/update/src/_q-press/css/prism-theme.scss +298 -0
  182. package/src/templates/update/src/_q-press/css/themes/default.scss +68 -0
  183. package/src/templates/update/src/_q-press/css/themes/newspaper.scss +69 -0
  184. package/src/templates/update/src/_q-press/css/themes/sunrise.scss +67 -0
  185. package/src/templates/update/src/_q-press/css/themes/tawny.scss +69 -0
  186. package/src/templates/update/src/_q-press/layouts/MarkdownDrawerSidebar.vue +32 -0
  187. package/src/templates/update/src/_q-press/layouts/MarkdownDrawerToc.vue +37 -0
  188. package/src/templates/update/src/_q-press/layouts/MarkdownHeader.vue +412 -0
  189. package/src/templates/update/src/_q-press/layouts/MarkdownHeaderIconLinks.vue +31 -0
  190. package/src/templates/update/src/_q-press/layouts/MarkdownHeaderMenu.ts +93 -0
  191. package/src/templates/update/src/_q-press/layouts/MarkdownHeaderTextLinks.vue +37 -0
  192. package/src/templates/update/src/_q-press/layouts/MarkdownLayout.vue +239 -0
  193. package/src/templates/update/src/_q-press/layouts/MarkdownPage.vue +307 -0
  194. package/src/templates/update/src/_q-press/layouts/MarkdownPageFooter.vue +187 -0
  195. package/src/templates/update/src/_q-press/layouts/MarkdownPageSidebar.scss +54 -0
  196. package/src/templates/update/src/_q-press/layouts/MarkdownPageSidebar.ts +218 -0
  197. package/src/templates/update/src/_q-press/layouts/MarkdownPageToc.vue +23 -0
  198. package/src/templates/update/src/_q-press/layouts/MarkdownSearch.vue +449 -0
  199. package/src/templates/update/src/_q-press/stores/markdown.ts +101 -0
  200. package/src/templates/update/src/q-press.globals.d.ts +36 -0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024-present, MD-PLUGINS
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
13
+ all 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
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,230 @@
1
+ # Q-Press
2
+
3
+ The Ultimate Markdown Solution for the Quasar Framework.
4
+
5
+ ## Features
6
+
7
+ - **Markdown**
8
+ - **Dark Mode**
9
+ - **Landing Page**
10
+ - **Markdown Layouts**
11
+ - **Markdown Components**
12
+ - **siteConfig**
13
+ - **CSS Themes**
14
+
15
+ ## Installation
16
+
17
+ 1. Install the **Q-Press** App-Ext
18
+
19
+ - `quasar ext add @md-plugins/q-press`
20
+ - Here is what gets installed on a **new** install:
21
+ - `src/.q-press`
22
+ - `src/q-press.global.d.ts`
23
+ - `src/components`
24
+ - `src/markdown`
25
+ - `src/examples`
26
+ - `src/siteConfig`
27
+ - Here is what gets installed on an **update** install:
28
+ - `src/.q-press`
29
+ - `src/q-press.global.d.ts`
30
+
31
+ 2. Install `markdown-it` and `@types/markdown-it` in your project devDependencies
32
+
33
+ - `npm i -D markdown-it @types/markdown-it`
34
+ - `yarn add -D markdown-it @types/markdown-it`
35
+ - `pnpm i -D markdown-it @types/markdown-it`
36
+
37
+ 3. Add `prismjs` to your project dependencies
38
+
39
+ - `npm i prismjs`
40
+ - `yarn add prismjs`
41
+ - `pnpm i prismjs`
42
+
43
+ ## Modifications
44
+
45
+ 1. Modify your `src/css/quasar.variables.scss`
46
+
47
+ - import a Q-Press theme (`default`, `sunrise`, `newspaper`, `tawny`, your own or a 3rd-party theme)
48
+ - `@import '../.q-press/css/themes/sunrise.scss';`
49
+
50
+ 2. Modify your `src/css/app.scss`
51
+
52
+ - import Q-Press styles
53
+
54
+ - ```scss
55
+ @import '../.q-press/css/app.scss';
56
+ @import '../.q-press/css/fonts.scss';
57
+ @import '../.q-press/css/prism-theme.scss';
58
+ ```
59
+
60
+ 3. Modify your `quasar.config.ts`
61
+
62
+ ```ts
63
+ import { viteMdPlugin, type MenuItem } from '@md-plugins/vite-md-plugin'
64
+
65
+ export default defineConfig(async (ctx) => {
66
+ // Dynamically import siteConfig
67
+ const siteConfig = await import('./src/siteConfig')
68
+ const { sidebar } = siteConfig
69
+ return {
70
+ build: {
71
+ vitePlugins: [
72
+ // add this plugin
73
+ [
74
+ viteMdPlugin,
75
+ {
76
+ path: ctx.appPaths.srcDir + '/markdown',
77
+ menu: sidebar as MenuItem[],
78
+ },
79
+ ],
80
+ // ...
81
+ ```
82
+
83
+ 4. Modify your `src/routes/routes.ts`
84
+
85
+ ```ts
86
+ import mdPageList from 'src/markdown/listing'
87
+
88
+ const routes = [
89
+ {
90
+ path: '/',
91
+ component: () => import('src/.q-press/layouts/MarkdownLayout.vue'),
92
+ children: [
93
+ // Include the Landing Page route first
94
+ ...Object.entries(mdPageList)
95
+ .filter(([key]) => key.includes('landing-page.md'))
96
+ .map(([_key, component]) => ({
97
+ path: '',
98
+ name: 'Landing Page',
99
+ component,
100
+ meta: { fullscreen: true, dark: true },
101
+ })),
102
+
103
+ // Now include all other routes, excluding the landing-page
104
+ ...Object.keys(mdPageList)
105
+ .filter((key) => !key.includes('landing-page.md')) // Exclude duplicates
106
+ .map((key) => {
107
+ const acc = {
108
+ path: '',
109
+ component: mdPageList[key],
110
+ }
111
+
112
+ if (acc.path === '') {
113
+ // Remove '.md' from the end of the filename
114
+ const parts = key.substring(1, key.length - 3).split('/')
115
+ const len = parts.length
116
+ const path = parts[len - 2] === parts[len - 1] ? parts.slice(0, len - 1) : parts
117
+
118
+ acc.path = path.join('/')
119
+ }
120
+
121
+ return acc
122
+ }),
123
+ ],
124
+ },
125
+
126
+ // Always leave this as last one,
127
+ // but you can also remove it
128
+ {
129
+ path: '/:catchAll(.*)*',
130
+ component: () => import('pages/ErrorNotFound.vue'),
131
+ },
132
+ ]
133
+
134
+ export default routes
135
+ ```
136
+
137
+ 5. Set up for Dark mode support, update your App.vue
138
+
139
+ ```ts
140
+ <template>
141
+ <router-view />
142
+ </template>
143
+
144
+ <script setup lang="ts">
145
+ import { useDark } from 'src/.q-press/composables/dark'
146
+ const { initDark } = useDark()
147
+ initDark()
148
+ </script>
149
+ ```
150
+
151
+ ## Running the App
152
+
153
+ This is a Quasar app, so all you have to do is `quasar dev` and `quasar dev`. You can test it out now and you will have running the `MD-Plugins` web site.
154
+
155
+ All you need to do now is change the configuration and landing page to make it your own.
156
+
157
+ ## Configuration
158
+
159
+ ### `src/siteConfig/index.ts`
160
+
161
+ 1. Make any appropriate changes to the `siteConfig.ts` file
162
+
163
+ ### `src/components/LandingPage/LandingPage.vue`
164
+
165
+ 1. Update the `LandingPage.vue` file to include your own content
166
+
167
+ ---
168
+
169
+ ## FAQ
170
+
171
+ Q. I have errors in my `routes.ts` file, what should I do?
172
+ A. You can remove the following line: `import type { RouteRecordRaw } from 'vue-router'` and also remove the `type` keyword from the `routes` variable (`: RouteRecordRaw[]`).
173
+
174
+ Q. I still see an error in my `routes.ts` file, for `_key`, what should I do?
175
+ A. In your `eslint.config.js` file, add/replace the following in your rules:
176
+
177
+ ```js
178
+ '@typescript-eslint/no-unused-vars': [
179
+ 'error',
180
+ {
181
+ argsIgnorePattern: '^_',
182
+ ignoreRestSiblings: true,
183
+ varsIgnorePattern: '^_',
184
+ },
185
+ ],
186
+ ```
187
+
188
+ Q. Everytime I save a markdown file, `prettier` changes it so that it breaks. How can I prevent this?
189
+ A. This is both a `prettier` and `eslint` issue. In `eslint.config.js`, add the following to the top of the file, right after `export default [`:
190
+
191
+ ```js
192
+ {
193
+ /**
194
+ * Ignore the following files.
195
+ * Please note that pluginQuasar.configs.recommended() already ignores
196
+ * the "node_modules" folder for you (and all other Quasar project
197
+ * relevant folders and files).
198
+ *
199
+ * ESLint requires "ignores" key to be the only one in this object
200
+ */
201
+ ignores: ['eslint.config.js', '**/*.md', 'dist/**/*', 'node_modules'],
202
+ },
203
+ ```
204
+
205
+ If you don't have a `.prettierignore` file, create one and add the following:
206
+
207
+ ```
208
+ # Ignore all Markdown files:
209
+ **/*.md
210
+ ```
211
+
212
+ ---
213
+
214
+ ## Updating
215
+
216
+ When you update, only the `src/.q-press` folder will be updated as well as the file `src/q-press.global.d.ts`. If you want to re-install everything, just remove the `src/siteConfig` folder.
217
+
218
+ To make it easier to update, you can use the following command:
219
+
220
+ ```bash
221
+ quasar ext invoke @md-plugins/q-press
222
+ ```
223
+
224
+ ## Documentation
225
+
226
+ In case this README falls out of date, please refer to the [documentation](https://md-plugins.netlify.app/quasar-app-extensions/qpress/overview) for the latest information.
227
+
228
+ ## License
229
+
230
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
package/old/prompts.js ADDED
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Quasar App Extension prompts script
3
+ *
4
+ * Docs: https://quasar.dev/app-extensions/development-guide/prompts-api
5
+ *
6
+ * Inquirer prompts
7
+ * (answers are available as "api.prompts" in the other scripts)
8
+ * https://www.npmjs.com/package/inquirer#question
9
+ *
10
+ * Example:
11
+
12
+ return [
13
+ {
14
+ name: 'name',
15
+ type: 'input',
16
+ required: true,
17
+ message: 'Quasar CLI Extension name (without prefix)',
18
+ },
19
+ {
20
+ name: 'preset',
21
+ type: 'checkbox',
22
+ message: 'Check the features needed for your project:',
23
+ choices: [
24
+ {
25
+ name: 'Install script',
26
+ value: 'install'
27
+ },
28
+ {
29
+ name: 'Prompts script',
30
+ value: 'prompts'
31
+ },
32
+ {
33
+ name: 'Uninstall script',
34
+ value: 'uninstall'
35
+ }
36
+ ]
37
+ }
38
+ ]
39
+
40
+ */
41
+
42
+ export default function (api) {
43
+ return []
44
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Quasar App Extension uninstall script
3
+ *
4
+ * Docs: https://quasar.dev/app-extensions/development-guide/uninstall-api
5
+ */
6
+
7
+ export default function (api) {
8
+ //
9
+ }
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@md-plugins/quasar-app-extension-q-press",
3
+ "version": "0.1.0-alpha.10",
4
+ "description": "QPress - The Ultimate Markdown Solution for Quasar Framework",
5
+ "author": "hawkeye64 <galbraith64@gmail.com>",
6
+ "keywords": [
7
+ "markdown-it",
8
+ "quasarframework",
9
+ "quasar",
10
+ "markdown",
11
+ "q-press",
12
+ "vite"
13
+ ],
14
+ "homepage": "https://github.com/md-plugins",
15
+ "bugs": {
16
+ "url": "https://github.com/md-plugins/md-plugins/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/md-plugins/md-plugins.git"
21
+ },
22
+ "license": "MIT",
23
+ "type": "module",
24
+ "engines": {
25
+ "node": ">= 12.2.0",
26
+ "npm": ">= 5.6.0",
27
+ "yarn": ">= 1.6.0"
28
+ },
29
+ "dependencies": {
30
+ "@md-plugins/md-plugin-codeblocks": "0.1.0-alpha.10",
31
+ "@md-plugins/md-plugin-containers": "0.1.0-alpha.10",
32
+ "@md-plugins/md-plugin-headers": "0.1.0-alpha.10",
33
+ "@md-plugins/md-plugin-blockquote": "0.1.0-alpha.10",
34
+ "@md-plugins/md-plugin-imports": "0.1.0-alpha.10",
35
+ "@md-plugins/md-plugin-frontmatter": "0.1.0-alpha.10",
36
+ "@md-plugins/md-plugin-inlinecode": "0.1.0-alpha.10",
37
+ "@md-plugins/md-plugin-image": "0.1.0-alpha.10",
38
+ "@md-plugins/md-plugin-link": "0.1.0-alpha.10",
39
+ "@md-plugins/md-plugin-table": "0.1.0-alpha.10",
40
+ "@md-plugins/md-plugin-title": "0.1.0-alpha.10",
41
+ "@md-plugins/vite-md-plugin": "0.1.0-alpha.10",
42
+ "@md-plugins/shared": "0.1.0-alpha.10"
43
+ },
44
+ "devDependencies": {
45
+ "@types/markdown-it": "^14.1.2",
46
+ "fs-extra": "^11.2.0",
47
+ "markdown-it": "^14.1.0",
48
+ "vite": "^6.0.7"
49
+ },
50
+ "peerDependencies": {
51
+ "markdown-it": "^14.1.0"
52
+ },
53
+ "publishConfig": {
54
+ "access": "public"
55
+ },
56
+ "scripts": {
57
+ "build": "node ./scripts/build.js",
58
+ "test": "echo \"No test specified\" && exit 0"
59
+ }
60
+ }
@@ -0,0 +1,33 @@
1
+ // Copy from the Docs package to this project
2
+ import fse from 'fs-extra'
3
+ import path from 'path'
4
+ import { fileURLToPath } from 'url'
5
+
6
+ // Get the current directory name
7
+ const __filename = fileURLToPath(import.meta.url)
8
+ const __dirname = path.dirname(__filename)
9
+
10
+ // Construct full paths
11
+ const initPath = path.resolve(__dirname, '../src/templates/init')
12
+ const updatePath = path.resolve(__dirname, '../src/templates/update')
13
+ const globalsPath = path.resolve(__dirname, '../../docs/src/q-press.globals.d.ts')
14
+ const qPressPath = path.resolve(__dirname, '../../docs/src/.q-press')
15
+ const componentsPath = path.resolve(__dirname, '../../docs/src/components')
16
+ const markdownPath = path.resolve(__dirname, '../../docs/src/markdown')
17
+ const examplesPath = path.resolve(__dirname, '../../docs/src/examples')
18
+ const siteConfigPath = path.resolve(__dirname, '../../docs/src/siteConfig')
19
+
20
+ // The "update" folder only gets 'q-press.globals.d.ts' and the '_q-press' folder
21
+ fse.removeSync(initPath)
22
+ fse.removeSync(updatePath)
23
+
24
+ fse.copySync(globalsPath, path.join(initPath, 'src/q-press.globals.d.ts'))
25
+ fse.copySync(globalsPath, path.join(updatePath, 'src/q-press.globals.d.ts'))
26
+
27
+ fse.copySync(qPressPath, path.join(initPath, 'src/_q-press'))
28
+ fse.copySync(qPressPath, path.join(updatePath, 'src/_q-press'))
29
+
30
+ fse.copySync(componentsPath, path.join(initPath, 'src/components'))
31
+ fse.copySync(markdownPath, path.join(initPath, 'src/markdown'))
32
+ fse.copySync(examplesPath, path.join(initPath, 'src/examples'))
33
+ fse.copySync(siteConfigPath, path.join(initPath, 'src/siteConfig'))
package/src/index.js ADDED
@@ -0,0 +1,63 @@
1
+ /*global console*/
2
+ /**
3
+ * Quasar App Extension index/runner script
4
+ * (runs on each dev/build)
5
+ *
6
+ * Docs: https://quasar.dev/app-extensions/development-guide/index-api
7
+ */
8
+
9
+ // import fse from 'fs-extra'
10
+ // import { viteMdPlugin } from '@md-plugins/vite-md-plugin'
11
+
12
+ async function extendConfig(config /*, api*/) {
13
+ // console.log('config', config)
14
+ // console.log('api', api)
15
+
16
+ // make sure 'vueRouterMode' has 'history' mode
17
+ if (config.build.vueRouterMode !== 'history') {
18
+ console.log('Changing vueRouterMode to "history" - required for hash links to work correctly')
19
+ config.build.vueRouterMode = 'history'
20
+ }
21
+
22
+ // let Vite know to transpile md files
23
+ config.build.viteVuePluginOptions.include = config.build.viteVuePluginOptions.include || []
24
+ config.build.viteVuePluginOptions.include.push(/\.(vue|md)$/)
25
+
26
+ // let Vue know to auto import md files
27
+ const extensions = new Set(config.framework.autoImportVueExtensions || [])
28
+ extensions.add('md')
29
+ extensions.add('vue')
30
+ config.framework.autoImportVueExtensions = Array.from(extensions)
31
+
32
+ // add the appropriate plugins
33
+ const plugins = new Set(config.framework.plugins || [])
34
+ plugins.add('Cookies')
35
+ plugins.add('Dark')
36
+ plugins.add('Meta')
37
+ plugins.add('Notify')
38
+ config.framework.plugins = Array.from(plugins)
39
+
40
+ // const markdownPath = api.resolve.src('markdown')
41
+ // const path = api.resolve.src('siteConfig')
42
+ // if (fse.pathExistsSync(path) && fse.pathExistsSync(markdownPath)) {
43
+ // const siteConfig = await import(path)
44
+ // const { sidebar } = siteConfig
45
+
46
+ // // viteMdPlugin(ctx.appPaths.srcDir + '/markdown', sidebar as MenuItem[]),
47
+ // // add vite-md-plugin to quiasar.config.js
48
+ // config.vite.plugins.push([viteMdPlugin, { path: markdownPath, menu: sidebar }])
49
+ // }
50
+ }
51
+
52
+ export default function (api) {
53
+ // verify this is a Vite project
54
+ if (!api.hasVite) {
55
+ throw new Error('This extension requires Vite')
56
+ }
57
+
58
+ api.compatibleWith('quasar', '^2.0.0')
59
+ api.compatibleWith('@quasar/app-vite', '^2.0.0')
60
+
61
+ // here we extend /quasar.config, so we can add some Vite/Vue stuff
62
+ api.extendQuasarConf(extendConfig)
63
+ }
package/src/install.js ADDED
@@ -0,0 +1,49 @@
1
+ /*global console*/
2
+ /**
3
+ * Quasar App Extension install script
4
+ *
5
+ * Docs: https://quasar.dev/app-extensions/development-guide/install-api
6
+ */
7
+
8
+ import fse from 'fs-extra'
9
+
10
+ export default async function (api) {
11
+ // verify this is a Vite project
12
+ if (!api.hasVite) {
13
+ throw new Error('This extension requires Vite')
14
+ }
15
+
16
+ api.compatibleWith('quasar', '^2.0.0')
17
+ api.compatibleWith('@quasar/app-vite', '^2.0.0')
18
+
19
+ // project must have pinia installed
20
+ if ((await api.getStorePackageName()) !== 'pinia') {
21
+ console.error('-----------------------------')
22
+ console.error('This extension requires pinia')
23
+ console.error('-----------------------------')
24
+ throw new Error('This extension requires pinia')
25
+ }
26
+
27
+ // project must be typescript
28
+ if ((await api.hasTypescript()) !== true) {
29
+ console.error('----------------------------------')
30
+ console.error('This extension requires TypeScript')
31
+ console.error('----------------------------------')
32
+ throw new Error('This extension requires TypeScript')
33
+ }
34
+
35
+ const path = api.resolve.src('siteConfig')
36
+ if (fse.pathExistsSync(path)) {
37
+ // this is an update scenario
38
+ console.log('-------------------------------------')
39
+ console.log("Update only for 'src/.q-press' folder")
40
+ console.log('-------------------------------------')
41
+ api.render('./templates/update')
42
+ } else {
43
+ // this is a project initial setup
44
+ console.log('--------------------------------------------')
45
+ console.log('Initial setup. Be sure to read the\ndocumentation on the manual set up required.')
46
+ console.log('--------------------------------------------')
47
+ api.render('./templates/init')
48
+ }
49
+ }
File without changes
File without changes
@@ -0,0 +1,37 @@
1
+ {
2
+ "type": "component",
3
+ "meta": {
4
+ "docsUrl": "https://path-to-your-docs/dark-mode-toggle"
5
+ },
6
+ "props": {
7
+ "darkIcon": {
8
+ "type": "String",
9
+ "desc": "Icon name for dark mode",
10
+ "examples": [
11
+ "mdiMoonWaningCrescent"
12
+ ],
13
+ "default": "mdiMoonWaningCrescent",
14
+ "category": "content"
15
+ },
16
+ "lightIcon": {
17
+ "type": "String",
18
+ "desc": "Icon name for light mode",
19
+ "examples": [
20
+ "mdiWhiteBalanceSunny"
21
+ ],
22
+ "default": "mdiWhiteBalanceSunny",
23
+ "category": "content"
24
+ }
25
+ },
26
+ "events": {
27
+ "update:mode": {
28
+ "desc": "Emitted when the mode is toggled",
29
+ "params": {
30
+ "mode": {
31
+ "type": "String",
32
+ "desc": "The current mode ('dark' or 'light')"
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "type": "component",
3
+ "meta": {
4
+ "docsUrl": "https://path-to-your-docs/markdown-api"
5
+ },
6
+ "props": {
7
+ "nameBanner": {
8
+ "type": "String",
9
+ "desc": "Title to display in the banner",
10
+ "examples": [
11
+ "'API Documentation'",
12
+ "'Component API'"
13
+ ],
14
+ "category": "content"
15
+ },
16
+ "pageLink": {
17
+ "type": "String",
18
+ "desc": "URL for the page link",
19
+ "examples": [
20
+ "'https://github.com/user/repo/edit/main/docs/page.md'"
21
+ ],
22
+ "category": "navigation"
23
+ }
24
+ },
25
+ "events": {
26
+ "searchFieldClick": {
27
+ "desc": "Emitted when the search field is clicked",
28
+ "params": {
29
+ "evt": {
30
+ "type": "Event",
31
+ "desc": "JS event object"
32
+ }
33
+ }
34
+ },
35
+ "filterClick": {
36
+ "desc": "Emitted when the filter button is clicked",
37
+ "params": {
38
+ "evt": {
39
+ "type": "Event",
40
+ "desc": "JS event object"
41
+ }
42
+ }
43
+ }
44
+ },
45
+ "methods": {
46
+ "onSearchFieldClick": {
47
+ "desc": "Handler for the search field click event",
48
+ "params": {
49
+ "evt": {
50
+ "type": "Event",
51
+ "desc": "JS event object"
52
+ }
53
+ },
54
+ "returns": null
55
+ },
56
+ "onFilterClick": {
57
+ "desc": "Handler for the filter button click event",
58
+ "params": {
59
+ "evt": {
60
+ "type": "Event",
61
+ "desc": "JS event object"
62
+ }
63
+ },
64
+ "returns": null
65
+ }
66
+ }
67
+ }