@md-plugins/quasar-app-extension-q-press 0.1.0-alpha.24 → 0.1.0-alpha.26

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 (58) hide show
  1. package/README.md +53 -49
  2. package/package.json +15 -15
  3. package/src/templates/init/src/_q-press/components/MarkdownApi.vue +17 -12
  4. package/src/templates/init/src/_q-press/components/MarkdownCardTitle.vue +9 -3
  5. package/src/templates/init/src/_q-press/components/MarkdownCode.vue +8 -2
  6. package/src/templates/init/src/_q-press/components/MarkdownCodepen.vue +12 -1
  7. package/src/templates/init/src/_q-press/components/MarkdownCopyButton.vue +5 -2
  8. package/src/templates/init/src/_q-press/components/MarkdownExample.vue +16 -10
  9. package/src/templates/init/src/_q-press/components/MarkdownLink.vue +1 -1
  10. package/src/templates/init/src/_q-press/components/MarkdownPrerender.ts +11 -0
  11. package/src/templates/init/src/_q-press/components/MarkdownTree.vue +6 -3
  12. package/src/templates/init/src/_q-press/composables/scroll.ts +27 -0
  13. package/src/templates/init/src/_q-press/css/app.scss +17 -0
  14. package/src/templates/init/src/_q-press/layouts/MarkdownHeaderIconLinks.vue +9 -4
  15. package/src/templates/init/src/_q-press/layouts/MarkdownHeaderMenu.ts +18 -2
  16. package/src/templates/init/src/_q-press/layouts/MarkdownHeaderTextLinks.vue +12 -3
  17. package/src/templates/init/src/_q-press/layouts/MarkdownLayout.vue +2 -2
  18. package/src/templates/init/src/_q-press/layouts/MarkdownPage.vue +38 -14
  19. package/src/templates/init/src/_q-press/layouts/MarkdownPageFooter.vue +1 -1
  20. package/src/templates/init/src/_q-press/layouts/MarkdownPageToc.vue +2 -2
  21. package/src/templates/init/src/markdown/md-plugins/blockquote/overview.md +4 -4
  22. package/src/templates/init/src/markdown/md-plugins/codeblocks/overview.md +114 -24
  23. package/src/templates/init/src/markdown/md-plugins/containers/advanced.md +17 -10
  24. package/src/templates/init/src/markdown/md-plugins/containers/overview.md +44 -14
  25. package/src/templates/init/src/markdown/md-plugins/frontmatter/overview.md +4 -4
  26. package/src/templates/init/src/markdown/md-plugins/headers/overview.md +4 -4
  27. package/src/templates/init/src/markdown/md-plugins/image/overview.md +4 -4
  28. package/src/templates/init/src/markdown/md-plugins/imports/overview.md +4 -4
  29. package/src/templates/init/src/markdown/md-plugins/inline-code/overview.md +4 -4
  30. package/src/templates/init/src/markdown/md-plugins/link/overview.md +4 -4
  31. package/src/templates/init/src/markdown/md-plugins/table/overview.md +4 -4
  32. package/src/templates/init/src/markdown/md-plugins/title/overview.md +4 -4
  33. package/src/templates/init/src/markdown/privacy-policy.md +0 -2
  34. package/src/templates/init/src/markdown/quasar-app-extensions/qpress/advanced.md +5 -5
  35. package/src/templates/init/src/markdown/quasar-app-extensions/qpress/overview.md +11 -10
  36. package/src/templates/init/src/markdown/vite-plugins/vite-examples-plugin/overview.md +4 -4
  37. package/src/templates/init/src/markdown/vite-plugins/vite-md-plugin/overview.md +4 -4
  38. package/src/templates/init/src/q-press.globals.d.ts +1 -1
  39. package/src/templates/init/src/siteConfig/index.ts +2 -2
  40. package/src/templates/update/src/_q-press/components/MarkdownApi.vue +17 -12
  41. package/src/templates/update/src/_q-press/components/MarkdownCardTitle.vue +9 -3
  42. package/src/templates/update/src/_q-press/components/MarkdownCode.vue +8 -2
  43. package/src/templates/update/src/_q-press/components/MarkdownCodepen.vue +12 -1
  44. package/src/templates/update/src/_q-press/components/MarkdownCopyButton.vue +5 -2
  45. package/src/templates/update/src/_q-press/components/MarkdownExample.vue +16 -10
  46. package/src/templates/update/src/_q-press/components/MarkdownLink.vue +1 -1
  47. package/src/templates/update/src/_q-press/components/MarkdownPrerender.ts +11 -0
  48. package/src/templates/update/src/_q-press/components/MarkdownTree.vue +6 -3
  49. package/src/templates/update/src/_q-press/composables/scroll.ts +27 -0
  50. package/src/templates/update/src/_q-press/css/app.scss +17 -0
  51. package/src/templates/update/src/_q-press/layouts/MarkdownHeaderIconLinks.vue +9 -4
  52. package/src/templates/update/src/_q-press/layouts/MarkdownHeaderMenu.ts +18 -2
  53. package/src/templates/update/src/_q-press/layouts/MarkdownHeaderTextLinks.vue +12 -3
  54. package/src/templates/update/src/_q-press/layouts/MarkdownLayout.vue +2 -2
  55. package/src/templates/update/src/_q-press/layouts/MarkdownPage.vue +38 -14
  56. package/src/templates/update/src/_q-press/layouts/MarkdownPageFooter.vue +1 -1
  57. package/src/templates/update/src/_q-press/layouts/MarkdownPageToc.vue +2 -2
  58. package/src/templates/update/src/q-press.globals.d.ts +1 -1
