themekit-js 1.1.0

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 (171) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +27 -0
  3. package/bin/themekit.js +2 -0
  4. package/client.d.ts +5 -0
  5. package/dist/client/app/components/ClientOnly.js +10 -0
  6. package/dist/client/app/components/Content.js +23 -0
  7. package/dist/client/app/composables/codeGroups.js +40 -0
  8. package/dist/client/app/composables/copyCode.js +73 -0
  9. package/dist/client/app/composables/head.js +81 -0
  10. package/dist/client/app/composables/preFetch.js +99 -0
  11. package/dist/client/app/data.js +59 -0
  12. package/dist/client/app/devtools.js +29 -0
  13. package/dist/client/app/index.js +140 -0
  14. package/dist/client/app/router.js +233 -0
  15. package/dist/client/app/ssr.js +10 -0
  16. package/dist/client/app/theme.js +1 -0
  17. package/dist/client/app/utils.js +119 -0
  18. package/dist/client/index.d.ts +1446 -0
  19. package/dist/client/index.js +9 -0
  20. package/dist/client/shared.js +139 -0
  21. package/dist/client/theme-default/Layout.vue +94 -0
  22. package/dist/client/theme-default/NotFound.vue +109 -0
  23. package/dist/client/theme-default/components/VPAlgoliaSearchBox.vue +99 -0
  24. package/dist/client/theme-default/components/VPBackdrop.vue +41 -0
  25. package/dist/client/theme-default/components/VPBadge.vue +86 -0
  26. package/dist/client/theme-default/components/VPButton.vue +123 -0
  27. package/dist/client/theme-default/components/VPCarbonAds.vue +109 -0
  28. package/dist/client/theme-default/components/VPContent.vue +98 -0
  29. package/dist/client/theme-default/components/VPDoc.vue +193 -0
  30. package/dist/client/theme-default/components/VPDocAside.vue +46 -0
  31. package/dist/client/theme-default/components/VPDocAsideCarbonAds.vue +18 -0
  32. package/dist/client/theme-default/components/VPDocAsideOutline.vue +87 -0
  33. package/dist/client/theme-default/components/VPDocAsideSponsors.vue +17 -0
  34. package/dist/client/theme-default/components/VPDocFooter.vue +145 -0
  35. package/dist/client/theme-default/components/VPDocFooterLastUpdated.vue +50 -0
  36. package/dist/client/theme-default/components/VPDocOutlineItem.vue +59 -0
  37. package/dist/client/theme-default/components/VPFeature.vue +123 -0
  38. package/dist/client/theme-default/components/VPFeatures.vue +121 -0
  39. package/dist/client/theme-default/components/VPFlyout.vue +136 -0
  40. package/dist/client/theme-default/components/VPFooter.vue +60 -0
  41. package/dist/client/theme-default/components/VPHero.vue +336 -0
  42. package/dist/client/theme-default/components/VPHome.vue +43 -0
  43. package/dist/client/theme-default/components/VPHomeContent.vue +52 -0
  44. package/dist/client/theme-default/components/VPHomeFeatures.vue +14 -0
  45. package/dist/client/theme-default/components/VPHomeHero.vue +24 -0
  46. package/dist/client/theme-default/components/VPHomeSponsors.vue +116 -0
  47. package/dist/client/theme-default/components/VPImage.vue +46 -0
  48. package/dist/client/theme-default/components/VPLink.vue +33 -0
  49. package/dist/client/theme-default/components/VPLocalNav.vue +171 -0
  50. package/dist/client/theme-default/components/VPLocalNavOutlineDropdown.vue +190 -0
  51. package/dist/client/theme-default/components/VPLocalSearchBox.vue +856 -0
  52. package/dist/client/theme-default/components/VPMenu.vue +72 -0
  53. package/dist/client/theme-default/components/VPMenuGroup.vue +47 -0
  54. package/dist/client/theme-default/components/VPMenuLink.vue +54 -0
  55. package/dist/client/theme-default/components/VPNav.vue +57 -0
  56. package/dist/client/theme-default/components/VPNavBar.vue +267 -0
  57. package/dist/client/theme-default/components/VPNavBarAppearance.vue +25 -0
  58. package/dist/client/theme-default/components/VPNavBarExtra.vue +94 -0
  59. package/dist/client/theme-default/components/VPNavBarHamburger.vue +79 -0
  60. package/dist/client/theme-default/components/VPNavBarMenu.vue +29 -0
  61. package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +42 -0
  62. package/dist/client/theme-default/components/VPNavBarMenuLink.vue +53 -0
  63. package/dist/client/theme-default/components/VPNavBarSearch.vue +194 -0
  64. package/dist/client/theme-default/components/VPNavBarSearchButton.vue +208 -0
  65. package/dist/client/theme-default/components/VPNavBarSocialLinks.vue +27 -0
  66. package/dist/client/theme-default/components/VPNavBarTitle.vue +76 -0
  67. package/dist/client/theme-default/components/VPNavBarTranslations.vue +47 -0
  68. package/dist/client/theme-default/components/VPNavScreen.vue +99 -0
  69. package/dist/client/theme-default/components/VPNavScreenAppearance.vue +33 -0
  70. package/dist/client/theme-default/components/VPNavScreenMenu.vue +23 -0
  71. package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +111 -0
  72. package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +39 -0
  73. package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +34 -0
  74. package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +39 -0
  75. package/dist/client/theme-default/components/VPNavScreenSocialLinks.vue +14 -0
  76. package/dist/client/theme-default/components/VPNavScreenTranslations.vue +73 -0
  77. package/dist/client/theme-default/components/VPPage.vue +7 -0
  78. package/dist/client/theme-default/components/VPSidebar.vue +137 -0
  79. package/dist/client/theme-default/components/VPSidebarItem.vue +250 -0
  80. package/dist/client/theme-default/components/VPSkipLink.vue +68 -0
  81. package/dist/client/theme-default/components/VPSocialLink.vue +50 -0
  82. package/dist/client/theme-default/components/VPSocialLinks.vue +27 -0
  83. package/dist/client/theme-default/components/VPSponsors.vue +48 -0
  84. package/dist/client/theme-default/components/VPSponsorsGrid.vue +48 -0
  85. package/dist/client/theme-default/components/VPSwitch.vue +63 -0
  86. package/dist/client/theme-default/components/VPSwitchAppearance.vue +52 -0
  87. package/dist/client/theme-default/components/VPTeamMembers.vue +66 -0
  88. package/dist/client/theme-default/components/VPTeamMembersItem.vue +225 -0
  89. package/dist/client/theme-default/components/VPTeamPage.vue +58 -0
  90. package/dist/client/theme-default/components/VPTeamPageSection.vue +77 -0
  91. package/dist/client/theme-default/components/VPTeamPageTitle.vue +63 -0
  92. package/dist/client/theme-default/components/icons/VPIconAlignJustify.vue +8 -0
  93. package/dist/client/theme-default/components/icons/VPIconAlignLeft.vue +8 -0
  94. package/dist/client/theme-default/components/icons/VPIconAlignRight.vue +8 -0
  95. package/dist/client/theme-default/components/icons/VPIconArrowLeft.vue +7 -0
  96. package/dist/client/theme-default/components/icons/VPIconArrowRight.vue +7 -0
  97. package/dist/client/theme-default/components/icons/VPIconChevronDown.vue +5 -0
  98. package/dist/client/theme-default/components/icons/VPIconChevronLeft.vue +5 -0
  99. package/dist/client/theme-default/components/icons/VPIconChevronRight.vue +5 -0
  100. package/dist/client/theme-default/components/icons/VPIconChevronUp.vue +5 -0
  101. package/dist/client/theme-default/components/icons/VPIconEdit.vue +6 -0
  102. package/dist/client/theme-default/components/icons/VPIconHeart.vue +5 -0
  103. package/dist/client/theme-default/components/icons/VPIconLanguages.vue +9 -0
  104. package/dist/client/theme-default/components/icons/VPIconMinus.vue +5 -0
  105. package/dist/client/theme-default/components/icons/VPIconMinusSquare.vue +6 -0
  106. package/dist/client/theme-default/components/icons/VPIconMoon.vue +5 -0
  107. package/dist/client/theme-default/components/icons/VPIconMoreHorizontal.vue +7 -0
  108. package/dist/client/theme-default/components/icons/VPIconPlus.vue +5 -0
  109. package/dist/client/theme-default/components/icons/VPIconPlusSquare.vue +6 -0
  110. package/dist/client/theme-default/components/icons/VPIconSun.vue +13 -0
  111. package/dist/client/theme-default/composables/aside.js +17 -0
  112. package/dist/client/theme-default/composables/data.js +2 -0
  113. package/dist/client/theme-default/composables/edit-link.js +16 -0
  114. package/dist/client/theme-default/composables/flyout.js +41 -0
  115. package/dist/client/theme-default/composables/langs.js +26 -0
  116. package/dist/client/theme-default/composables/local-nav.js +18 -0
  117. package/dist/client/theme-default/composables/nav.js +30 -0
  118. package/dist/client/theme-default/composables/outline.js +178 -0
  119. package/dist/client/theme-default/composables/prev-next.js +57 -0
  120. package/dist/client/theme-default/composables/sidebar.js +136 -0
  121. package/dist/client/theme-default/composables/sponsor-grid.js +94 -0
  122. package/dist/client/theme-default/fonts/inter-italic-cyrillic-ext.woff2 +0 -0
  123. package/dist/client/theme-default/fonts/inter-italic-cyrillic.woff2 +0 -0
  124. package/dist/client/theme-default/fonts/inter-italic-greek-ext.woff2 +0 -0
  125. package/dist/client/theme-default/fonts/inter-italic-greek.woff2 +0 -0
  126. package/dist/client/theme-default/fonts/inter-italic-latin-ext.woff2 +0 -0
  127. package/dist/client/theme-default/fonts/inter-italic-latin.woff2 +0 -0
  128. package/dist/client/theme-default/fonts/inter-italic-vietnamese.woff2 +0 -0
  129. package/dist/client/theme-default/fonts/inter-roman-cyrillic-ext.woff2 +0 -0
  130. package/dist/client/theme-default/fonts/inter-roman-cyrillic.woff2 +0 -0
  131. package/dist/client/theme-default/fonts/inter-roman-greek-ext.woff2 +0 -0
  132. package/dist/client/theme-default/fonts/inter-roman-greek.woff2 +0 -0
  133. package/dist/client/theme-default/fonts/inter-roman-latin-ext.woff2 +0 -0
  134. package/dist/client/theme-default/fonts/inter-roman-latin.woff2 +0 -0
  135. package/dist/client/theme-default/fonts/inter-roman-vietnamese.woff2 +0 -0
  136. package/dist/client/theme-default/index.js +3 -0
  137. package/dist/client/theme-default/styles/base.css +252 -0
  138. package/dist/client/theme-default/styles/components/custom-block.css +208 -0
  139. package/dist/client/theme-default/styles/components/vp-code-group.css +85 -0
  140. package/dist/client/theme-default/styles/components/vp-code.css +7 -0
  141. package/dist/client/theme-default/styles/components/vp-doc.css +570 -0
  142. package/dist/client/theme-default/styles/components/vp-sponsor.css +155 -0
  143. package/dist/client/theme-default/styles/fonts.css +157 -0
  144. package/dist/client/theme-default/styles/icons.css +123 -0
  145. package/dist/client/theme-default/styles/utils.css +9 -0
  146. package/dist/client/theme-default/styles/vars.css +563 -0
  147. package/dist/client/theme-default/support/lru.js +33 -0
  148. package/dist/client/theme-default/support/sidebar.js +89 -0
  149. package/dist/client/theme-default/support/translation.js +49 -0
  150. package/dist/client/theme-default/support/utils.js +33 -0
  151. package/dist/client/theme-default/without-fonts.js +32 -0
  152. package/dist/node/cli.js +444 -0
  153. package/dist/node/index.d.ts +4588 -0
  154. package/dist/node/index.js +198 -0
  155. package/dist/node/serve-BjvG349_.js +50301 -0
  156. package/lib/vue-demi.mjs +34 -0
  157. package/package.json +223 -0
  158. package/template/.vitepress/config.js +28 -0
  159. package/template/.vitepress/theme/Layout.vue +21 -0
  160. package/template/.vitepress/theme/index.js +29 -0
  161. package/template/.vitepress/theme/style.css +143 -0
  162. package/template/api-examples.md +49 -0
  163. package/template/index.md +28 -0
  164. package/template/markdown-examples.md +85 -0
  165. package/theme-without-fonts.d.ts +2 -0
  166. package/theme.d.ts +30 -0
  167. package/types/default-theme.d.ts +533 -0
  168. package/types/docsearch.d.ts +144 -0
  169. package/types/index.d.ts +3 -0
  170. package/types/local-search.d.ts +33 -0
  171. package/types/shared.d.ts +199 -0
