create-vuepress-theme-hope 2.0.0-beta.96 → 2.0.0-beta.99
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/lib/index.js +1 -1
- package/package.json +2 -2
- package/template/en-US/.vuepress/theme.ts +36 -1
- package/template/en-US/guide/markdown.md +52 -49
- package/template/i18n/.vuepress/theme.ts +38 -3
- package/template/i18n/guide/markdown.md +52 -51
- package/template/i18n/zh/guide/markdown.md +50 -49
- package/template/zh-CN/.vuepress/theme.ts +36 -1
- package/template/zh-CN/guide/markdown.md +50 -49
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{cac as e}from"cac";import{execaCommandSync as s,execaCommand as n}from"execa";import t from"inquirer";import{readdirSync as r,mkdirSync as a,statSync as o,createReadStream as i,createWriteStream as c,writeFileSync as p,existsSync as l,readFileSync as u}from"node:fs";import{dirname as
|
|
2
|
+
import{cac as e}from"cac";import{execaCommandSync as s,execaCommand as n}from"execa";import t from"inquirer";import{readdirSync as r,mkdirSync as a,statSync as o,createReadStream as i,createWriteStream as c,writeFileSync as p,existsSync as l,readFileSync as u}from"node:fs";import{dirname as m,resolve as g,join as d}from"node:path";import{fileURLToPath as h}from"node:url";import"node:https";import{createRequire as v}from"node:module";const y={"简体中文":{getVersion:"获取依赖的最新版本...",createPackage:"生成 package.json...",updatePackage:"更新 package.json...",template:"生成模板...",wait:"这可能需要数分钟,请耐心等待.\n我们无法正确输出子进程的进度条,所以进程可能会看似未响应",install:"安装依赖...",success:"模板已成功生成!",devServerAsk:"是否想要现在启动 Demo 查看?",devServer:"启动开发服务器...\n启动成功后,请在浏览器输入给出的开发服务器地址(默认为 'localhost:8080')",nameMessage:"设置应用名称",nameError:"应用名称应只包含小写字母、数字和连接线 (-)",versionMessage:"设置应用版本号",versionError:"此版本无效,版本号应为 'x.x.x'",descriptionMessage:"设置应用描述",licenseMessage:"设置协议",i18nMessage:"项目需要用到多语言么?",gitMessage:"是否初始化 Git 仓库?",workflowMessage:"是否需要一个自动部署文档到 GitHub Pages 的工作流?",packageManager:"选择包管理器",hint:e=>`提示: 请使用 "${e} run docs:dev" 命令启动开发服务器`,dirError:e=>`"[dir]" 的方括号表示此处为一个参数,你应该替换为自己想使用的文件夹名称,如 "src", "docs" 等!\n例如: "${e} init vuepress-theme-hope@next docs"`},"english (US)":{getVersion:"Getting lastest version of deps...",createPackage:"Generating package.json...",updatePackage:"Updating package.json...",template:"Generating Template...",wait:"This may take a few minutes, please be patient.\nWe can not correctly output progress bar from child process, so the process may look stuck.",install:"Installing Deps...",success:"Successful Generated!",devServerAsk:"Would you like to preview template now?",devServer:"Staring dev server...\nAfter the dev server starts running, please visit the given server link ('localhost:8080' by default)",nameMessage:"Your project name",nameError:"package name should only contain lowercase characters, numbers and dash",versionMessage:"Your project version",versionError:"This version is not a valid one. Version should be like 'x.x.x'",descriptionMessage:"Your project description",licenseMessage:"Your project lincense",i18nMessage:"Does the project need multiple languages?",gitMessage:"Initialize a git repository?",workflowMessage:"Do you need a GitHub workflow to deploy docs on GitHub pages?",packageManager:"Choose package manager",hint:e=>`Hint: You should execute "${e} run docs:dev" to start dev server.`,dirError:e=>`The brackets in "[dir]" means it is an argument, you should replace it with folder name you want to use! E.g.: "src", "docs"\nFor example: "${e} init vuepress-theme-hope@next docs"`}},f=(e,...s)=>{if(0===s.length)return e;const n=s.shift()||{};return Object.keys(n).forEach((s=>{"object"!=typeof e[s]||Array.isArray(e[s])||"object"!=typeof n[s]||Array.isArray(n[s])?"object"==typeof n[s]?Array.isArray(n[s])?e[s]=[...n[s]]:e[s]={...n[s]}:e[s]=n[s]:f(e[s],n[s])})),f(e,...s)},w=e=>{try{r(e)}catch(s){a(e,{recursive:!0})}},$=(e,s)=>{const n=m(s);w(n);const t=i(e),r=c(s);t.pipe(r)},k=(e,s)=>{w(s);r(e,{withFileTypes:!0}).forEach((n=>{n.isFile()?$(`${e}/${n.name}`,`${s}/${n.name}`):n.isDirectory()&&k(`${e}/${n.name}`,`${s}/${n.name}`)}))},b=["npm"];(()=>{try{return 0===s("yarn --version",{stdio:"ignore"}).exitCode}catch(e){return!1}})()&&b.push("yarn"),(()=>{try{return 0===s("pnpm --version",{stdio:"ignore"}).exitCode}catch(e){return!1}})()&&b.push("pnpm");const M=h(import.meta.url),j=m(M),x=e=>{const s=g(process.cwd(),".gitignore"),n=l(s)?u(s,{encoding:"utf-8"}):"";p(s,`${n}${(e=>`\nnode_modules/\n${e}/.vuepress/.cache/\n${e}/.vuepress/.temp/\n${e}/.vuepress/dist/\n`)(e)}`,{encoding:"utf-8"})},S=async(e,n,r,a)=>{const{i18n:i,workflow:c}=await t.prompt([{name:"i18n",type:"confirm",message:a.i18nMessage,default:!1},{name:"workflow",type:"confirm",message:a.workflowMessage,default:!0}]);console.log(a.template);var l,u;if(l=g(j,"../template",i?"i18n":"简体中文"===r?"zh-CN":"en-US"),u=g(process.cwd(),n),o(l).isDirectory()?k(l,u):o(l).isFile()&&$(l,u),c){const s=g(process.cwd(),".github/workflows");w(s),p(g(s,"deploy-docs.yml"),((e,s,n)=>`\nname: ${"简体中文"===n?"部署文档":"Deploy Docs"}\n\non:\n push:\n branches:\n # ${"简体中文"===n?"确保这是你正在使用的分支名称":"make sure this is the branch you are using"}\n - main\n\njobs:\n deploy-gh-pages:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout\n uses: actions/checkout@v3\n with:\n fetch-depth: 0\n # ${"简体中文"===n?"如果你文档需要 Git 子模块,取消注释下一行":"if your docs needs submodules, uncomment the following line"}\n # submodules: true\n\n${"pnpm"===e?`\n - name: ${"简体中文"===n?"安装 pnpm":"Install pnpm"}\n uses: pnpm/action-setup@v2\n with:\n version: 7\n run_install: true\n`:""}\n\n - name: ${"简体中文"===n?"设置 Node.js":"Setup Node.js"}\n uses: actions/setup-node@v3\n with:\n node-version: 16\n cache: ${e}\n\n - name: ${"简体中文"===n?"安装依赖":"Install Deps"}\n run: ${"npm"===e?"npm install":`${e} install --frozen-lockfile`}\n\n - name: ${"简体中文"===n?"构建文档":"Build Docs"}\n env:\n NODE_OPTIONS: --max_old_space_size=8192\n run: |-\n ${e} run docs:build\n > ${d(s,".vuepress/dist/.nojekyll").replace(/\\/g,"/")}\n\n - name: ${"简体中文"===n?"部署文档":"Deploy Docs"}\n uses: JamesIves/github-pages-deploy-action@v4\n with:\n # ${"简体中文"===n?"这是文档部署到的分支名称":"This is the branch where the docs are deployed to"}\n branch: gh-pages\n folder: ${d(s,".vuepress/dist").replace(/\\/g,"/")}\n\n`)(e,n,r),{encoding:"utf-8"})}if((()=>{try{return s("git log"),!0}catch{return!1}})())x(n);else if((()=>{try{return s("git log"),!0}catch{return!1}})()){const{git:e}=await t.prompt([{name:"git",type:"confirm",message:a.gitMessage,default:!0}]);e&&(s("git init"),x(n))}},D=v(import.meta.url)("create-vuepress-theme-hope/package.json").version,E=async(e,n)=>{const r=(e=>s(`${e} config get registry`).stdout)(e);if("简体中文"===n){const{registry:e}=await t.prompt([{name:"registry",type:"list",message:"选择你想使用的源",choices:["国内镜像源","当前源"]}]);return"国内镜像源"===e?"https://registry.npmmirror.com/":r}return r},A=e("vuepress-theme-hope");A.command("[dir]","Generate a new vuepress-theme-hope project").usage("pnpm create vuepress-theme-hope@next [dir] / npm init vuepress-theme-hope@next [dir]").example("docs").action((async e=>{if(!e)return A.outputHelp();const{lang:r,message:a}=await(async()=>{const{language:e}=await t.prompt([{name:"language",type:"list",message:"Select a language to display / 选择显示语言",choices:["english (US)","简体中文"]}]);return{lang:e,message:y[e]}})(),o=await(async e=>(await t.prompt([{name:"packageManager",type:"list",message:e,choices:b}])).packageManager)(a.packageManager);if(e.startsWith("[")&&e.endsWith("]"))return console.log(a.dirError(o));console.log(a.getVersion),await(async(e,s)=>{const n=g(process.cwd(),"package.json"),r=(e=>({"docs:build":`vuepress build ${e}`,"docs:clean-dev":`vuepress dev ${e} --clean-cache`,"docs:dev":`vuepress dev ${e}`}))(e),a={"@vuepress/client":"2.0.0-beta.51",vue:"^3.2.27",vuepress:"2.0.0-beta.51","vuepress-theme-hope":D};if(l(n)){console.log(s.updatePackage);const e=JSON.parse(u(n,{encoding:"utf-8"}));f(e,{scripts:r,devDependencies:a}),p(n,`${JSON.stringify(e,null,2)}\n`,{encoding:"utf-8"})}else{console.log(s.createPackage);const e={...await t.prompt([{name:"name",type:"input",message:s.nameMessage,default:"vuepress-theme-hope-template",validate:e=>!!/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/u.exec(e)||s.nameError},{name:"version",type:"input",message:s.versionMessage,default:"2.0.0",validate:e=>!!/^[0-9]+\.[0-9]+\.(?:[0=9]+|[0-9]+-[a-z]+\.[0-9])$/u.exec(e)||s.versionError},{name:"description",type:"input",message:s.descriptionMessage,default:"A project of vuepress-theme-hope"},{name:"license",type:"input",message:s.licenseMessage,default:"MIT"}]),type:"module",scripts:r,devDependencies:a};p(n,`${JSON.stringify(e,null,2)}\n`,{encoding:"utf-8"})}})(e,a),await S(o,e,r,a);const i="pnpm"===o?"":await E(o,r);console.log(a.install),console.warn(a.wait),s(`${o} install ${i?"":`--registry ${i}`}`,{stdout:"inherit"}),console.log(a.success);const{choice:c}=await t.prompt([{name:"choice",type:"confirm",message:a.devServerAsk,default:!0}]);c?(console.log(a.devServer),await n(`${o} run docs:dev`,{stdout:"inherit"})):console.log(a.hint(o))})),A.help((()=>[{title:"pnpm create vuepress-theme-hope@next [dir] / npm init vuepress-theme-hope@next [dir]",body:"Create a vuepress-theme-hope template in [dir]"}])),A.version(D),A.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vuepress-theme-hope",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.99",
|
|
4
4
|
"description": "Create vuepress-theme-hope demo project helper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"create",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"cac": "6.7.14",
|
|
40
40
|
"execa": "6.1.0",
|
|
41
|
-
"inquirer": "9.1.
|
|
41
|
+
"inquirer": "9.1.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/inquirer": "9.0.1",
|
|
@@ -104,10 +104,45 @@ export default hopeTheme({
|
|
|
104
104
|
},
|
|
105
105
|
|
|
106
106
|
mdEnhance: {
|
|
107
|
-
|
|
107
|
+
align: true,
|
|
108
|
+
attrs: true,
|
|
109
|
+
chart: true,
|
|
110
|
+
codetabs: true,
|
|
111
|
+
container: true,
|
|
112
|
+
demo: true,
|
|
113
|
+
echarts: true,
|
|
114
|
+
flowchart: true,
|
|
115
|
+
gfm: true,
|
|
116
|
+
imageSize: true,
|
|
117
|
+
include: true,
|
|
118
|
+
lazyLoad: true,
|
|
119
|
+
mark: true,
|
|
120
|
+
mermaid: true,
|
|
121
|
+
playground: {
|
|
122
|
+
presets: ["ts", "vue"],
|
|
123
|
+
},
|
|
108
124
|
presentation: {
|
|
109
125
|
plugins: ["highlight", "math", "search", "notes", "zoom"],
|
|
110
126
|
},
|
|
127
|
+
stylize: [
|
|
128
|
+
{
|
|
129
|
+
matcher: "Recommanded",
|
|
130
|
+
replacer: ({ tag }) => {
|
|
131
|
+
if (tag === "em")
|
|
132
|
+
return {
|
|
133
|
+
tag: "Badge",
|
|
134
|
+
attrs: { type: "tip" },
|
|
135
|
+
content: "Recommanded",
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
sub: true,
|
|
141
|
+
sup: true,
|
|
142
|
+
tabs: true,
|
|
143
|
+
tex: true,
|
|
144
|
+
vpre: true,
|
|
145
|
+
vuePlayground: true,
|
|
111
146
|
},
|
|
112
147
|
},
|
|
113
148
|
});
|
|
@@ -42,48 +42,6 @@ For these extensions, please read [Markdown extensions in VuePress](https://vuep
|
|
|
42
42
|
|
|
43
43
|
By using [`vuepress-plugin-md-enhance`][md-enhance], the theme extends more Markdown syntax and provides richer writing functions.
|
|
44
44
|
|
|
45
|
-
:::: tip Enable all
|
|
46
|
-
|
|
47
|
-
You can set `plugins.mdEnhance.enableAll: true` in theme options to enable all features of the [md-enhance][md-enhance] plugin.
|
|
48
|
-
|
|
49
|
-
::: code-tabs#language
|
|
50
|
-
|
|
51
|
-
@tab TS
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
import { hopeTheme } from "vuepress-theme-hope";
|
|
55
|
-
|
|
56
|
-
export default {
|
|
57
|
-
theme: hopeTheme({
|
|
58
|
-
plugins: {
|
|
59
|
-
mdEnhance: {
|
|
60
|
-
enableAll: true,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
}),
|
|
64
|
-
};
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
@tab JS
|
|
68
|
-
|
|
69
|
-
```js
|
|
70
|
-
import { hopeTheme } from "vuepress-theme-hope";
|
|
71
|
-
|
|
72
|
-
export default {
|
|
73
|
-
theme: hopeTheme({
|
|
74
|
-
plugins: {
|
|
75
|
-
mdEnhance: {
|
|
76
|
-
enableAll: true,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
}),
|
|
80
|
-
};
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
:::
|
|
84
|
-
|
|
85
|
-
::::
|
|
86
|
-
|
|
87
45
|
#### Custom Container
|
|
88
46
|
|
|
89
47
|
::: v-pre
|
|
@@ -170,7 +128,7 @@ A custom details container
|
|
|
170
128
|
|
|
171
129
|
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/container.html)
|
|
172
130
|
|
|
173
|
-
|
|
131
|
+
#### Tabs
|
|
174
132
|
|
|
175
133
|
::: tabs#fruit
|
|
176
134
|
|
|
@@ -192,7 +150,7 @@ Orange
|
|
|
192
150
|
|
|
193
151
|
#### Code Tabs
|
|
194
152
|
|
|
195
|
-
::: code-tabs
|
|
153
|
+
::: code-tabs#shell
|
|
196
154
|
|
|
197
155
|
@tab pnpm
|
|
198
156
|
|
|
@@ -238,6 +196,12 @@ I am right align
|
|
|
238
196
|
|
|
239
197
|
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/align.html)
|
|
240
198
|
|
|
199
|
+
#### Attrs
|
|
200
|
+
|
|
201
|
+
A **word**{#word} having id.
|
|
202
|
+
|
|
203
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/attrs.html)
|
|
204
|
+
|
|
241
205
|
#### Footnote
|
|
242
206
|
|
|
243
207
|
This text has footnote[^first].
|
|
@@ -263,7 +227,7 @@ You can mark ==important words== .
|
|
|
263
227
|
|
|
264
228
|
Support setting color scheme and size
|
|
265
229
|
|
|
266
|
-
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/image.
|
|
230
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/image.html)
|
|
267
231
|
|
|
268
232
|
#### Chart
|
|
269
233
|
|
|
@@ -374,7 +338,7 @@ $$
|
|
|
374
338
|
|
|
375
339
|
@include(./README.md{11-17})
|
|
376
340
|
|
|
377
|
-
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/include.
|
|
341
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/include.html)
|
|
378
342
|
|
|
379
343
|
#### Code Demo
|
|
380
344
|
|
|
@@ -403,11 +367,50 @@ span {
|
|
|
403
367
|
|
|
404
368
|
#### Stylize
|
|
405
369
|
|
|
406
|
-
|
|
370
|
+
Donate Mr.Hope a cup of coffee. _Recommanded_
|
|
371
|
+
|
|
372
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/stylize.html)
|
|
407
373
|
|
|
408
|
-
|
|
374
|
+
#### Playground
|
|
375
|
+
|
|
376
|
+
::: playground#ts TS demo
|
|
377
|
+
|
|
378
|
+
@file index.ts
|
|
379
|
+
|
|
380
|
+
```ts
|
|
381
|
+
const msg = "hello world";
|
|
382
|
+
|
|
383
|
+
const speak = (msg: string) => console.log(msg);
|
|
384
|
+
|
|
385
|
+
speak(msg);
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
:::
|
|
389
|
+
|
|
390
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/playground.html)
|
|
391
|
+
|
|
392
|
+
#### Vue Playground
|
|
393
|
+
|
|
394
|
+
::: vue-playground Vue Playground
|
|
395
|
+
|
|
396
|
+
@file App.vue
|
|
397
|
+
|
|
398
|
+
```vue
|
|
399
|
+
<script setup>
|
|
400
|
+
import { ref } from "vue";
|
|
401
|
+
|
|
402
|
+
const msg = ref("Hello World!");
|
|
403
|
+
</script>
|
|
404
|
+
|
|
405
|
+
<template>
|
|
406
|
+
<h1>{{ msg }}</h1>
|
|
407
|
+
<input v-model="msg" />
|
|
408
|
+
</template>
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
:::
|
|
409
412
|
|
|
410
|
-
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/
|
|
413
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/vue-playground.html)
|
|
411
414
|
|
|
412
415
|
#### Presentation
|
|
413
416
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hopeTheme } from "vuepress-theme-hope";
|
|
2
|
-
import * as navbar from "./navbar.js";
|
|
3
|
-
import * as sidebar from "./sidebar.js";
|
|
2
|
+
import * as navbar from "./navbar/index.js";
|
|
3
|
+
import * as sidebar from "./sidebar/index.js";
|
|
4
4
|
|
|
5
5
|
export default hopeTheme({
|
|
6
6
|
hostname: "https://vuepress-theme-hope-v2-demo.mrhope.site",
|
|
@@ -132,10 +132,45 @@ export default hopeTheme({
|
|
|
132
132
|
},
|
|
133
133
|
|
|
134
134
|
mdEnhance: {
|
|
135
|
-
|
|
135
|
+
align: true,
|
|
136
|
+
attrs: true,
|
|
137
|
+
chart: true,
|
|
138
|
+
codetabs: true,
|
|
139
|
+
container: true,
|
|
140
|
+
demo: true,
|
|
141
|
+
echarts: true,
|
|
142
|
+
flowchart: true,
|
|
143
|
+
gfm: true,
|
|
144
|
+
imageSize: true,
|
|
145
|
+
include: true,
|
|
146
|
+
lazyLoad: true,
|
|
147
|
+
mark: true,
|
|
148
|
+
mermaid: true,
|
|
149
|
+
playground: {
|
|
150
|
+
presets: ["ts", "vue"],
|
|
151
|
+
},
|
|
136
152
|
presentation: {
|
|
137
153
|
plugins: ["highlight", "math", "search", "notes", "zoom"],
|
|
138
154
|
},
|
|
155
|
+
stylize: [
|
|
156
|
+
{
|
|
157
|
+
matcher: "Recommanded",
|
|
158
|
+
replacer: ({ tag }) => {
|
|
159
|
+
if (tag === "em")
|
|
160
|
+
return {
|
|
161
|
+
tag: "Badge",
|
|
162
|
+
attrs: { type: "tip" },
|
|
163
|
+
content: "Recommanded",
|
|
164
|
+
};
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
sub: true,
|
|
169
|
+
sup: true,
|
|
170
|
+
tabs: true,
|
|
171
|
+
tex: true,
|
|
172
|
+
vpre: true,
|
|
173
|
+
vuePlayground: true,
|
|
139
174
|
},
|
|
140
175
|
},
|
|
141
176
|
});
|
|
@@ -42,48 +42,6 @@ For these extensions, please read [Markdown extensions in VuePress](https://vuep
|
|
|
42
42
|
|
|
43
43
|
By using [`vuepress-plugin-md-enhance`][md-enhance], the theme extends more Markdown syntax and provides richer writing functions.
|
|
44
44
|
|
|
45
|
-
:::: tip Enable all
|
|
46
|
-
|
|
47
|
-
You can set `plugins.mdEnhance.enableAll: true` in theme options to enable all features of the [md-enhance][md-enhance] plugin.
|
|
48
|
-
|
|
49
|
-
::: code-tabs#language
|
|
50
|
-
|
|
51
|
-
@tab TS
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
import { hopeTheme } from "vuepress-theme-hope";
|
|
55
|
-
|
|
56
|
-
export default {
|
|
57
|
-
theme: hopeTheme({
|
|
58
|
-
plugins: {
|
|
59
|
-
mdEnhance: {
|
|
60
|
-
enableAll: true,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
}),
|
|
64
|
-
};
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
@tab JS
|
|
68
|
-
|
|
69
|
-
```js
|
|
70
|
-
import { hopeTheme } from "vuepress-theme-hope";
|
|
71
|
-
|
|
72
|
-
export default {
|
|
73
|
-
theme: hopeTheme({
|
|
74
|
-
plugins: {
|
|
75
|
-
mdEnhance: {
|
|
76
|
-
enableAll: true,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
}),
|
|
80
|
-
};
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
:::
|
|
84
|
-
|
|
85
|
-
::::
|
|
86
|
-
|
|
87
45
|
#### Custom Container
|
|
88
46
|
|
|
89
47
|
::: v-pre
|
|
@@ -170,7 +128,7 @@ A custom details container
|
|
|
170
128
|
|
|
171
129
|
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/container.html)
|
|
172
130
|
|
|
173
|
-
|
|
131
|
+
#### Tabs
|
|
174
132
|
|
|
175
133
|
::: tabs#fruit
|
|
176
134
|
|
|
@@ -192,7 +150,7 @@ Orange
|
|
|
192
150
|
|
|
193
151
|
#### Code Tabs
|
|
194
152
|
|
|
195
|
-
::: code-tabs
|
|
153
|
+
::: code-tabs#shell
|
|
196
154
|
|
|
197
155
|
@tab pnpm
|
|
198
156
|
|
|
@@ -238,6 +196,12 @@ I am right align
|
|
|
238
196
|
|
|
239
197
|
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/align.html)
|
|
240
198
|
|
|
199
|
+
#### Attrs
|
|
200
|
+
|
|
201
|
+
A **word**{#word} having id.
|
|
202
|
+
|
|
203
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/attrs.html)
|
|
204
|
+
|
|
241
205
|
#### Footnote
|
|
242
206
|
|
|
243
207
|
This text has footnote[^first].
|
|
@@ -263,7 +227,7 @@ You can mark ==important words== .
|
|
|
263
227
|
|
|
264
228
|
Support setting color scheme and size
|
|
265
229
|
|
|
266
|
-
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/image.
|
|
230
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/image.html)
|
|
267
231
|
|
|
268
232
|
#### Chart
|
|
269
233
|
|
|
@@ -370,11 +334,11 @@ $$
|
|
|
370
334
|
|
|
371
335
|
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/tex.html)
|
|
372
336
|
|
|
373
|
-
|
|
337
|
+
#### Include files
|
|
374
338
|
|
|
375
339
|
@include(./README.md{11-17})
|
|
376
340
|
|
|
377
|
-
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/include.
|
|
341
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/include.html)
|
|
378
342
|
|
|
379
343
|
#### Code Demo
|
|
380
344
|
|
|
@@ -403,13 +367,50 @@ span {
|
|
|
403
367
|
|
|
404
368
|
#### Stylize
|
|
405
369
|
|
|
406
|
-
|
|
370
|
+
Donate Mr.Hope a cup of coffee. _Recommanded_
|
|
371
|
+
|
|
372
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/stylize.html)
|
|
407
373
|
|
|
408
|
-
|
|
374
|
+
#### Playground
|
|
409
375
|
|
|
410
|
-
|
|
376
|
+
::: playground#ts TS demo
|
|
377
|
+
|
|
378
|
+
@file index.ts
|
|
379
|
+
|
|
380
|
+
```ts
|
|
381
|
+
const msg = "hello world";
|
|
382
|
+
|
|
383
|
+
const speak = (msg: string) => console.log(msg);
|
|
384
|
+
|
|
385
|
+
speak(msg);
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
:::
|
|
389
|
+
|
|
390
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/playground.html)
|
|
391
|
+
|
|
392
|
+
#### Vue Playground
|
|
393
|
+
|
|
394
|
+
::: vue-playground Vue Playground
|
|
395
|
+
|
|
396
|
+
@file App.vue
|
|
397
|
+
|
|
398
|
+
```vue
|
|
399
|
+
<script setup>
|
|
400
|
+
import { ref } from "vue";
|
|
401
|
+
|
|
402
|
+
const msg = ref("Hello World!");
|
|
403
|
+
</script>
|
|
404
|
+
|
|
405
|
+
<template>
|
|
406
|
+
<h1>{{ msg }}</h1>
|
|
407
|
+
<input v-model="msg" />
|
|
408
|
+
</template>
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
:::
|
|
411
412
|
|
|
412
|
-
|
|
413
|
+
- [View Detail](https://vuepress-theme-hope.github.io/v2/guide/markdown/vue-playground.html)
|
|
413
414
|
|
|
414
415
|
#### Presentation
|
|
415
416
|
|
|
@@ -42,48 +42,6 @@ VuePress 会使用 [markdown-it](https://github.com/markdown-it/markdown-it) 来
|
|
|
42
42
|
|
|
43
43
|
通过 [`vuepress-plugin-md-enhance`][md-enhance],主题扩展了更多 Markdown 语法,提供更加丰富的写作功能。
|
|
44
44
|
|
|
45
|
-
:::: tip 一键启用
|
|
46
|
-
|
|
47
|
-
你可以设置在主题选项中设置 `plugins.mdEnhance.enableAll: true` 启用 [md-enhance][md-enhance] 插件的所有功能。
|
|
48
|
-
|
|
49
|
-
::: code-tabs#language
|
|
50
|
-
|
|
51
|
-
@tab TS
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
import { hopeTheme } from "vuepress-theme-hope";
|
|
55
|
-
|
|
56
|
-
export default {
|
|
57
|
-
theme: hopeTheme({
|
|
58
|
-
plugins: {
|
|
59
|
-
mdEnhance: {
|
|
60
|
-
enableAll: true,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
}),
|
|
64
|
-
};
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
@tab JS
|
|
68
|
-
|
|
69
|
-
```js
|
|
70
|
-
import { hopeTheme } from "vuepress-theme-hope";
|
|
71
|
-
|
|
72
|
-
export default {
|
|
73
|
-
theme: hopeTheme({
|
|
74
|
-
plugins: {
|
|
75
|
-
mdEnhance: {
|
|
76
|
-
enableAll: true,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
}),
|
|
80
|
-
};
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
:::
|
|
84
|
-
|
|
85
|
-
::::
|
|
86
|
-
|
|
87
45
|
#### 自定义容器
|
|
88
46
|
|
|
89
47
|
::: v-pre
|
|
@@ -196,6 +154,12 @@ npm i -D vuepress-theme-hope
|
|
|
196
154
|
|
|
197
155
|
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/code-tabs.html)
|
|
198
156
|
|
|
157
|
+
#### 上下角标
|
|
158
|
+
|
|
159
|
+
19^th^ H~2~O
|
|
160
|
+
|
|
161
|
+
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/sup-sub.html)
|
|
162
|
+
|
|
199
163
|
#### 自定义对齐
|
|
200
164
|
|
|
201
165
|
::: center
|
|
@@ -212,11 +176,11 @@ npm i -D vuepress-theme-hope
|
|
|
212
176
|
|
|
213
177
|
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/align.html)
|
|
214
178
|
|
|
215
|
-
####
|
|
179
|
+
#### Attrs
|
|
216
180
|
|
|
217
|
-
|
|
181
|
+
一个拥有 ID 的 **单次**{#word}。
|
|
218
182
|
|
|
219
|
-
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/
|
|
183
|
+
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/attrs.html)
|
|
220
184
|
|
|
221
185
|
#### 脚注
|
|
222
186
|
|
|
@@ -383,13 +347,50 @@ span {
|
|
|
383
347
|
|
|
384
348
|
#### 样式化
|
|
385
349
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
设置它<span style="color:red">没有</span>任何效果,请<span style="color:red">不要</span>这样使用
|
|
350
|
+
向 Mr.Hope 捐赠一杯咖啡。 _Recommanded_
|
|
389
351
|
|
|
390
352
|
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/stylize.html)
|
|
391
353
|
|
|
392
|
-
|
|
354
|
+
#### 交互演示
|
|
355
|
+
|
|
356
|
+
::: playground#ts TS 案例
|
|
357
|
+
|
|
358
|
+
@file index.ts
|
|
359
|
+
|
|
360
|
+
```ts
|
|
361
|
+
const msg = "hello world";
|
|
362
|
+
|
|
363
|
+
const speak = (msg: string) => console.log(msg);
|
|
364
|
+
|
|
365
|
+
speak(msg);
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
:::
|
|
369
|
+
|
|
370
|
+
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/playground.html)
|
|
371
|
+
|
|
372
|
+
#### Vue 交互演示
|
|
373
|
+
|
|
374
|
+
::: vue-playground Vue 交互演示
|
|
375
|
+
|
|
376
|
+
@file App.vue
|
|
377
|
+
|
|
378
|
+
```vue
|
|
379
|
+
<script setup>
|
|
380
|
+
import { ref } from "vue";
|
|
381
|
+
|
|
382
|
+
const msg = ref("Hello World!");
|
|
383
|
+
</script>
|
|
384
|
+
|
|
385
|
+
<template>
|
|
386
|
+
<h1>{{ msg }}</h1>
|
|
387
|
+
<input v-model="msg" />
|
|
388
|
+
</template>
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
:::
|
|
392
|
+
|
|
393
|
+
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/vue-playground.html)
|
|
393
394
|
|
|
394
395
|
#### 幻灯片
|
|
395
396
|
|
|
@@ -104,10 +104,45 @@ export default hopeTheme({
|
|
|
104
104
|
},
|
|
105
105
|
|
|
106
106
|
mdEnhance: {
|
|
107
|
-
|
|
107
|
+
align: true,
|
|
108
|
+
attrs: true,
|
|
109
|
+
chart: true,
|
|
110
|
+
codetabs: true,
|
|
111
|
+
container: true,
|
|
112
|
+
demo: true,
|
|
113
|
+
echarts: true,
|
|
114
|
+
flowchart: true,
|
|
115
|
+
gfm: true,
|
|
116
|
+
imageSize: true,
|
|
117
|
+
include: true,
|
|
118
|
+
lazyLoad: true,
|
|
119
|
+
mark: true,
|
|
120
|
+
mermaid: true,
|
|
121
|
+
playground: {
|
|
122
|
+
presets: ["ts", "vue"],
|
|
123
|
+
},
|
|
108
124
|
presentation: {
|
|
109
125
|
plugins: ["highlight", "math", "search", "notes", "zoom"],
|
|
110
126
|
},
|
|
127
|
+
stylize: [
|
|
128
|
+
{
|
|
129
|
+
matcher: "Recommanded",
|
|
130
|
+
replacer: ({ tag }) => {
|
|
131
|
+
if (tag === "em")
|
|
132
|
+
return {
|
|
133
|
+
tag: "Badge",
|
|
134
|
+
attrs: { type: "tip" },
|
|
135
|
+
content: "Recommanded",
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
sub: true,
|
|
141
|
+
sup: true,
|
|
142
|
+
tabs: true,
|
|
143
|
+
tex: true,
|
|
144
|
+
vpre: true,
|
|
145
|
+
vuePlayground: true,
|
|
111
146
|
},
|
|
112
147
|
},
|
|
113
148
|
});
|
|
@@ -42,48 +42,6 @@ VuePress 会使用 [markdown-it](https://github.com/markdown-it/markdown-it) 来
|
|
|
42
42
|
|
|
43
43
|
通过 [`vuepress-plugin-md-enhance`][md-enhance],主题扩展了更多 Markdown 语法,提供更加丰富的写作功能。
|
|
44
44
|
|
|
45
|
-
:::: tip 一键启用
|
|
46
|
-
|
|
47
|
-
你可以设置在主题选项中设置 `plugins.mdEnhance.enableAll: true` 启用 [md-enhance][md-enhance] 插件的所有功能。
|
|
48
|
-
|
|
49
|
-
::: code-tabs#language
|
|
50
|
-
|
|
51
|
-
@tab TS
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
import { hopeTheme } from "vuepress-theme-hope";
|
|
55
|
-
|
|
56
|
-
export default {
|
|
57
|
-
theme: hopeTheme({
|
|
58
|
-
plugins: {
|
|
59
|
-
mdEnhance: {
|
|
60
|
-
enableAll: true,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
}),
|
|
64
|
-
};
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
@tab JS
|
|
68
|
-
|
|
69
|
-
```js
|
|
70
|
-
import { hopeTheme } from "vuepress-theme-hope";
|
|
71
|
-
|
|
72
|
-
export default {
|
|
73
|
-
theme: hopeTheme({
|
|
74
|
-
plugins: {
|
|
75
|
-
mdEnhance: {
|
|
76
|
-
enableAll: true,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
}),
|
|
80
|
-
};
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
:::
|
|
84
|
-
|
|
85
|
-
::::
|
|
86
|
-
|
|
87
45
|
#### 自定义容器
|
|
88
46
|
|
|
89
47
|
::: v-pre
|
|
@@ -196,6 +154,12 @@ npm i -D vuepress-theme-hope
|
|
|
196
154
|
|
|
197
155
|
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/code-tabs.html)
|
|
198
156
|
|
|
157
|
+
#### 上下角标
|
|
158
|
+
|
|
159
|
+
19^th^ H~2~O
|
|
160
|
+
|
|
161
|
+
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/sup-sub.html)
|
|
162
|
+
|
|
199
163
|
#### 自定义对齐
|
|
200
164
|
|
|
201
165
|
::: center
|
|
@@ -212,11 +176,11 @@ npm i -D vuepress-theme-hope
|
|
|
212
176
|
|
|
213
177
|
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/align.html)
|
|
214
178
|
|
|
215
|
-
####
|
|
179
|
+
#### Attrs
|
|
216
180
|
|
|
217
|
-
|
|
181
|
+
一个拥有 ID 的 **单次**{#word}。
|
|
218
182
|
|
|
219
|
-
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/
|
|
183
|
+
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/attrs.html)
|
|
220
184
|
|
|
221
185
|
#### 脚注
|
|
222
186
|
|
|
@@ -383,13 +347,50 @@ span {
|
|
|
383
347
|
|
|
384
348
|
#### 样式化
|
|
385
349
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
设置它<span style="color:red">没有</span>任何效果,请<span style="color:red">不要</span>这样使用
|
|
350
|
+
向 Mr.Hope 捐赠一杯咖啡。 _Recommanded_
|
|
389
351
|
|
|
390
352
|
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/stylize.html)
|
|
391
353
|
|
|
392
|
-
|
|
354
|
+
#### 交互演示
|
|
355
|
+
|
|
356
|
+
::: playground#ts TS 案例
|
|
357
|
+
|
|
358
|
+
@file index.ts
|
|
359
|
+
|
|
360
|
+
```ts
|
|
361
|
+
const msg = "hello world";
|
|
362
|
+
|
|
363
|
+
const speak = (msg: string) => console.log(msg);
|
|
364
|
+
|
|
365
|
+
speak(msg);
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
:::
|
|
369
|
+
|
|
370
|
+
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/playground.html)
|
|
371
|
+
|
|
372
|
+
#### Vue 交互演示
|
|
373
|
+
|
|
374
|
+
::: vue-playground Vue 交互演示
|
|
375
|
+
|
|
376
|
+
@file App.vue
|
|
377
|
+
|
|
378
|
+
```vue
|
|
379
|
+
<script setup>
|
|
380
|
+
import { ref } from "vue";
|
|
381
|
+
|
|
382
|
+
const msg = ref("Hello World!");
|
|
383
|
+
</script>
|
|
384
|
+
|
|
385
|
+
<template>
|
|
386
|
+
<h1>{{ msg }}</h1>
|
|
387
|
+
<input v-model="msg" />
|
|
388
|
+
</template>
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
:::
|
|
392
|
+
|
|
393
|
+
- [查看详情](https://vuepress-theme-hope.github.io/v2/zh/guide/markdown/vue-playground.html)
|
|
393
394
|
|
|
394
395
|
#### 幻灯片
|
|
395
396
|
|