package/README.md CHANGED
@@ -87,57 +87,61 @@ The Ultimate Markdown Solution for the Quasar Framework.
87
87
  4. Modify your `src/routes/routes.ts`
88
88
 
89
89
  - ```ts
90
+ import type { RouteRecordRaw } from 'vue-router'
90
91
  import mdPageList from 'src/markdown/listing'
91
-
92
- const routes = [
93
- {
94
- path: '/',
95
- component: () => import('src/.q-press/layouts/MarkdownLayout.vue'),
96
- children: [
97
- // Include the Landing Page route first
98
- ...Object.entries(mdPageList)
99
- .filter(([key]) => key.includes('landing-page.md'))
100
- .map(([_key, component]) => ({
101
- path: '',
102
- name: 'Landing Page',
103
- component,
104
- meta: { fullscreen: true, dark: true },
105
- })),
106
-
107
- // Now include all other routes, excluding the landing-page
108
- ...Object.keys(mdPageList)
109
- .filter((key) => !key.includes('landing-page.md')) // Exclude duplicates
110
- .map((key) => {
111
- const acc = {
112
- path: '',
113
- component: mdPageList[key],
114
- }
115
-
116
- if (acc.path === '') {
117
- // Remove '.md' from the end of the filename
118
- const parts = key.substring(1, key.length - 3).split('/')
119
- const len = parts.length
120
- const path = parts[len - 2] === parts[len - 1] ? parts.slice(0, len - 1) : parts
121
-
122
- acc.path = path.join('/')
123
- }
124
-
125
- return acc
126
- }),
127
- ],
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
- },
136
- ]
137
-
138
- export default routes
139
92
  ```
140
93
 
94
+ const routes = [
95
+ {
96
+ path: '/',
97
+ component: () => import('src/.q-press/layouts/MarkdownLayout.vue'),
98
+ children: [
99
+ // Include the Landing Page route first
100
+ ...Object.entries(mdPageList)
101
+ .filter(([key]) => key.includes('landing-page.md'))
102
+ .map(([_key, component]) => ({
103
+ path: '',
104
+ name: 'Landing Page',
105
+ component,
106
+ meta: { fullscreen: true, dark: true },
107
+ })),
108
+
109
+ // Now include all other routes, excluding the landing-page
110
+ ...Object.keys(mdPageList)
111
+ .filter((key) => !key.includes('landing-page.md')) // Exclude duplicates
112
+ .map((key) => {
113
+ const acc = {
114
+ path: '',
115
+ component: mdPageList[key],
116
+ }
117
+
118
+ if (acc.path === '') {
119
+ // Remove '.md' from the end of the filename
120
+ const parts = key.substring(1, key.length - 3).split('/')
121
+ const len = parts.length
122
+ const path = parts[len - 2] === parts[len - 1] ? parts.slice(0, len - 1) : parts
123
+
124
+ acc.path = path.join('/')
125
+ }
126
+
127
+ return acc
128
+ }),
129
+ ],
130
+
131
+ },
132
+
133
+ // Always leave this as last one,
134
+ // but you can also remove it
135
+ {
136
+ path: '/:catchAll(._)_',
137
+ component: () => import('pages/ErrorNotFound.vue'),
138
+ },
139
+ ] as RouteRecordRaw[]
140
+
141
+ export default routes
142
+
143
+ ````
144
+
141
145
  5. Set up for Dark mode support, update your App.vue
