@md-plugins/quasar-app-extension-q-press 0.1.0-alpha.11 → 0.1.0-alpha.12

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/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.11",
3
+ "version": "0.1.0-alpha.12",
4
4
  "description": "QPress - The Ultimate Markdown Solution for Quasar Framework",
5
5
  "author": "hawkeye64 <galbraith64@gmail.com>",
6
6
  "keywords": [
@@ -27,19 +27,19 @@
27
27
  "yarn": ">= 1.6.0"
28
28
  },
29
29
  "dependencies": {
30
- "@md-plugins/md-plugin-blockquote": "0.1.0-alpha.11",
31
- "@md-plugins/md-plugin-containers": "0.1.0-alpha.11",
32
- "@md-plugins/md-plugin-codeblocks": "0.1.0-alpha.11",
33
- "@md-plugins/md-plugin-imports": "0.1.0-alpha.11",
34
- "@md-plugins/md-plugin-frontmatter": "0.1.0-alpha.11",
35
- "@md-plugins/md-plugin-headers": "0.1.0-alpha.11",
36
- "@md-plugins/md-plugin-image": "0.1.0-alpha.11",
37
- "@md-plugins/md-plugin-inlinecode": "0.1.0-alpha.11",
38
- "@md-plugins/md-plugin-link": "0.1.0-alpha.11",
39
- "@md-plugins/md-plugin-title": "0.1.0-alpha.11",
40
- "@md-plugins/md-plugin-table": "0.1.0-alpha.11",
41
- "@md-plugins/vite-md-plugin": "0.1.0-alpha.11",
42
- "@md-plugins/shared": "0.1.0-alpha.11"
30
+ "@md-plugins/md-plugin-blockquote": "0.1.0-alpha.12",
31
+ "@md-plugins/md-plugin-containers": "0.1.0-alpha.12",
32
+ "@md-plugins/md-plugin-headers": "0.1.0-alpha.12",
33
+ "@md-plugins/md-plugin-codeblocks": "0.1.0-alpha.12",
34
+ "@md-plugins/md-plugin-image": "0.1.0-alpha.12",
35
+ "@md-plugins/md-plugin-frontmatter": "0.1.0-alpha.12",
36
+ "@md-plugins/md-plugin-inlinecode": "0.1.0-alpha.12",
37
+ "@md-plugins/md-plugin-table": "0.1.0-alpha.12",
38
+ "@md-plugins/md-plugin-imports": "0.1.0-alpha.12",
39
+ "@md-plugins/md-plugin-title": "0.1.0-alpha.12",
40
+ "@md-plugins/vite-md-plugin": "0.1.0-alpha.12",
41
+ "@md-plugins/md-plugin-link": "0.1.0-alpha.12",
42
+ "@md-plugins/shared": "0.1.0-alpha.12"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/markdown-it": "^14.1.2",
@@ -126,7 +126,7 @@ const props = defineProps({
126
126
  <style lang="scss">
127
127
  .markdown-page-footer {
128
128
  position: relative;
129
- background-color: $brand-light;
129
+ background-color: $brand-light-bg;
130
130
  width: 100%;
131
131
  z-index: 1;
132
132
  border-top: 1px solid $separator-color;
@@ -40,20 +40,19 @@
40
40
  </div>
41
41
  </header>
42
42
  <div class="byline">
43
- <p>Discover the power of Markdown Plugins and enhance your documentation experience!</p>
44
43
  <p>
45
- <strong>NOTE:</strong> MD-Plugins are currently in development and not suitable for
46
- production.
44
+ Markdown Plugins go beyond the standard Markdown syntax.<br />Discover the power of Markdown
45
+ Plugins and enhance your documentation experience!
47
46
  </p>
48
47
  </div>
49
48
  <div class="row justify-center hero">
50
49
  <div class="hero-title">Markdown-It! Plugins</div>
51
50
  </div>
52
- <main class="content">
51
+ <main class="content grid-container">
53
52
  <div
54
53
  v-for="plugin in mdPlugins"
55
54
  :key="plugin.name"
56
- class="section"
55
+ class="section grid-item"
57
56
  @click="navigate(plugin.path)"
58
57
  >
59
58
  <q-card flat style="background: transparent">
@@ -65,11 +64,11 @@
65
64
  <div class="row justify-center hero">
66
65
  <div class="hero-title">Vite Plugins</div>
67
66
  </div>
68
- <main class="content">
67
+ <main class="content grid-container">
69
68
  <div
70
69
  v-for="plugin in vitePlugins"
71
70
  :key="plugin.name"
72
- class="section"
71
+ class="section grid-item"
73
72
  @click="navigate(plugin.path)"
74
73
  >
75
74
  <h2>{{ plugin.name }}</h2>
@@ -79,8 +78,13 @@
79
78
  <div class="row justify-center hero">
80
79
  <div class="hero-title">Quasar App Extensions</div>
81
80
  </div>
82
- <main class="content">
83
- <div v-for="ext in appExtensions" :key="ext.name" class="section" @click="navigate(ext.path)">
81
+ <main class="content grid-container">
82
+ <div
83
+ v-for="ext in appExtensions"
84
+ :key="ext.name"
85
+ class="section grid-item"
86
+ @click="navigate(ext.path)"
87
+ >
84
88
  <h2>{{ ext.name }}</h2>
85
89
  <p>{{ ext.desc }}</p>
86
90
  </div>
@@ -281,6 +285,21 @@ body.body--dark .byline {
281
285
  padding: 20px;
282
286
  }
283
287
 
288
+ .grid-container {
289
+ display: grid;
290
+ grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
291
+ gap: 10px;
292
+ width: 100%;
293
+ max-width: 100%;
294
+ justify-content: center;
295
+ align-content: center;
296
+ }
297
+
298
+ .grid-item {
299
+ // aspect-ratio: 1 / 1;
300
+ cursor: pointer;
301
+ }
302
+
284
303
  .section {
285
304
  flex: 1 1 300px;
286
305
  margin: 20px;
@@ -531,8 +531,6 @@ Lorem ipsum dolor sit amet, **consectetur adipiscing** elit, sed do _eiusmod_ te
531
531
 
532
532
  Lorem ipsum dolor sit amet, **consectetur adipiscing** elit, sed do _eiusmod_ tempor incididunt ut labore et dolore magna aliqua.
533
533
 
534
- <!-- <MarkdownInstallation plugins="AppFullscreen" /> -->
535
-
536
534
  <script import>
537
535
  import MarkdownExampleApi from 'src/.q-press/api/components/MarkdownExample.json'
538
536
  import MarkdownPageApi from 'src/.q-press/api/components/MarkdownPage.json'
@@ -338,8 +338,6 @@ const x = {
338
338
  }
339
339
  ```
340
340
 
341
- <!-- <MarkdownInstallation plugins="AppFullscreen" /> -->
342
-
343
341
  <script import>
344
342
  import AvatarApi from 'quasar/dist/api/QAvatar.json'
345
343
  </script>
@@ -25,7 +25,6 @@ import MarkdownHeaderApi from 'src/.q-press/api/components/MarkdownHeader.json'
25
25
  import MarkdownHeaderIconLinksApi from 'src/.q-press/api/components/MarkdownHeaderIconLinks.json'
26
26
  import MarkdownHeaderMenuApi from 'src/.q-press/api/components/MarkdownHeaderMenu.json'
27
27
  import MarkdownHeaderTextLinksApi from 'src/.q-press/api/components/MarkdownHeaderTextLinks.json'
28
- import MarkdownInstallationApi from 'src/.q-press/api/components/MarkdownInstallation.json'
29
28
 
30
29
  import MarkdownLayoutApi from 'src/.q-press/api/components/MarkdownLayout.json'
31
30
  import MarkdownLinkApi from 'src/.q-press/api/components/MarkdownLink.json'
@@ -56,7 +55,6 @@ import MarkdownPrerenderApi from 'src/.q-press/api/components/MarkdownPrerender.
56
55
  <MarkdownApi :api="MarkdownHeaderIconLinksApi" name="MarkdownHeaderIconLinks"/>
57
56
  <MarkdownApi :api="MarkdownHeaderMenuApi" name="MarkdownHeaderMenu"/>
58
57
  <MarkdownApi :api="MarkdownHeaderTextLinksApi" name="MarkdownHeaderTextLinks"/>
59
- <MarkdownApi :api="MarkdownInstallationApi" name="MarkdownInstallation"/>
60
58
 
61
59
  <MarkdownApi :api="MarkdownLayoutApi" name="MarkdownLayout"/>
62
60
  <MarkdownApi :api="MarkdownLinkApi" name="MarkdownLink"/>
@@ -0,0 +1,114 @@
1
+ ---
2
+ title: Q-Press Site Config
3
+ desc: Site Config for Q-Press App-Extension for Quasar.
4
+ ---
5
+
6
+ The Site Config lives in your `src/siteConfig/index.ts`. Here you can make changes to control the look and feel of your site.
7
+
8
+ ## Basic Config
9
+
10
+ Look at the Site Config file and make any appropriate changes. This is where you can add a `title`, `description`, `logo` information, `license`, `privacy` and more.
11
+
12
+ Use the `config` section to control how your site will look. Then, move onto the `links` section to create your header menus and the `sideBar` section to create your sidebar menus.
13
+
14
+ ## Menu System
15
+
16
+ For each markdown file in your `src/markdown` folder, the Vue Router will automatically generate a path for it. When creating menus, you will use the same path as the markdown file.
17
+
18
+ Menus that you create can also be displayed in the `sideBar` or `header`, or both, of your site.
19
+
20
+ To create a top-level menu, create something similar to the following:
21
+
22
+ ```ts
23
+ const mdPluginsMenu = {
24
+ name: 'MD Plugins',
25
+ mq: 600, // media query breakpoint
26
+ children: [
27
+ {
28
+ name: 'Blockquote',
29
+ children: [
30
+ { name: 'Overview', path: '/md-plugins/blockquote/overview' },
31
+ { name: 'Advanced', path: '/md-plugins/blockquote/advanced' },
32
+ ],
33
+ },
34
+ {
35
+ name: 'Codeblocks',
36
+ children: [
37
+ { name: 'Overview', path: '/md-plugins/codeblocks/overview' },
38
+ { name: 'Advanced', path: '/md-plugins/codeblocks/advanced' },
39
+ ],
40
+ },
41
+ ],
42
+ }
43
+ ```
44
+
45
+ Be sure the media query breakpoint matches the one you set in your `src/css/quasar.variables.(scss|sass)` file. See [Themes](/quasar-app-extensions/qpress/themes#media-query-breakpoints) for more info.
46
+
47
+ Chose the toolbar and order you want the menu displayed on like this:
48
+
49
+ ```ts
50
+ const secondaryToolbarLinks = [
51
+ gettingStartedMenu,
52
+ mdPluginsMenu, // <-- this is the menu we just created
53
+ vitePluginsMenu,
54
+ QuasarAppExts,
55
+ guidesMenu,
56
+ otherMenu,
57
+ ]
58
+ ```
59
+
60
+ ## MenuItem Type
61
+
62
+ A `MenuItem` looks like this, but not all options are used for header menus:
63
+
64
+ ```ts
65
+ interface MenuItem {
66
+ name: string
67
+ path?: string
68
+ icon?: string
69
+ iconColor?: string
70
+ rightIcon?: string
71
+ rightIconColor?: string
72
+ badge?: string
73
+ children?: MenuItem[] | undefined
74
+ external?: boolean
75
+ expanded?: boolean
76
+ }
77
+ ```
78
+
79
+ ## Sidebar Menu Items
80
+
81
+ Sidebar menu items need a bit more care. You can use the `sideBar` property in the Site Config to where the menu is displayed. But, we need to process it a bit:
82
+
83
+ ```ts
84
+ const processedMdPluginsMenu = {
85
+ name: mdPluginsMenu.name,
86
+ path: slugify(mdPluginsMenu.name),
87
+ expanded: false,
88
+ children: mdPluginsMenu.children.map(processMenuItem),
89
+ }
90
+ ```
91
+
92
+ Now we have `processedMdPluginsMenu` which we can add to the `sideBar` array:
93
+
94
+ ```ts
95
+ export const sidebar = [
96
+ {
97
+ name: gettingStartedMenu.name,
98
+ path: slugify(gettingStartedMenu.name),
99
+ expanded: false,
100
+ children: gettingStartedMenu.children.map((item) => ({
101
+ name: item.name,
102
+ path: slugify(item.name),
103
+ })),
104
+ },
105
+ processedMdPluginsMenu, // <-- this is the menu we just created
106
+ processedVitePluginsMenu,
107
+ processedQuasarAppExts,
108
+ processedGuidesMenu,
109
+ ]
110
+ ```
111
+
112
+ ## More Links
113
+
114
+ The `moreLinks` controls a menu item called `More`. Items here are automatically displayed base on your media query breakpoints, and also removed from the header menu. This is useful for smaller displays, like mobile devices.
@@ -2,3 +2,129 @@
2
2
  title: Q-Press Themes
3
3
  desc: Themes for Q-Press App-Extension for Quasar.
4
4
  ---
5
+
6
+ Currently, there are five themes available for **Q-Press**:
7
+
8
+ - **Default**
9
+ - **Mystic**
10
+ - **Newspaper**
11
+ - **Sunrise**
12
+ - **Tawny**
13
+
14
+ To use a theme, simply add the following line to your `src/css/quasar.variables.(scss|sass)` file:
15
+
16
+ ```scss
17
+ @import '../.q-press/css/themes/sunrise.scss';
18
+ ```
19
+
20
+ This will load the `sunrise` theme into your **Q-Press** enabled app.
21
+
22
+ ## Custom Themes
23
+
24
+ If you want to build your own theme, add these variables to your `src/css/quasar.variables.(scss|sass)` file and modify them to your liking:
25
+
26
+ ```scss
27
+ @use 'sass:color';
28
+
29
+ $primary: #214466;
30
+ $secondary: #266660;
31
+ $accent: #853394;
32
+
33
+ $positive: #2ecc71;
34
+ $negative: #ff1732;
35
+ $info: #10a0ff;
36
+ $warning: #ffd52d;
37
+
38
+ $brand-primary: #00bfff;
39
+ $brand-secondary: #4b555c;
40
+ $brand-accent: #ea5e13;
41
+ $brand-dark: #2c3e50;
42
+ $brand-light: #f5f5f5;
43
+ $brand-medium: #6b7f86;
44
+ $brand-light-text: #4d4d4d;
45
+ $brand-light-bg: #fefefe;
46
+ $brand-dark-bg: #080e1a;
47
+ $brand-dark-text: #cbcbcb;
48
+ $brand-light-codeblock-bg: #f5f5f5;
49
+ $brand-light-codeblock-text: #4d4d4d;
50
+ $brand-dark-codeblock-bg: #121212;
51
+ $brand-dark-codeblock-text: #e6e6e6;
52
+
53
+ $header-btn-color--light: #757575;
54
+ $header-btn-hover-color--light: #212121;
55
+ $header-btn-color--dark: #929397;
56
+ $header-btn-hover-color--dark: #fff;
57
+
58
+ $light-pill: $brand-light;
59
+ $light-text: $brand-light-text;
60
+ $light-bg: $brand-light-bg;
61
+
62
+ $dark-pill: scale-color($brand-primary, $lightness: -80%);
63
+ $dark-text: $brand-dark-text;
64
+ $dark-bg: $brand-dark-bg;
65
+
66
+ $separator-color: $brand-accent;
67
+ $separator-color-dark: $brand-accent;
68
+
69
+ $font-size: 16px;
70
+ $font-size-brand: 16px;
71
+ $font-weight-brand: 500;
72
+ $font-weight-technical: 400;
73
+ $letter-spacing-brand: 0.7px;
74
+
75
+ $font-family-technical:
76
+ 'Roboto',
77
+ -apple-system,
78
+ Avenir,
79
+ BlinkMacSystemFont,
80
+ 'Segoe UI',
81
+ Helvetica,
82
+ Arial,
83
+ sans-serif;
84
+ $font-family-examples: $font-family-technical;
85
+ $font-family-brand: 'Montserrat', $font-family-technical;
86
+
87
+ $shadow--large: 0 24px 24px 0 rgba(0, 179, 255, 0.24);
88
+ $shadow--medium: 0 6px 6px 0 rgba($brand-primary, 0.38);
89
+ $shadow--small: 0 6px 6px 0 rgba($brand-primary, 0.28);
90
+
91
+ $header-height: 55px;
92
+ $header-transition: 0.6s cubic-bezier(0.25, 0.8, 0.5, 1);
93
+ $header-quick-transition: 0.28s ease-in-out;
94
+ ```
95
+
96
+ ## Media Query Breakpoints
97
+
98
+ When setting up your menu system, you may need to adjust the media query breakpoints. You can add the following to your `src/css/quasar.variables.(scss|sass)` file:
99
+
100
+ ```scss
101
+ $mq-list:
102
+ 375,
103
+ 470,
104
+ 510,
105
+ 600,
106
+ 780,
107
+ 860,
108
+ 910,
109
+ 1000,
110
+ 1020,
111
+ 1100,
112
+ 1130,
113
+ 1190,
114
+ 1300 /* drawer */,
115
+ 1310,
116
+ 1400;
117
+ @each $query in $mq-list {
118
+ @media (min-width: #{$query}px) {
119
+ .lt-#{$query} {
120
+ display: none;
121
+ }
122
+ }
123
+
124
+ @media (max-width: #{$query - 1}px) {
125
+ .gt-#{$query} {
126
+ display: none;
127
+ }
128
+ }
129
+ }
130
+ ```
@@ -146,13 +146,13 @@ const footerLinks = [
146
146
  },
147
147
  ]
148
148
 
149
- const gettingStartedMenu = {
149
+ const gettingStartedMenu: SiteMenuItem = {
150
150
  name: 'Getting Started',
151
151
  mq: 470, // media query breakpoint
152
152
  children: [{ name: 'Introduction', path: '/getting-started/introduction' }],
153
153
  }
154
154
 
155
- const mdPluginsMenu = {
155
+ const mdPluginsMenu: SiteMenuItem = {
156
156
  name: 'MD Plugins',
157
157
  mq: 600, // media query breakpoint
158
158
  children: [
@@ -240,7 +240,7 @@ const mdPluginsMenu = {
240
240
  ],
241
241
  }
242
242
 
243
- const vitePluginsMenu = {
243
+ const vitePluginsMenu: SiteMenuItem = {
244
244
  name: 'Vite Plugins',
245
245
  mq: 780, // media query breakpoint
246
246
  children: [
@@ -261,7 +261,7 @@ const vitePluginsMenu = {
261
261
  ],
262
262
  }
263
263
 
264
- const QuasarAppExts = {
264
+ const QuasarAppExts: SiteMenuItem = {
265
265
  name: 'Quasar App Extensions',
266
266
  mq: 1020, // media query breakpoint
267
267
  children: [
@@ -278,13 +278,14 @@ const QuasarAppExts = {
278
278
  { name: 'Overview', path: '/quasar-app-extensions/qpress/overview' },
279
279
  { name: 'Advanced', path: '/quasar-app-extensions/qpress/advanced' },
280
280
  { name: 'Themes', path: '/quasar-app-extensions/qpress/themes' },
281
+ { name: 'Site Config', path: '/quasar-app-extensions/qpress/site-config' },
281
282
  { name: 'Components', path: '/quasar-app-extensions/qpress/components' },
282
283
  ],
283
284
  },
284
285
  ],
285
286
  }
286
287
 
287
- const guidesMenu = {
288
+ const guidesMenu: SiteMenuItem = {
288
289
  name: 'Guides',
289
290
  mq: 1100, // media query breakpoint
290
291
  children: [
@@ -299,7 +300,7 @@ const guidesMenu = {
299
300
  ],
300
301
  }
301
302
 
302
- const otherMenu = {
303
+ const otherMenu: SiteMenuItem = {
303
304
  name: 'Other',
304
305
  mq: 1190, // media query breakpoint
305
306
  children: [
@@ -314,28 +315,28 @@ const processedMdPluginsMenu = {
314
315
  name: mdPluginsMenu.name,
315
316
  path: slugify(mdPluginsMenu.name),
316
317
  expanded: false,
317
- children: mdPluginsMenu.children.map(processMenuItem),
318
+ children: mdPluginsMenu.children ? mdPluginsMenu.children.map(processMenuItem) : [],
318
319
  }
319
320
 
320
321
  const processedVitePluginsMenu = {
321
322
  name: vitePluginsMenu.name,
322
323
  path: slugify(vitePluginsMenu.name),
323
324
  expanded: false,
324
- children: vitePluginsMenu.children.map(processMenuItem),
325
+ children: vitePluginsMenu.children ? vitePluginsMenu.children.map(processMenuItem) : [],
325
326
  }
326
327
 
327
328
  const processedQuasarAppExts = {
328
329
  name: QuasarAppExts.name,
329
330
  path: slugify(QuasarAppExts.name),
330
331
  expanded: false,
331
- children: QuasarAppExts.children.map(processMenuItem),
332
+ children: QuasarAppExts.children ? QuasarAppExts.children.map(processMenuItem) : [],
332
333
  }
333
334
 
334
335
  const processedGuidesMenu = {
335
336
  name: guidesMenu.name,
336
337
  path: slugify(guidesMenu.name),
337
338
  expanded: false,
338
- children: guidesMenu.children.map(processMenuItem),
339
+ children: guidesMenu.children ? guidesMenu.children.map(processMenuItem) : [],
339
340
  }
340
341
 
341
342
  const secondaryToolbarLinks = [
@@ -347,7 +348,7 @@ const secondaryToolbarLinks = [
347
348
  otherMenu,
348
349
  ]
349
350
 
350
- export const moreLinks = [
351
+ export const moreLinks: SiteMenuItem[] = [
351
352
  {
352
353
  name: 'More',
353
354
  // children: [...primaryToolbarLinks, { separator: true }, ...secondaryToolbarLinks, socialLinks],
@@ -360,10 +361,12 @@ export const sidebar = [
360
361
  name: gettingStartedMenu.name,
361
362
  path: slugify(gettingStartedMenu.name),
362
363
  expanded: false,
363
- children: gettingStartedMenu.children.map((item) => ({
364
- name: item.name,
365
- path: slugify(item.name),
366
- })),
364
+ children: gettingStartedMenu.children
365
+ ? gettingStartedMenu.children.map((item) => ({
366
+ name: item.name,
367
+ path: slugify(item.name),
368
+ }))
369
+ : [],
367
370
  },
368
371
  processedMdPluginsMenu,
369
372
  processedVitePluginsMenu,
@@ -419,17 +422,7 @@ const config = {
419
422
  links: {
420
423
  primaryHeaderLinks: [] as SiteMenuItem[], // [...primaryToolbarLinks],
421
424
  secondaryHeaderLinks: [...secondaryToolbarLinks] as SiteMenuItem[],
422
- moreLinks: [
423
- {
424
- name: 'More',
425
- children: [
426
- // ...primaryToolbarLinks,
427
- // { separator: true },
428
- ...secondaryToolbarLinks,
429
- socialLinks,
430
- ],
431
- },
432
- ] as SiteMenuItem[],
425
+ moreLinks,
433
426
  footerLinks: [...footerLinks] as SiteMenuItem[],
434
427
  socialLinks: [...socialLinks.children] as SocialLink[],
435
428
  },
@@ -126,7 +126,7 @@ const props = defineProps({
126
126
  <style lang="scss">
127
127
  .markdown-page-footer {
128
128
  position: relative;
129
- background-color: $brand-light;
129
+ background-color: $brand-light-bg;
130
130
  width: 100%;
131
131
  z-index: 1;
132
132
  border-top: 1px solid $separator-color;
@@ -1,166 +0,0 @@
1
- <template>
2
- <q-card :id="id" class="markdown-installation q-my-xl" flat bordered>
3
- <div class="header-toolbar row items-center">
4
- <MarkdownCardTitle :title="props.title" />
5
- </div>
6
-
7
- <q-tabs
8
- class="header-tabs"
9
- v-model="currentTab"
10
- align="left"
11
- active-color="brand-primary"
12
- indicator-color="brand-primary"
13
- dense
14
- :breakpoint="0"
15
- shrink
16
- >
17
- <q-tab
18
- v-for="tab in tabList"
19
- :key="`installation-${tab}`"
20
- :name="tab"
21
- class="header-btn"
22
- no-caps
23
- >
24
- {{ tab }}
25
- </q-tab>
26
- </q-tabs>
27
-
28
- <q-separator />
29
-
30
- <q-tab-panels v-model="currentTab" animated>
31
- <q-tab-panel class="q-pa-none" name="Quasar CLI">
32
- <MarkdownCode :code="QuasarCli" />
33
- </q-tab-panel>
34
-
35
- <q-tab-panel class="q-pa-none" name="Vite plugin / Vue CLI">
36
- <MarkdownCode :code="ExternalCli" />
37
- </q-tab-panel>
38
-
39
- <q-tab-panel class="q-pa-none" name="UMD">
40
- <MarkdownCode :code="UMD" />
41
- </q-tab-panel>
42
- </q-tab-panels>
43
- </q-card>
44
- </template>
45
-
46
- <script setup>
47
- import { ref, computed } from 'vue'
48
-
49
- import MarkdownCode from './MarkdownCode.vue'
50
- import MarkdownCardTitle from './MarkdownCardTitle.vue'
51
-
52
- import { slugify } from '@md-plugins/shared'
53
-
54
- const props = defineProps({
55
- components: [Array, String],
56
- directives: [Array, String],
57
- plugins: [Array, String],
58
- config: String,
59
- title: {
60
- type: String,
61
- default: 'Installation',
62
- },
63
- })
64
-
65
- const tabList = ['Quasar CLI', 'Vite plugin / Vue CLI', 'UMD']
66
- const currentTab = ref('Quasar CLI')
67
-
68
- const id = computed(() => slugify(props.title))
69
-
70
- function nameAsString(name, indent, quotes = true) {
71
- const wrapper = quotes ? (str) => `'${str}'` : (str) => str
72
-
73
- return Array.isArray(name)
74
- ? name.map(wrapper).join(',\n' + ''.padStart(indent, ' '))
75
- : wrapper(name)
76
- }
77
-
78
- const quasarConf = computed(() => {
79
- return props.config !== void 0
80
- ? `${props.config}: /* look at QuasarConfOptions from the API card */`
81
- : null
82
- })
83
-
84
- const QuasarCli = computed(() => {
85
- if (props.plugins === void 0 && quasarConf.value === null) {
86
- return `/*
87
- * No installation step is necessary.
88
- * It gets installed by default by @quasar/app-vite or @quasar/app-webpack.
89
- */`
90
- }
91
-
92
- const parts = []
93
-
94
- if (props.plugins !== void 0) {
95
- parts.push(`plugins: [
96
- ${nameAsString(props.plugins, 6)}
97
- ]`)
98
- }
99
-
100
- if (quasarConf.value !== null) {
101
- parts.push(`config: {
102
- ${quasarConf.value}
103
- }`)
104
- }
105
-
106
- return `// quasar.config file
107
-
108
- return {
109
- framework: {
110
- ${parts.join(',\n ')}
111
- }
112
- }`
113
- })
114
-
115
- const UMD = computed(() => {
116
- const config =
117
- quasarConf.value !== null
118
- ? `
119
-
120
- // Optional;
121
- // Place the global quasarConfig Object in a script tag BEFORE your Quasar script tag
122
- app.use(Quasar, {
123
- config: {
124
- ${quasarConf.value}
125
- }
126
- }`
127
- : ''
128
-
129
- const content = `/*
130
- * No installation step is necessary.
131
- * It gets installed by default.
132
- */`
133
-
134
- return content + config
135
- })
136
-
137
- const ExternalCli = computed(() => {
138
- const types = []
139
- const imports = ['Quasar']
140
-
141
- ;['components', 'directives', 'plugins'].forEach((type) => {
142
- if (props[type] !== void 0) {
143
- imports.push(nameAsString(props[type], 2, false))
144
- types.push(`${type}: {
145
- ${nameAsString(props[type], 4, false)}
146
- }`)
147
- }
148
- })
149
-
150
- if (quasarConf.value !== null) {
151
- types.push(`config: {
152
- ${quasarConf.value}
153
- }`)
154
- }
155
-
156
- return `// main.js
157
-
158
- import {
159
- ${imports.join(',\n ')}
160
- } from 'quasar'
161
-
162
- app.use(Quasar, {
163
- ${types.join(',\n ')}
164
- })`
165
- })
166
- </script>
@@ -1,166 +0,0 @@
1
- <template>
2
- <q-card :id="id" class="markdown-installation q-my-xl" flat bordered>
3
- <div class="header-toolbar row items-center">
4
- <MarkdownCardTitle :title="props.title" />
5
- </div>
6
-
7
- <q-tabs
8
- class="header-tabs"
9
- v-model="currentTab"
10
- align="left"
11
- active-color="brand-primary"
12
- indicator-color="brand-primary"
13
- dense
14
- :breakpoint="0"
15
- shrink
16
- >
17
- <q-tab
18
- v-for="tab in tabList"
19
- :key="`installation-${tab}`"
20
- :name="tab"
21
- class="header-btn"
22
- no-caps
23
- >
24
- {{ tab }}
25
- </q-tab>
26
- </q-tabs>
27
-
28
- <q-separator />
29
-
30
- <q-tab-panels v-model="currentTab" animated>
31
- <q-tab-panel class="q-pa-none" name="Quasar CLI">
32
- <MarkdownCode :code="QuasarCli" />
33
- </q-tab-panel>
34
-
35
- <q-tab-panel class="q-pa-none" name="Vite plugin / Vue CLI">
36
- <MarkdownCode :code="ExternalCli" />
37
- </q-tab-panel>
38
-
39
- <q-tab-panel class="q-pa-none" name="UMD">
40
- <MarkdownCode :code="UMD" />
41
- </q-tab-panel>
42
- </q-tab-panels>
43
- </q-card>
44
- </template>
45
-
46
- <script setup>
47
- import { ref, computed } from 'vue'
48
-
49
- import MarkdownCode from './MarkdownCode.vue'
50
- import MarkdownCardTitle from './MarkdownCardTitle.vue'
51
-
52
- import { slugify } from '@md-plugins/shared'
53
-
54
- const props = defineProps({
55
- components: [Array, String],
56
- directives: [Array, String],
57
- plugins: [Array, String],
58
- config: String,
59
- title: {
60
- type: String,
61
- default: 'Installation',
62
- },
63
- })
64
-
65
- const tabList = ['Quasar CLI', 'Vite plugin / Vue CLI', 'UMD']
66
- const currentTab = ref('Quasar CLI')
67
-
68
- const id = computed(() => slugify(props.title))
69
-
70
- function nameAsString(name, indent, quotes = true) {
71
- const wrapper = quotes ? (str) => `'${str}'` : (str) => str
72
-
73
- return Array.isArray(name)
74
- ? name.map(wrapper).join(',\n' + ''.padStart(indent, ' '))
75
- : wrapper(name)
76
- }
77
-
78
- const quasarConf = computed(() => {
79
- return props.config !== void 0
80
- ? `${props.config}: /* look at QuasarConfOptions from the API card */`
81
- : null
82
- })
83
-
84
- const QuasarCli = computed(() => {
85
- if (props.plugins === void 0 && quasarConf.value === null) {
86
- return `/*
87
- * No installation step is necessary.
88
- * It gets installed by default by @quasar/app-vite or @quasar/app-webpack.
89
- */`
90
- }
91
-
92
- const parts = []
93
-
94
- if (props.plugins !== void 0) {
95
- parts.push(`plugins: [
96
- ${nameAsString(props.plugins, 6)}
97
- ]`)
98
- }
99
-
100
- if (quasarConf.value !== null) {
101
- parts.push(`config: {
102
- ${quasarConf.value}
103
- }`)
104
- }
105
-
106
- return `// quasar.config file
107
-
108
- return {
109
- framework: {
110
- ${parts.join(',\n ')}
111
- }
112
- }`
113
- })
114
-
115
- const UMD = computed(() => {
116
- const config =
117
- quasarConf.value !== null
118
- ? `
119
-
120
- // Optional;
121
- // Place the global quasarConfig Object in a script tag BEFORE your Quasar script tag
122
- app.use(Quasar, {
123
- config: {
124
- ${quasarConf.value}
125
- }
126
- }`
127
- : ''
128
-
129
- const content = `/*
130
- * No installation step is necessary.
131
- * It gets installed by default.
132
- */`
133
-
134
- return content + config
135
- })
136
-
137
- const ExternalCli = computed(() => {
138
- const types = []
139
- const imports = ['Quasar']
140
-
141
- ;['components', 'directives', 'plugins'].forEach((type) => {
142
- if (props[type] !== void 0) {
143
- imports.push(nameAsString(props[type], 2, false))
144
- types.push(`${type}: {
145
- ${nameAsString(props[type], 4, false)}
146
- }`)
147
- }
148
- })
149
-
150
- if (quasarConf.value !== null) {
151
- types.push(`config: {
152
- ${quasarConf.value}
153
- }`)
154
- }
155
-
156
- return `// main.js
157
-
158
- import {
159
- ${imports.join(',\n ')}
160
- } from 'quasar'
161
-
162
- app.use(Quasar, {
163
- ${types.join(',\n ')}
164
- })`
165
- })
166
- </script>