@@ -0,0 +1,34 @@
1
+ /**
2
+ * vue-demi v0.14.7
3
+ * Copyright (c) 2020-present, Anthony Fu
4
+ * @license MIT
5
+ */
6
+
7
+ import * as Vue from 'vue'
8
+
9
+ var isVue2 = false
10
+ var isVue3 = true
11
+ var Vue2 = undefined
12
+
13
+ function install() {}
14
+
15
+ export function set(target, key, val) {
16
+ if (Array.isArray(target)) {
17
+ target.length = Math.max(target.length, key)
18
+ target.splice(key, 1, val)
19
+ return val
20
+ }
21
+ target[key] = val
22
+ return val
23
+ }
24
+
25
+ export function del(target, key) {
26
+ if (Array.isArray(target)) {
27
+ target.splice(key, 1)
28
+ return
29
+ }
30
+ delete target[key]
31
+ }
32
+
33
+ export * from 'vue'
34
+ export { Vue, Vue2, isVue2, isVue3, install }
package/package.json ADDED
@@ -0,0 +1,223 @@
1
+ {
2
+ "name": "themekit-js",
3
+ "version": "1.1.0",
4
+ "description": "基于VitePress二次开发的Markdown静态网站工具",
5
+ "type": "module",
6
+ "packageManager": "pnpm@8.15.6",
7
+ "main": "dist/node/index.js",
8
+ "types": "types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./types/index.d.ts",
12
+ "default": "./dist/node/index.js"
13
+ },
14
+ "./dist/*": "./dist/*",
15
+ "./package.json": "./package.json",
16
+ "./client": {
17
+ "types": "./client.d.ts",
18
+ "default": "./dist/client/index.js"
19
+ },
20
+ "./theme": {
21
+ "types": "./theme.d.ts",
22
+ "default": "./dist/client/theme-default/index.js"
23
+ },
24
+ "./theme-without-fonts": {
25
+ "types": "./theme-without-fonts.d.ts",
26
+ "default": "./dist/client/theme-default/without-fonts.js"
27
+ },
28
+ "./vue-demi": {
29
+ "default": "./lib/vue-demi.mjs"
30
+ }
31
+ },
32
+ "bin": {
33
+ "themekit": "bin/themekit.js"
34
+ },
35
+ "files": [
36
+ "bin",
37
+ "dist",
38
+ "types",
39
+ "template",
40
+ "client.d.ts",
41
+ "theme.d.ts",
42
+ "theme-without-fonts.d.ts",
43
+ "lib"
44
+ ],
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/seedunk/themekit-js.git"
48
+ },
49
+ "keywords": [
50
+ "vite",
51
+ "vue",
52
+ "vitepress"
53
+ ],
54
+ "author": "Seedunk",
55
+ "license": "MIT",
56
+ "homepage": "https://seedunk.github.io/themekit-js",
57
+ "scripts": {
58
+ "dev": "rimraf dist && run-s dev:shared dev:start",
59
+ "dev:start": "run-p dev:client dev:node dev:watch",
60
+ "dev:client": "tsc --sourcemap -w -p src/client",
61
+ "dev:node": "DEV=true pnpm build:node -w",
62
+ "dev:shared": "node scripts/copyShared",
63
+ "dev:watch": "node scripts/watchAndCopy",
64
+ "build": "run-s build:prepare build:client build:node",
65
+ "build:prepare": "rimraf dist && node scripts/copyShared",
66
+ "build:client": "vue-tsc --noEmit -p src/client && tsc -p src/client && node scripts/copyClient",
67
+ "build:node": "tsc -p src/node --noEmit && rollup --config rollup.config.ts --configPlugin esbuild",
68
+ "test": "run-p --aggregate-output test:unit test:e2e test:init",
69
+ "test:unit": "vitest run -r __tests__/unit",
70
+ "test:unit:watch": "vitest -r __tests__/unit",
71
+ "test:e2e": "run-s test:e2e-dev test:e2e-build",
72
+ "test:e2e:site:dev": "pnpm -F=tests-e2e site:dev",
73
+ "test:e2e:site:build": "pnpm -F=tests-e2e site:build",
74
+ "test:e2e:site:preview": "pnpm -F=tests-e2e site:preview",
75
+ "test:e2e-dev": "pnpm -F=tests-e2e test",
76
+ "test:e2e-dev:watch": "pnpm -F=tests-e2e watch",
77
+ "test:e2e-build": "VITE_TEST_BUILD=1 pnpm test:e2e-dev",
78
+ "test:e2e-build:watch": "VITE_TEST_BUILD=1 pnpm test:e2e-dev:watch",
79
+ "test:init": "pnpm -F=tests-init test",
80
+ "test:init:watch": "pnpm -F=tests-init watch",
81
+ "docs": "run-p dev docs:dev",
82
+ "docs:dev": "wait-on -d 100 dist/node/cli.js && pnpm -F=docs dev",
83
+ "docs:debug": "NODE_OPTIONS='--inspect-brk' pnpm docs:dev",
84
+ "docs:build": "run-s build docs:build:only",
85
+ "docs:build:only": "pnpm -F=docs build",
86
+ "docs:preview": "pnpm -F=docs preview",
87
+ "docs:lunaria:build": "pnpm -F=docs lunaria:build",
88
+ "docs:lunaria:open": "pnpm -F=docs lunaria:open",
89
+ "format": "prettier --check --write .",
90
+ "format:fail": "prettier --check .",
91
+ "check": "run-s format:fail build test",
92
+ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
93
+ "release": "node scripts/release.js"
94
+ },
95
+ "dependencies": {
96
+ "@docsearch/css": "^3.6.0",
97
+ "@docsearch/js": "^3.6.0",
98
+ "@shikijs/core": "^1.2.4",
99
+ "@shikijs/transformers": "^1.2.4",
100
+ "@types/markdown-it": "^13.0.7",
101
+ "@vitejs/plugin-vue": "^5.0.4",
102
+ "@vue/devtools-api": "^7.0.25",
103
+ "@vueuse/core": "^10.9.0",
104
+ "@vueuse/integrations": "^10.9.0",
105
+ "focus-trap": "^7.5.4",
106
+ "mark.js": "8.11.1",
107
+ "minisearch": "^6.3.0",
108
+ "shiki": "^1.2.4",
109
+ "vite": "^5.2.8",
110
+ "vue": "^3.4.21"
111
+ },
112
+ "peerDependencies": {
113
+ "markdown-it-mathjax3": "^4",
114
+ "postcss": "^8"
115
+ },
116
+ "peerDependenciesMeta": {
117
+ "markdown-it-mathjax3": {
118
+ "optional": true
119
+ },
120
+ "postcss": {
121
+ "optional": true
122
+ }
123
+ },
124
+ "devDependencies": {
125
+ "@clack/prompts": "^0.7.0",
126
+ "@mdit-vue/plugin-component": "2.0.0",
127
+ "@mdit-vue/plugin-frontmatter": "2.0.0",
128
+ "@mdit-vue/plugin-headers": "2.0.0",
129
+ "@mdit-vue/plugin-sfc": "2.0.0",
130
+ "@mdit-vue/plugin-title": "2.0.0",
131
+ "@mdit-vue/plugin-toc": "2.0.0",
132
+ "@mdit-vue/shared": "2.0.0",
133
+ "@polka/compression": "1.0.0-next.25",
134
+ "@rollup/plugin-alias": "^5.1.0",
135
+ "@rollup/plugin-commonjs": "^25.0.7",
136
+ "@rollup/plugin-json": "^6.1.0",
137
+ "@rollup/plugin-node-resolve": "^15.2.3",
138
+ "@rollup/plugin-replace": "^5.0.5",
139
+ "@types/cross-spawn": "^6.0.6",
140
+ "@types/debug": "^4.1.12",
141
+ "@types/escape-html": "^1.0.4",
142
+ "@types/fs-extra": "^11.0.4",
143
+ "@types/lodash.template": "^4.5.3",
144
+ "@types/mark.js": "^8.11.12",
145
+ "@types/markdown-it-attrs": "^4.1.3",
146
+ "@types/markdown-it-container": "^2.0.10",
147
+ "@types/markdown-it-emoji": "^2.0.5",
148
+ "@types/micromatch": "^4.0.6",
149
+ "@types/minimist": "^1.2.5",
150
+ "@types/node": "^20.12.6",
151
+ "@types/postcss-prefix-selector": "^1.16.3",
152
+ "@types/prompts": "^2.4.9",
153
+ "@vue/shared": "^3.4.21",
154
+ "chokidar": "^3.6.0",
155
+ "conventional-changelog-cli": "^4.1.0",
156
+ "cross-spawn": "^7.0.3",
157
+ "debug": "^4.3.4",
158
+ "esbuild": "^0.20.2",
159
+ "escape-html": "^1.0.3",
160
+ "execa": "^8.0.1",
161
+ "fast-glob": "^3.3.2",
162
+ "fs-extra": "^11.2.0",
163
+ "get-port": "^7.1.0",
164
+ "gray-matter": "^4.0.3",
165
+ "lint-staged": "^15.2.2",
166
+ "lodash.template": "^4.5.0",
167
+ "lru-cache": "^10.2.0",
168
+ "markdown-it": "^14.1.0",
169
+ "markdown-it-anchor": "^8.6.7",
170
+ "markdown-it-attrs": "^4.1.6",
171
+ "markdown-it-container": "^4.0.0",
172
+ "markdown-it-emoji": "^3.0.0",
173
+ "markdown-it-mathjax3": "^4.3.2",
174
+ "micromatch": "^4.0.5",
175
+ "minimist": "^1.2.8",
176
+ "nanoid": "^5.0.7",
177
+ "npm-run-all": "^4.1.5",
178
+ "ora": "^8.0.1",
179
+ "p-map": "^7.0.2",
180
+ "path-to-regexp": "^6.2.2",
181
+ "picocolors": "^1.0.0",
182
+ "pkg-dir": "^8.0.0",
183
+ "playwright-chromium": "^1.43.0",
184
+ "polka": "1.0.0-next.25",
185
+ "postcss-prefix-selector": "^1.16.0",
186
+ "prettier": "^3.2.5",
187
+ "prompts": "^2.4.2",
188
+ "punycode": "^2.3.1",
189
+ "rimraf": "^5.0.5",
190
+ "rollup": "^4.14.1",
191
+ "rollup-plugin-dts": "^6.1.0",
192
+ "rollup-plugin-esbuild": "^6.1.1",
193
+ "semver": "^7.6.0",
194
+ "simple-git-hooks": "^2.11.1",
195
+ "sirv": "^2.0.4",
196
+ "sitemap": "^7.1.1",
197
+ "supports-color": "^9.4.0",
198
+ "typescript": "^5.4.4",
199
+ "vitest": "^1.4.0",
200
+ "vue-tsc": "^2.0.11",
201
+ "wait-on": "^7.2.0"
202
+ },
203
+ "simple-git-hooks": {
204
+ "pre-commit": "pnpm lint-staged"
205
+ },
206
+ "lint-staged": {
207
+ "*": [
208
+ "prettier --write --ignore-unknown"
209
+ ]
210
+ },
211
+ "pnpm": {
212
+ "overrides": {
213
+ "ora>string-width": "^5"
214
+ },
215
+ "peerDependencyRules": {
216
+ "ignoreMissing": [
217
+ "@algolia/client-search",
218
+ "search-insights",
219
+ "postcss"
220
+ ]
221
+ }
222
+ }
223
+ }
@@ -0,0 +1,28 @@
1
+ import { defineConfig } from 'vitepress'
2
+
3
+ // https://vitepress.dev/reference/site-config
4
+ export default defineConfig({
5
+ title: <%= title %>,
6
+ description: <%= description %><% if (defaultTheme) { %>,
7
+ themeConfig: {
8
+ // https://vitepress.dev/reference/default-theme-config
9
+ nav: [
10
+ { text: 'Home', link: '/' },
11
+ { text: 'Examples', link: '/markdown-examples' }
12
+ ],
13
+
14
+ sidebar: [
15
+ {
16
+ text: 'Examples',
17
+ items: [
18
+ { text: 'Markdown Examples', link: '/markdown-examples' },
19
+ { text: 'Runtime API Examples', link: '/api-examples' }
20
+ ]
21
+ }
22
+ ],
23
+
24
+ socialLinks: [
25
+ { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
26
+ ]
27
+ }<% } %>
28
+ })
@@ -0,0 +1,21 @@
1
+ <script setup<%= useTs ? ' lang="ts"' : '' %>>
2
+ import { useData } from 'vitepress'
3
+
4
+ // https://vitepress.dev/reference/runtime-api#usedata
5
+ const { site, frontmatter } = useData()
6
+ </script>
7
+
8
+ <template>
9
+ <div v-if="frontmatter.home">
10
+ <h1>{{ site.title }}</h1>
11
+ <p>{{ site.description }}</p>
12
+ <ul>
13
+ <li><a href="/markdown-examples.html">Markdown Examples</a></li>
14
+ <li><a href="/api-examples.html">API Examples</a></li>
15
+ </ul>
16
+ </div>
17
+ <div v-else>
18
+ <a href="/">Home</a>
19
+ <Content />
20
+ </div>
21
+ </template>
@@ -0,0 +1,29 @@
1
+ // https://vitepress.dev/guide/custom-theme
2
+ <% if (!defaultTheme) { %>import Layout from './Layout.vue'<% if (useTs) { %>
3
+ import type { Theme } from 'vitepress'<% } %>
4
+ import './style.css'
5
+
6
+ <% if (!useTs) { %>/** @type {import('vitepress').Theme} */
7
+ <% } %>export default {
8
+ Layout,
9
+ enhanceApp({ app, router, siteData }) {
10
+ // ...
11
+ }
12
+ }<% if (useTs) { %> satisfies Theme<% } %>
13
+ <% } else { %>import { h } from 'vue'<% if (useTs) { %>
14
+ import type { Theme } from 'vitepress'<% } %>
15
+ import DefaultTheme from 'vitepress/theme'
16
+ import './style.css'
17
+
18
+ <% if (!useTs) { %>/** @type {import('vitepress').Theme} */
19
+ <% } %>export default {
20
+ extends: DefaultTheme,
21
+ Layout: () => {
22
+ return h(DefaultTheme.Layout, null, {
23
+ // https://vitepress.dev/guide/extending-default-theme#layout-slots
24
+ })
25
+ },
26
+ enhanceApp({ app, router, siteData }) {
27
+ // ...
28
+ }
29
+ }<% if (useTs) { %> satisfies Theme<% } %><% } %>
@@ -0,0 +1,143 @@
1
+ <% if (defaultTheme) { %>/**
2
+ * Customize default theme styling by overriding CSS variables:
3
+ * https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
4
+ */
5
+
6
+ /**
7
+ * Colors
8
+ *
9
+ * Each colors have exact same color scale system with 3 levels of solid
10
+ * colors with different brightness, and 1 soft color.
11
+ *
12
+ * - `XXX-1`: The most solid color used mainly for colored text. It must
13
+ * satisfy the contrast ratio against when used on top of `XXX-soft`.
14
+ *
15
+ * - `XXX-2`: The color used mainly for hover state of the button.
16
+ *
17
+ * - `XXX-3`: The color for solid background, such as bg color of the button.
18
+ * It must satisfy the contrast ratio with pure white (#ffffff) text on
19
+ * top of it.
20
+ *
21
+ * - `XXX-soft`: The color used for subtle background such as custom container
22
+ * or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
23
+ * on top of it.
24
+ *
25
+ * The soft color must be semi transparent alpha channel. This is crucial
26
+ * because it allows adding multiple "soft" colors on top of each other
27
+ * to create a accent, such as when having inline code block inside
28
+ * custom containers.
29
+ *
30
+ * - `default`: The color used purely for subtle indication without any
31
+ * special meanings attched to it such as bg color for menu hover state.
32
+ *
33
+ * - `brand`: Used for primary brand colors, such as link text, button with
34
+ * brand theme, etc.
35
+ *
36
+ * - `tip`: Used to indicate useful information. The default theme uses the
37
+ * brand color for this by default.
38
+ *
39
+ * - `warning`: Used to indicate warning to the users. Used in custom
40
+ * container, badges, etc.
41
+ *
42
+ * - `danger`: Used to show error, or dangerous message to the users. Used
43
+ * in custom container, badges, etc.
44
+ * -------------------------------------------------------------------------- */
45
+
46
+ :root {
47
+ --vp-c-default-1: var(--vp-c-gray-1);
48
+ --vp-c-default-2: var(--vp-c-gray-2);
49
+ --vp-c-default-3: var(--vp-c-gray-3);
50
+ --vp-c-default-soft: var(--vp-c-gray-soft);
51
+
52
+ --vp-c-brand-1: var(--vp-c-indigo-1);
53
+ --vp-c-brand-2: var(--vp-c-indigo-2);
54
+ --vp-c-brand-3: var(--vp-c-indigo-3);
55
+ --vp-c-brand-soft: var(--vp-c-indigo-soft);
56
+
57
+ --vp-c-tip-1: var(--vp-c-brand-1);
58
+ --vp-c-tip-2: var(--vp-c-brand-2);
59
+ --vp-c-tip-3: var(--vp-c-brand-3);
60
+ --vp-c-tip-soft: var(--vp-c-brand-soft);
61
+
62
+ --vp-c-warning-1: var(--vp-c-yellow-1);
63
+ --vp-c-warning-2: var(--vp-c-yellow-2);
64
+ --vp-c-warning-3: var(--vp-c-yellow-3);
65
+ --vp-c-warning-soft: var(--vp-c-yellow-soft);
66
+
67
+ --vp-c-danger-1: var(--vp-c-red-1);
68
+ --vp-c-danger-2: var(--vp-c-red-2);
69
+ --vp-c-danger-3: var(--vp-c-red-3);
70
+ --vp-c-danger-soft: var(--vp-c-red-soft);
71
+ }
72
+
73
+ /**
74
+ * Component: Button
75
+ * -------------------------------------------------------------------------- */
76
+
77
+ :root {
78
+ --vp-button-brand-border: transparent;
79
+ --vp-button-brand-text: var(--vp-c-white);
80
+ --vp-button-brand-bg: var(--vp-c-brand-3);
81
+ --vp-button-brand-hover-border: transparent;
82
+ --vp-button-brand-hover-text: var(--vp-c-white);
83
+ --vp-button-brand-hover-bg: var(--vp-c-brand-2);
84
+ --vp-button-brand-active-border: transparent;
85
+ --vp-button-brand-active-text: var(--vp-c-white);
86
+ --vp-button-brand-active-bg: var(--vp-c-brand-1);
87
+ }
88
+
89
+ /**
90
+ * Component: Home
91
+ * -------------------------------------------------------------------------- */
92
+
93
+ :root {
94
+ --vp-home-hero-name-color: transparent;
95
+ --vp-home-hero-name-background: -webkit-linear-gradient(
96
+ 120deg,
97
+ #bd34fe 30%,
98
+ #41d1ff
99
+ );
100
+
101
+ --vp-home-hero-image-background-image: linear-gradient(
102
+ -45deg,
103
+ #bd34fe 50%,
104
+ #47caff 50%
105
+ );
106
+ --vp-home-hero-image-filter: blur(44px);
107
+ }
108
+
109
+ @media (min-width: 640px) {
110
+ :root {
111
+ --vp-home-hero-image-filter: blur(56px);
112
+ }
113
+ }
114
+
115
+ @media (min-width: 960px) {
116
+ :root {
117
+ --vp-home-hero-image-filter: blur(68px);
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Component: Custom Block
123
+ * -------------------------------------------------------------------------- */
124
+
125
+ :root {
126
+ --vp-custom-block-tip-border: transparent;
127
+ --vp-custom-block-tip-text: var(--vp-c-text-1);
128
+ --vp-custom-block-tip-bg: var(--vp-c-brand-soft);
129
+ --vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
130
+ }
131
+
132
+ /**
133
+ * Component: Algolia
134
+ * -------------------------------------------------------------------------- */
135
+
136
+ .DocSearch {
137
+ --docsearch-primary-color: var(--vp-c-brand-1) !important;
138
+ }
139
+ <% } else { %>
140
+ html {
141
+ font-family: Arial, Helvetica;
142
+ }
143
+ <% } %>
@@ -0,0 +1,49 @@
1
+ ---
2
+ outline: deep
3
+ ---
4
+
5
+ # Runtime API Examples
6
+
7
+ This page demonstrates usage of some of the runtime APIs provided by VitePress.
8
+
9
+ The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
10
+
11
+ ```md
12
+ <script setup>
13
+ import { useData } from 'vitepress'
14
+
15
+ const { theme, page, frontmatter } = useData()
16
+ </script>
17
+
18
+ ## Results
19
+
20
+ ### Theme Data
21
+ <pre>{{ theme }}</pre>
22
+
23
+ ### Page Data
24
+ <pre>{{ page }}</pre>
25
+
26
+ ### Page Frontmatter
27
+ <pre>{{ frontmatter }}</pre>
28
+ ```
29
+
30
+ <script setup>
31
+ import { useData } from 'vitepress'
32
+
33
+ const { site, theme, page, frontmatter } = useData()
34
+ </script>
35
+
36
+ ## Results
37
+
38
+ ### Theme Data
39
+ <pre>{{ theme }}</pre>
40
+
41
+ ### Page Data
42
+ <pre>{{ page }}</pre>
43
+
44
+ ### Page Frontmatter
45
+ <pre>{{ frontmatter }}</pre>
46
+
47
+ ## More
48
+
49
+ Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
@@ -0,0 +1,28 @@
1
+ <% if (defaultTheme) { %>---
2
+ # https://vitepress.dev/reference/default-theme-home-page
3
+ layout: home
4
+
5
+ hero:
6
+ name: <%= title %>
7
+ text: <%= description %>
8
+ tagline: My great project tagline
9
+ actions:
10
+ - theme: brand
11
+ text: Markdown Examples
12
+ link: /markdown-examples
13
+ - theme: alt
14
+ text: API Examples
15
+ link: /api-examples
16
+
17
+ features:
18
+ - title: Feature A
19
+ details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
20
+ - title: Feature B
21
+ details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
22
+ - title: Feature C
23
+ details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
24
+ ---
25
+ <% } else { %>---
26
+ home: true
27
+ ---
28
+ <% } %>
@@ -0,0 +1,85 @@
1
+ # Markdown Extension Examples
2
+
3
+ This page demonstrates some of the built-in markdown extensions provided by VitePress.
4
+
5
+ ## Syntax Highlighting
6
+
7
+ VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
8
+
9
+ **Input**
10
+
11
+ ````md
12
+ ```js{4}
13
+ export default {
14
+ data () {
15
+ return {
16
+ msg: 'Highlighted!'
17
+ }
18
+ }
19
+ }
20
+ ```
21
+ ````
22
+
23
+ **Output**
24
+
25
+ ```js{4}
26
+ export default {
27
+ data () {
28
+ return {
29
+ msg: 'Highlighted!'
30
+ }
31
+ }
32
+ }
33
+ ```
34
+
35
+ ## Custom Containers
36
+
37
+ **Input**
38
+
39
+ ```md
40
+ ::: info
41
+ This is an info box.
42
+ :::
43
+
44
+ ::: tip
45
+ This is a tip.
46
+ :::
47
+
48
+ ::: warning
49
+ This is a warning.
50
+ :::
51
+
52
+ ::: danger
53
+ This is a dangerous warning.
54
+ :::
55
+
56
+ ::: details
57
+ This is a details block.
58
+ :::
59
+ ```
60
+
61
+ **Output**
62
+
63
+ ::: info
64
+ This is an info box.
65
+ :::
66
+
67
+ ::: tip
68
+ This is a tip.
69
+ :::
70
+
71
+ ::: warning
72
+ This is a warning.
73
+ :::
74
+
75
+ ::: danger
76
+ This is a dangerous warning.
77
+ :::
78
+
79
+ ::: details
80
+ This is a details block.
81
+ :::
82
+
83
+ ## More
84
+
85
+ Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).
@@ -0,0 +1,2 @@
1
+ export * from './theme.js'
2
+ export { default } from './theme.js'
package/theme.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ // so that users can do `import DefaultTheme from 'vitepress/theme'`
2
+
3
+ import type { DefineComponent } from 'vue'
4
+ import type { EnhanceAppContext } from './dist/client/index.js'
5
+ import type { DefaultTheme } from './types/default-theme.js'
6
+
7
+ export type { DefaultTheme } from './types/default-theme.js'
8
+
9
+ declare const theme: {
10
+ Layout: DefineComponent
11
+ enhanceApp: (ctx: EnhanceAppContext) => void
12
+ }
13
+
14
+ export default theme
15
+ export declare const useSidebar: () => DefaultTheme.DocSidebar
16
+ export declare const useLocalNav: () => DefaultTheme.DocLocalNav
17
+
18
+ // TODO: add props for these
19
+ export declare const VPBadge: DefineComponent
20
+ export declare const VPButton: DefineComponent
21
+ export declare const VPDocAsideSponsors: DefineComponent
22
+ export declare const VPHomeFeatures: DefineComponent
23
+ export declare const VPHomeHero: DefineComponent
24
+ export declare const VPHomeSponsors: DefineComponent
25
+ export declare const VPImage: DefineComponent
26
+ export declare const VPSponsors: DefineComponent
27
+ export declare const VPTeamMembers: DefineComponent
28
+ export declare const VPTeamPage: DefineComponent
29
+ export declare const VPTeamPageSection: DefineComponent
30
+ export declare const VPTeamPageTitle: DefineComponent