142
146
 
143
147
  - ```ts
@@ -151,7 +155,7 @@ The Ultimate Markdown Solution for the Quasar Framework.
151
155
  const { initDark } = useDark()
152
156
  initDark()
153
157
  </script>
154
- ```
158
+ ````
155
159
 
156
160
  ## Running the App
157
161
 
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.24",
3
+ "version": "0.1.0-alpha.26",
4
4
  "description": "QPress - The Ultimate Markdown Solution for Quasar Framework",
5
5
  "author": "hawkeye64 <galbraith64@gmail.com>",
6
6
  "keywords": [
@@ -29,24 +29,24 @@
29
29
  "dependencies": {
30
30
  "@types/markdown-it": "^14.1.2",
31
31
  "markdown-it": "^14.1.0",
32
- "@md-plugins/md-plugin-codeblocks": "0.1.0-alpha.24",
33
- "@md-plugins/md-plugin-blockquote": "0.1.0-alpha.24",
34
- "@md-plugins/md-plugin-containers": "0.1.0-alpha.24",
35
- "@md-plugins/md-plugin-frontmatter": "0.1.0-alpha.24",
36
- "@md-plugins/md-plugin-headers": "0.1.0-alpha.24",
37
- "@md-plugins/md-plugin-image": "0.1.0-alpha.24",
38
- "@md-plugins/md-plugin-imports": "0.1.0-alpha.24",
39
- "@md-plugins/md-plugin-link": "0.1.0-alpha.24",
40
- "@md-plugins/md-plugin-inlinecode": "0.1.0-alpha.24",
41
- "@md-plugins/md-plugin-table": "0.1.0-alpha.24",
42
- "@md-plugins/md-plugin-title": "0.1.0-alpha.24",
43
- "@md-plugins/shared": "0.1.0-alpha.24",
44
- "@md-plugins/vite-md-plugin": "0.1.0-alpha.24"
32
+ "@md-plugins/md-plugin-blockquote": "0.1.0-alpha.26",
33
+ "@md-plugins/md-plugin-codeblocks": "0.1.0-alpha.26",
34
+ "@md-plugins/md-plugin-frontmatter": "0.1.0-alpha.26",
35
+ "@md-plugins/md-plugin-image": "0.1.0-alpha.26",
36
+ "@md-plugins/md-plugin-headers": "0.1.0-alpha.26",
37
+ "@md-plugins/md-plugin-containers": "0.1.0-alpha.26",
38
+ "@md-plugins/md-plugin-imports": "0.1.0-alpha.26",
39
+ "@md-plugins/md-plugin-inlinecode": "0.1.0-alpha.26",
40
+ "@md-plugins/md-plugin-link": "0.1.0-alpha.26",
41
+ "@md-plugins/md-plugin-table": "0.1.0-alpha.26",
42
+ "@md-plugins/md-plugin-title": "0.1.0-alpha.26",
43
+ "@md-plugins/shared": "0.1.0-alpha.26",
44
+ "@md-plugins/vite-md-plugin": "0.1.0-alpha.26"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/markdown-it": "^14.1.2",
48
48
  "fs-extra": "^11.3.0",
49
- "vite": "^6.0.11"
49
+ "vite": "^6.1.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "markdown-it": "^14.1.0"
@@ -8,9 +8,9 @@
8
8
  @click="onSearchFieldClick"
9
9
  >
10
10
  <input
11
- class="col markdown-api__search text-right"
12
11
  ref="inputRef"
13
12
  v-model="filter"
13
+ class="col markdown-api__search text-right"
14
14
  name="filter"
15
15
  placeholder="Filter..."
16
16
  />
@@ -25,8 +25,8 @@
25
25
  </div>
26
26
 
27
27
  <q-btn
28
- class="q-ml-sm header-btn"
29
28
  v-if="props.pageLink"
29
+ class="q-ml-sm header-btn"
30
30
  size="sm"
31
31
  padding="xs sm"
32
32
  no-caps
@@ -45,8 +45,8 @@
45
45
  </template>
46
46
  <template v-else>
47
47
  <q-tabs
48
- class="header-tabs"
49
48
  v-model="currentTab"
49
+ class="header-tabs"
50
50
  active-color="brand-primary"
51
51
  indicator-color="brand-primary"
52
52
  align="left"
@@ -63,12 +63,12 @@
63
63
  <q-separator />
64
64
 
65
65
  <q-tab-panels v-model="currentTab" animated>
66
- <q-tab-panel class="q-pa-none" v-for="tab in tabsList" :name="tab" :key="tab">
67
- <div class="markdown-api__container row no-wrap" v-if="innerTabsList[tab].length !== 1">
66
+ <q-tab-panel v-for="tab in tabsList" :key="tab" class="q-pa-none" :name="tab">
67
+ <div v-if="innerTabsList[tab].length !== 1" class="markdown-api__container row no-wrap">
68
68
  <div class="col-auto">
69
69
  <q-tabs
70
- class="header-tabs markdown-api__subtabs"
71
70
  v-model="currentInnerTab"
71
+ class="header-tabs markdown-api__subtabs"
72
72
  active-color="brand-primary"
73
73
  indicator-color="brand-primary"
74
74
  :breakpoint="0"
@@ -77,9 +77,9 @@
77
77
  shrink
78
78
  >
79
79
  <q-tab
80
- class="markdown-api__subtabs-item header-btn"
81
80
  v-for="innerTab in innerTabsList[tab]"
82
81
  :key="`api-inner-tab-${innerTab}`"
82
+ class="markdown-api__subtabs-item header-btn"
83
83
  :name="innerTab"
84
84
  >
85
85
  <div class="row no-wrap items-center self-stretch q-pl-sm">
@@ -97,23 +97,23 @@
97
97
  <q-separator vertical />
98
98
 
99
99
  <q-tab-panels
100
- class="col"
101
100
  v-model="currentInnerTab"
101
+ class="col"
102
102
  animated
103
103
  transition-prev="slide-down"
104
104
  transition-next="slide-up"
105
105
  >
106
106
  <q-tab-panel
107
- class="q-pa-none"
108
107
  v-for="innerTab in innerTabsList[tab]"
109
- :name="innerTab"
110
108
  :key="innerTab"
109
+ class="q-pa-none"
110
+ :name="innerTab"
111
111
  >
112
112
  <MarkdownApiEntry :type="tab" :definition="filteredApi[tab][innerTab]" />
113
113
  </q-tab-panel>
114
114
  </q-tab-panels>
115
115
  </div>
116
- <div class="markdown-api__container" v-else>
116
+ <div v-else class="markdown-api__container">
117
117
  <MarkdownApiEntry :type="tab" :definition="filteredApi[tab][defaultInnerTabName]" />
118
118
  </div>
119
119
  </q-tab-panel>
@@ -369,12 +369,17 @@ const props = defineProps({
369
369
  file: {
370
370
  type: String,
371
371
  required: false,
372
+ default: '',
372
373
  },
373
374
  api: {
374
375
  type: Object,
375
376
  required: false,
377
+ default: null,
378
+ },
379
+ name: {
380
+ type: String,
381
+ default: 'API Documentation',
376
382
  },
377
- name: String,
378
383
  pageLink: Boolean,
379
384
  })
380
385
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="markdown-card-title q-my-xs q-mr-sm cursor-pointer" :id="id" @click="onClick">
2
+ <div :id="id" class="markdown-card-title q-my-xs q-mr-sm cursor-pointer" @click="onClick">
3
3
  {{ props.title }}
4
4
  </div>
5
5
  </template>
@@ -9,8 +9,14 @@ import { computed } from 'vue'
9
9
  import { copyHeading, slugify } from './markdown-utils'
10
10
 
11
11
  const props = defineProps({
12
- title: String,
13
- prefix: String,
12
+ title: {
13
+ type: String,
14
+ required: true,
15
+ },
16
+ prefix: {
17
+ type: String,
18
+ default: '',
19
+ },
14
20
  })
15
21
 
16
22
  const id = computed(() => (props.prefix || '') + slugify(props.title))
@@ -12,8 +12,14 @@ import MarkdownCodePrism from './MarkdownCodePrism'
12
12
  import MarkdownCopyButton from './MarkdownCopyButton.vue'
13
13
 
14
14
  const props = defineProps({
15
- code: String,
16
- maxHeight: String,
15
+ code: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ maxHeight: {
20
+ type: String,
21
+ default: void 0,
22
+ },
17
23
 
18
24
  lang: {
19
25
  type: String,
@@ -45,7 +45,7 @@ const replace = (name) =>
45
45
  return text.join('\n')
46
46
  }
47
47
 
48
- const props = defineProps({ title: String })
48
+ const props = defineProps({ title: { type: String, required: true } })
49
49
 
50
50
  const active = ref(false)
51
51
  const formRef = ref(null)
@@ -141,6 +141,12 @@ const slugifiedTitle = computed(() => {
141
141
  return slugify('example-' + props.title)
142
142
  })
143
143
 
144
+ /**
145
+ * Computed property that returns the options for the component.
146
+ * This property is reactive and will update whenever its dependencies change.
147
+ *
148
+ * @returns {Object} The options object for the component.
149
+ */
144
150
  const options = computed(() => {
145
151
  const data = {
146
152
  title: computedTitle.value,
@@ -164,6 +170,11 @@ ${html.value}
164
170
  return JSON.stringify(data)
165
171
  })
166
172
 
173
+ /**
174
+ * Opens a specific part of the application.
175
+ *
176
+ * @param {string} whichParts - The parts of the application to open.
177
+ */
167
178
  function open(whichParts) {
168
179
  def.parts = whichParts
169
180
 
@@ -3,7 +3,7 @@
3
3
  <q-icon :name="mdiClipboardOutline" color="brand-primary" @click="copy" />
4
4
 
5
5
  <transition enter-active-class="animated fadeIn" leave-active-class="animated fadeOut">
6
- <q-badge class="absolute header-badge" v-show="copied" label="Copied to clipboard" />
6
+ <q-badge v-show="copied" class="absolute header-badge" label="Copied to clipboard" />
7
7
  </transition>
8
8
  </div>
9
9
  </template>
@@ -14,7 +14,10 @@ import { copyToClipboard } from './markdown-utils'
14
14
  import { mdiClipboardOutline } from '@quasar/extras/mdi-v7'
15
15
 
16
16
  const props = defineProps({
17
- lang: String,
17
+ lang: {
18
+ type: String,
19
+ default: 'markdown',
20
+ },
18
21
  })
19
22
 
20
23
  const { proxy } = getCurrentInstance()
@@ -24,14 +24,14 @@
24
24
  <q-tooltip>View on GitHub</q-tooltip>
25
25
  </q-btn>
26
26
  <q-btn
27
- class="header-btn q-ml-xs"
28
27
  v-if="props.noEdit !== true"
28
+ class="header-btn q-ml-xs"
29
29
  dense
30
30
  flat
31
31
  round
32
32
  :icon="fabCodepen"
33
- @click="openCodepen"
34
33
  :disable="isBusy"
34
+ @click="openCodepen"
35
35
  >
36
36
  <q-tooltip>Edit in Codepen</q-tooltip>
37
37
  </q-btn>
@@ -41,8 +41,8 @@
41
41
  flat
42
42
  round
43
43
  icon="code"
44
- @click="toggleExpand"
45
44
  :disable="isBusy"
45
+ @click="toggleExpand"
46
46
  >
47
47
  <q-tooltip>View Source</q-tooltip>
48
48
  </q-btn>
@@ -52,8 +52,8 @@
52
52
  <q-slide-transition>
53
53
  <div v-show="expanded">
54
54
  <q-tabs
55
- class="header-tabs"
56
55
  v-model="currentTab"
56
+ class="header-tabs"
57
57
  align="left"
58
58
  no-caps
59
59
  active-color="brand-primary"
@@ -68,8 +68,8 @@
68
68
 
69
69
  <q-separator />
70
70
 
71
- <q-tab-panels class="text-grey-3 text-weight-regular" v-model="currentTab" animated>
72
- <q-tab-panel class="q-pa-none" v-for="tab in def.tabs" :key="`pane-${tab}`" :name="tab">
71
+ <q-tab-panels v-model="currentTab" class="text-grey-3 text-weight-regular" animated>
72
+ <q-tab-panel v-for="tab in def.tabs" :key="`pane-${tab}`" class="q-pa-none" :name="tab">
73
73
  <MarkdownCode lang="markup" :code="def.parts[tab]" max-height="70vh" />
74
74
  </q-tab-panel>
75
75
  </q-tab-panels>
@@ -83,9 +83,9 @@
83
83
  <div class="row overflow-hidden">
84
84
  <q-linear-progress v-if="isBusy" color="brand-primary" indeterminate />
85
85
  <component
86
- class="col markdown-example__content markdown-example-typography"
87
- v-else
88
86
  :is="component"
87
+ v-else
88
+ class="col markdown-example__content markdown-example-typography"
89
89
  :class="componentClass"
90
90
  />
91
91
  </div>
@@ -107,8 +107,14 @@ import MarkdownCardTitle from './MarkdownCardTitle.vue'
107
107
  import siteConfig from '../../siteConfig'
108
108
 
109
109
  const props = defineProps({
110
- title: String,
111
- file: String,
110
+ title: {
111
+ type: String,
112
+ required: true,
113
+ },
114
+ file: {
115
+ type: String,
116
+ required: true,
117
+ },
112
118
  noEdit: Boolean, // no codepen edit
113
119
  scrollable: Boolean,
114
120
  overflow: Boolean,
@@ -12,7 +12,7 @@
12
12
  import { computed } from 'vue'
13
13
  import { mdiLaunch } from '@quasar/extras/mdi-v6'
14
14
 
15
- const props = defineProps({ to: String })
15
+ const props = defineProps({ to: { type: String, required: true } })
16
16
  const internal = computed(
17
17
  () => props.to.charAt(0) === '/' || props.to.charAt(0) === '.' || props.to.charAt(0) === '#',
18
18
  )
@@ -8,10 +8,12 @@ export default defineComponent({
8
8
  title: {
9
9
  type: String as PropType<string>,
10
10
  required: false,
11
+ default: undefined,
11
12
  },
12
13
  tabs: {
13
14
  type: Array as PropType<string[]>,
14
15
  required: false,
16
+ default: undefined,
15
17
  },
16
18
  },
17
19
 
@@ -20,6 +22,15 @@ export default defineComponent({
20
22
 
21
23
  const hasHeader = computed(() => props.title !== undefined || props.tabs !== undefined)
22
24
 
25
+ /**
26
+ * Generates an array of VNode elements based on the provided props and slots.
27
+ *
28
+ * This function constructs a list of VNode elements to be rendered, including
29
+ * a title, tabs, a separator, and the main content. The content is conditionally
30
+ * wrapped in QTabPanels or a div based on the presence of tabs.
31
+ *
32
+ * @returns {ReturnType<typeof h>[]} An array of VNode elements to be rendered.
33
+ */
23
34
  function getContent() {
24
35
  const acc: ReturnType<typeof h>[] = []
25
36
 
@@ -17,16 +17,16 @@
17
17
 
18
18
  <template v-if="prop.node.e">
19
19
  <q-icon
20
+ v-if="prop.node.e"
20
21
  :name="mdiInformationOutline"
21
22
  class="q-ml-sm lt-sm"
22
- v-if="prop.node.e"
23
23
  color="grey"
24
24
  @click.stop
25
25
  @touchstart.stop
26
26
  >
27
27
  <q-tooltip>{{ prop.node.e }}</q-tooltip>
28
28
  </q-icon>
29
- <div class="markdown-tree__explanation text-grey q-ml-sm gt-xs" v-if="prop.node.e">
29
+ <div v-if="prop.node.e" class="markdown-tree__explanation text-grey q-ml-sm gt-xs">
30
30
  # {{ prop.node.e }}
31
31
  </div>
32
32
  </template>
@@ -38,7 +38,10 @@
38
38
  import { mdiLaunch, mdiInformationOutline } from '@quasar/extras/mdi-v6'
39
39
 
40
40
  const props = defineProps({
41
- def: Object,
41
+ def: {
42
+ type: Object,
43
+ required: true,
44
+ },
42
45
  })
43
46
 
44
47
  let id = 0
@@ -23,6 +23,12 @@ export function useScroll() {
23
23
  },
24
24
  )
25
25
 
26
+ /**
27
+ * Changes the router's hash to the specified value. If the current hash is different from the provided hash,
28
+ * it replaces the current hash with the new one. If the hash is the same, it scrolls to the current anchor.
29
+ *
30
+ * @param hash - The new hash value to set in the router.
31
+ */
26
32
  function changeRouterHash(hash: string) {
27
33
  if (route.hash !== hash) {
28
34
  router.replace({ hash }).catch(() => {})
@@ -31,6 +37,12 @@ export function useScroll() {
31
37
  }
32
38
  }
33
39
 
40
+ /**
41
+ * Scrolls the page to the specified HTML element with a given delay.
42
+ *
43
+ * @param el - The HTML element to scroll to.
44
+ * @param delay - The delay in milliseconds for the scroll animation.
45
+ */
34
46
  function scrollPage(el: HTMLElement, delay: number) {
35
47
  const { top } = el.getBoundingClientRect()
36
48
  const offset = Math.max(
@@ -48,6 +60,11 @@ export function useScroll() {
48
60
  }, delay + 10)
49
61
  }
50
62
 
63
+ /**
64
+ * Scrolls the page to the HTML element with the specified ID, updates the router's hash, and sets the active TOC (table of contents) item.
65
+ *
66
+ * @param id - The ID of the HTML element to scroll to.
67
+ */
51
68
  function scrollTo(id: string) {
52
69
  clearTimeout(scrollTimer)
53
70
  changeRouterHash('#' + id)
@@ -57,6 +74,11 @@ export function useScroll() {
57
74
  }, scrollDuration + 50)
58
75
  }
59
76
 
77
+ /**
78
+ * Handles the page scroll event and updates the active TOC (table of contents) item, unless the TOC update is prevented.
79
+ *
80
+ * @param position - The current vertical scroll position of the page.
81
+ */
60
82
  function onPageScroll({ position }: { position: number }) {
61
83
  // @ts-expect-error Jeff - fix later when I can figure this one out
62
84
  if (preventTocUpdate !== true && document.qScrollPrevented !== true) {
@@ -64,6 +86,11 @@ export function useScroll() {
64
86
  }
65
87
  }
66
88
 
89
+ /**
90
+ * Scrolls the page to the current anchor element, optionally with an immediate scroll.
91
+ *
92
+ * @param immediate - If true, the scroll will be immediate without any animation.
93
+ */
67
94
  function scrollToCurrentAnchor(immediate?: boolean) {
68
95
  const hash = location.hash
69
96
  const el = hash.length > 1 ? document.getElementById(hash.substring(1)) : null
@@ -112,6 +112,10 @@ ul {
112
112
  .markdown-token {
113
113
  border-color: $brand-primary;
114
114
  }
115
+ & strong {
116
+ font-weight: 700;
117
+ color: scale-color($brand-light-text, $lightness: 90%);
118
+ }
115
119
  }
116
120
 
117
121
  &--tip {
@@ -126,6 +130,10 @@ ul {
126
130
  .markdown-token {
127
131
  border-color: scale-color($positive, $lightness: -40%);
128
132
  }
133
+ & strong {
134
+ font-weight: 700;
135
+ color: scale-color($positive, $lightness: 90%);
136
+ }
129
137
  }
130
138
 
131
139
  &--warning {
@@ -140,6 +148,10 @@ ul {
140
148
  .markdown-token {
141
149
  border-color: scale-color($warning, $lightness: -40%);
142
150
  }
151
+ & strong {
152
+ font-weight: 700;
153
+ color: scale-color($warning, $lightness: 90%);
154
+ }
143
155
  }
144
156
 
145
157
  &--danger {
@@ -154,6 +166,11 @@ ul {
154
166
  .markdown-token {
155
167
  border-color: $negative;
156
168
  }
169
+
170
+ & strong {
171
+ font-weight: 700;
172
+ color: scale-color($negative, $lightness: 90%);
173
+ }
157
174
  }
158
175
 
159
176
  &--details {
@@ -6,12 +6,17 @@
6
6
  class="header-btn"
7
7
  flat
8
8
  round
9
- :icon="entry.icon"
9
+ :icon="!entry.image ? entry.icon : void 0"
10
10
  :to="entry.path"
11
+ :color="entry.color ? entry.color : void 0"
11
12
  :href="entry.external ? entry.path : void 0"
12
13
  :target="entry.external ? '_blank' : void 0"
13
14
  :aria-label="entry.name"
14
- />
15
+ >
16
+ <q-avatar v-if="entry.image" size="28px">
17
+ <img :src="entry.icon" />
18
+ </q-avatar>
19
+ </q-btn>
15
20
  </div>
16
21
  </template>
17
22
 
@@ -21,11 +26,11 @@ interface MenuEntry {
21
26
  path: string
22
27
  external?: boolean
23
28
  name: string
29
+ color?: string
30
+ image?: boolean
24
31
  }
25
32
 
26
33
  const props = defineProps<{
27
34
  menu: MenuEntry[]
28
35
  }>()
29
-
30
- console.log('props.menu:', props.menu)
31
36
  </script>