@md-plugins/quasar-app-extension-q-press 0.1.0-alpha.16 → 0.1.0-alpha.18
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 +48 -43
- package/package.json +14 -14
- package/src/templates/init/src/_q-press/components/MarkdownExample.vue +3 -1
- package/src/templates/init/src/_q-press/layouts/MarkdownPage.vue +1 -1
- package/src/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +21 -1
- package/src/templates/init/src/siteConfig/index.ts +2 -2
- package/src/templates/update/src/_q-press/components/MarkdownExample.vue +3 -1
- package/src/templates/update/src/_q-press/layouts/MarkdownPage.vue +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ The Ultimate Markdown Solution for the Quasar Framework.
|
|
|
38
38
|
|
|
39
39
|
- `npm i prismjs`
|
|
40
40
|
- `yarn add prismjs`
|
|
41
|
-
- `pnpm
|
|
41
|
+
- `pnpm add prismjs`
|
|
42
42
|
|
|
43
43
|
## Modifications
|
|
44
44
|
|
|
@@ -57,48 +57,51 @@ The Ultimate Markdown Solution for the Quasar Framework.
|
|
|
57
57
|
@import '../.q-press/css/prism-theme.scss';
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
````
|
|
61
|
+
|
|
60
62
|
3. Modify your `quasar.config.ts`
|
|
61
63
|
|
|
62
|
-
```ts
|
|
64
|
+
- ```ts
|
|
63
65
|
import { viteMdPlugin, type MenuItem } from '@md-plugins/vite-md-plugin'
|
|
64
66
|
|
|
65
67
|
export default defineConfig(async (ctx) => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
// Dynamically import siteConfig
|
|
69
|
+
const siteConfig = await import('./src/siteConfig')
|
|
70
|
+
const { sidebar } = siteConfig
|
|
71
|
+
return {
|
|
72
|
+
build: {
|
|
73
|
+
vitePlugins: [
|
|
74
|
+
// add this plugin
|
|
75
|
+
[
|
|
76
|
+
viteMdPlugin,
|
|
77
|
+
{
|
|
78
|
+
path: ctx.appPaths.srcDir + '/markdown',
|
|
79
|
+
menu: sidebar as MenuItem[],
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
// ...
|
|
83
|
+
````
|
|
82
84
|
|
|
83
85
|
4. Modify your `src/routes/routes.ts`
|
|
84
86
|
|
|
85
|
-
```ts
|
|
86
|
-
import mdPageList from 'src/markdown/listing'
|
|
87
|
+
- ```ts
|
|
88
|
+
import mdPageList from 'src/markdown/listing'
|
|
89
|
+
```
|
|
87
90
|
|
|
88
91
|
const routes = [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
{
|
|
93
|
+
path: '/',
|
|
94
|
+
component: () => import('src/.q-press/layouts/MarkdownLayout.vue'),
|
|
95
|
+
children: [
|
|
96
|
+
// Include the Landing Page route first
|
|
97
|
+
...Object.entries(mdPageList)
|
|
98
|
+
.filter(([key]) => key.includes('landing-page.md'))
|
|
99
|
+
.map(([_key, component]) => ({
|
|
100
|
+
path: '',
|
|
101
|
+
name: 'Landing Page',
|
|
102
|
+
component,
|
|
103
|
+
meta: { fullscreen: true, dark: true },
|
|
104
|
+
})),
|
|
102
105
|
|
|
103
106
|
// Now include all other routes, excluding the landing-page
|
|
104
107
|
...Object.keys(mdPageList)
|
|
@@ -121,22 +124,24 @@ const routes = [
|
|
|
121
124
|
return acc
|
|
122
125
|
}),
|
|
123
126
|
],
|
|
124
|
-
},
|
|
125
127
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
// Always leave this as last one,
|
|
131
|
+
// but you can also remove it
|
|
132
|
+
{
|
|
133
|
+
path: '/:catchAll(._)_',
|
|
134
|
+
component: () => import('pages/ErrorNotFound.vue'),
|
|
135
|
+
},
|
|
132
136
|
]
|
|
133
137
|
|
|
134
138
|
export default routes
|
|
135
|
-
|
|
139
|
+
|
|
140
|
+
````
|
|
136
141
|
|
|
137
142
|
5. Set up for Dark mode support, update your App.vue
|
|
138
143
|
|
|
139
|
-
```ts
|
|
144
|
+
- ```ts
|
|
140
145
|
<template>
|
|
141
146
|
<router-view />
|
|
142
147
|
</template>
|
|
@@ -146,7 +151,7 @@ import { useDark } from 'src/.q-press/composables/dark'
|
|
|
146
151
|
const { initDark } = useDark()
|
|
147
152
|
initDark()
|
|
148
153
|
</script>
|
|
149
|
-
|
|
154
|
+
````
|
|
150
155
|
|
|
151
156
|
## Running the App
|
|
152
157
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@md-plugins/quasar-app-extension-q-press",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.18",
|
|
4
4
|
"description": "QPress - The Ultimate Markdown Solution for Quasar Framework",
|
|
5
5
|
"author": "hawkeye64 <galbraith64@gmail.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@types/markdown-it": "^14.1.2",
|
|
31
31
|
"markdown-it": "^14.1.0",
|
|
32
|
-
"@md-plugins/md-plugin-blockquote": "0.1.0-alpha.
|
|
33
|
-
"@md-plugins/md-plugin-codeblocks": "0.1.0-alpha.
|
|
34
|
-
"@md-plugins/md-plugin-
|
|
35
|
-
"@md-plugins/md-plugin-
|
|
36
|
-
"@md-plugins/md-plugin-
|
|
37
|
-
"@md-plugins/md-plugin-
|
|
38
|
-
"@md-plugins/md-plugin-
|
|
39
|
-
"@md-plugins/md-plugin-
|
|
40
|
-
"@md-plugins/md-plugin-
|
|
41
|
-
"@md-plugins/
|
|
42
|
-
"@md-plugins/shared": "0.1.0-alpha.
|
|
43
|
-
"@md-plugins/md-plugin-
|
|
44
|
-
"@md-plugins/md-plugin
|
|
32
|
+
"@md-plugins/md-plugin-blockquote": "0.1.0-alpha.18",
|
|
33
|
+
"@md-plugins/md-plugin-codeblocks": "0.1.0-alpha.18",
|
|
34
|
+
"@md-plugins/md-plugin-headers": "0.1.0-alpha.18",
|
|
35
|
+
"@md-plugins/md-plugin-frontmatter": "0.1.0-alpha.18",
|
|
36
|
+
"@md-plugins/md-plugin-imports": "0.1.0-alpha.18",
|
|
37
|
+
"@md-plugins/md-plugin-inlinecode": "0.1.0-alpha.18",
|
|
38
|
+
"@md-plugins/md-plugin-table": "0.1.0-alpha.18",
|
|
39
|
+
"@md-plugins/md-plugin-containers": "0.1.0-alpha.18",
|
|
40
|
+
"@md-plugins/md-plugin-image": "0.1.0-alpha.18",
|
|
41
|
+
"@md-plugins/md-plugin-title": "0.1.0-alpha.18",
|
|
42
|
+
"@md-plugins/shared": "0.1.0-alpha.18",
|
|
43
|
+
"@md-plugins/md-plugin-link": "0.1.0-alpha.18",
|
|
44
|
+
"@md-plugins/vite-md-plugin": "0.1.0-alpha.18"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/markdown-it": "^14.1.2",
|
|
@@ -110,6 +110,8 @@ import MarkdownCode from './MarkdownCode.vue'
|
|
|
110
110
|
import MarkdownCodepen from './MarkdownCodepen.vue'
|
|
111
111
|
import MarkdownCardTitle from './MarkdownCardTitle.vue'
|
|
112
112
|
|
|
113
|
+
import siteConfig from '../../siteConfig'
|
|
114
|
+
|
|
113
115
|
const props = defineProps({
|
|
114
116
|
title: String,
|
|
115
117
|
file: String,
|
|
@@ -167,7 +169,7 @@ function parseComponent(comp) {
|
|
|
167
169
|
|
|
168
170
|
function openGitHub() {
|
|
169
171
|
openURL(
|
|
170
|
-
|
|
172
|
+
`${siteConfig.githubEditRootSrc}/examples/${examples.name}/${props.file}.vue`,
|
|
171
173
|
)
|
|
172
174
|
}
|
|
173
175
|
|
|
@@ -136,7 +136,7 @@ if (props.toc !== void 0) {
|
|
|
136
136
|
markdownStore.setToc(props.toc)
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
const editHref = computed(() => `${siteConfig.
|
|
139
|
+
const editHref = computed(() => `${siteConfig.githubEditRootSrc}/markdown/${props.editLink}.md`)
|
|
140
140
|
|
|
141
141
|
const isFullscreen = computed(() => route.meta.fullscreen === true || props.fullscreen)
|
|
142
142
|
|
|
@@ -63,11 +63,21 @@ npm i prismjs
|
|
|
63
63
|
<<| bash yarn |>>
|
|
64
64
|
yarn add prismjs
|
|
65
65
|
<<| bash pnpm |>>
|
|
66
|
-
pnpm
|
|
66
|
+
pnpm add prismjs
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
## Configuration
|
|
70
70
|
|
|
71
|
+
### Modify `tsconfig.json`
|
|
72
|
+
|
|
73
|
+
Add the `resolveJsonModule: true` to your `tsconfig.json` file in your route folder:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
"compilerOptions": {
|
|
77
|
+
"resolveJsonModule": true
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
71
81
|
### Modify `src/css/quasar.variables.scss`
|
|
72
82
|
|
|
73
83
|
Import a Q-Press theme (`default`, `sunrise`, `newspaper`, `tawny`, `mystic`, your own or a 3rd-party theme):
|
|
@@ -210,6 +220,16 @@ Update your `App.vue`:
|
|
|
210
220
|
|
|
211
221
|
:::
|
|
212
222
|
|
|
223
|
+
:::details Q. I see linting issues regarding `any`, what should I do?
|
|
224
|
+
|
|
225
|
+
**A.** In your `eslint.config.js` file, add/replace the following in your rules:
|
|
226
|
+
|
|
227
|
+
```js
|
|
228
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
:::
|
|
232
|
+
|
|
213
233
|
:::details Q. Every time I save a markdown file, `prettier` changes it so that it breaks. How can I prevent this?
|
|
214
234
|
|
|
215
235
|
**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 [`:
|
|
@@ -77,7 +77,7 @@ export interface SiteConfig {
|
|
|
77
77
|
theme: string
|
|
78
78
|
version: string
|
|
79
79
|
copyright: CopyrightConfig
|
|
80
|
-
|
|
80
|
+
githubEditRootSrc: string // src folder for github edit links (appended with 'markdown' and 'examples')
|
|
81
81
|
license: LicenseConfig
|
|
82
82
|
privacy: PrivacyConfig
|
|
83
83
|
logoConfig: LogoConfig
|
|
@@ -385,7 +385,7 @@ const config = {
|
|
|
385
385
|
line1: `Copyright © 2024-${new Date().getFullYear()} MD-PLUGINS`,
|
|
386
386
|
line2: '',
|
|
387
387
|
} as CopyrightConfig,
|
|
388
|
-
|
|
388
|
+
githubEditRootSrc: 'https://github.com/md-plugins/md-plugins/edit/dev/packages/docs/src/',
|
|
389
389
|
license: {
|
|
390
390
|
label: 'MIT License',
|
|
391
391
|
link: 'https://github.com/md-plugins/md-plugins/blob/dev/LICENSE.md',
|
|
@@ -110,6 +110,8 @@ import MarkdownCode from './MarkdownCode.vue'
|
|
|
110
110
|
import MarkdownCodepen from './MarkdownCodepen.vue'
|
|
111
111
|
import MarkdownCardTitle from './MarkdownCardTitle.vue'
|
|
112
112
|
|
|
113
|
+
import siteConfig from '../../siteConfig'
|
|
114
|
+
|
|
113
115
|
const props = defineProps({
|
|
114
116
|
title: String,
|
|
115
117
|
file: String,
|
|
@@ -167,7 +169,7 @@ function parseComponent(comp) {
|
|
|
167
169
|
|
|
168
170
|
function openGitHub() {
|
|
169
171
|
openURL(
|
|
170
|
-
|
|
172
|
+
`${siteConfig.githubEditRootSrc}/examples/${examples.name}/${props.file}.vue`,
|
|
171
173
|
)
|
|
172
174
|
}
|
|
173
175
|
|
|
@@ -136,7 +136,7 @@ if (props.toc !== void 0) {
|
|
|
136
136
|
markdownStore.setToc(props.toc)
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
const editHref = computed(() => `${siteConfig.
|
|
139
|
+
const editHref = computed(() => `${siteConfig.githubEditRootSrc}/markdown/${props.editLink}.md`)
|
|
140
140
|
|
|
141
141
|
const isFullscreen = computed(() => route.meta.fullscreen === true || props.fullscreen)
|
|
142
142
|
|