diff --git a/package.json b/package.json
index b24badb..ec4aab9 100644
--- a/package.json
+++ b/package.json
@@ -6,9 +6,9 @@
"vitepress": "^1.2.0"
},
"scripts": {
- "docs:dev": "vitepress dev",
- "docs:build": "vitepress build",
- "docs:preview": "vitepress preview"
+ "docs:dev": "node ./src/hooks.js && vitepress dev",
+ "docs:build": "node ./src/hooks.js && vitepress build",
+ "docs:preview": "node ./src/hooks.js && vitepress preview"
},
"dependencies": {
"@metalsmith/collections": "^1.3.0",
@@ -16,7 +16,7 @@
"@metalsmith/layouts": "^2.7.0",
"@metalsmith/markdown": "^1.10.0",
"@metalsmith/permalinks": "^3.0.1",
- "chalk": "^5.3.0",
+ "chalk": "^5.3.0",
"commander": "^12.1.0",
"gogocode": "^1.0.55",
"handlebars": "^4.7.8",
diff --git a/src/api-examples.md b/src/api-examples.md
deleted file mode 100644
index 1e1a60c..0000000
--- a/src/api-examples.md
+++ /dev/null
@@ -1,49 +0,0 @@
----
-outline: deep
----
-
-# Runtime API Examples
-
-This page demonstrates1 usage of some of the runtime APIs provided by VitePress1.
-
-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:
-
-```md
-
-
-## Results
-
-### Theme Data
-
{{ theme }}
-
-### Page Data
-{{ page }}
-
-### Page Frontmatter
-{{ frontmatter }}
-```
-
-
-
-## Results
-
-### Theme Data
-{{ theme }}
-
-### Page Data
-{{ page }}
-
-### Page Frontmatter
-{{ frontmatter }}
-
-## More
-
-Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
diff --git a/src/frontend/library/Metalsmith/index-source.md b/src/frontend/library/Metalsmith/index-source.md
new file mode 100644
index 0000000..173cde9
--- /dev/null
+++ b/src/frontend/library/Metalsmith/index-source.md
@@ -0,0 +1,22 @@
+
+```
+ const Metalsmith = require('metalsmith');
+let layouts = require('@metalsmith/layouts');
+
+Metalsmith(__dirname)
+ .metadata({
+ site: {
+ title: 'My Website',
+ },
+ })
+ .source('./src')
+ .destination('./build')
+ .clean(true)
+ .use(layouts({
+ pattern: '**/*.html'
+ }))
+ .build(function (err) {
+ if (err) throw err;
+ });
+```
+
\ No newline at end of file
diff --git a/src/frontend/library/commander/commander.js b/src/frontend/library/commander/commander.js
old mode 100644
new mode 100755
index ed25715..cc39096
--- a/src/frontend/library/commander/commander.js
+++ b/src/frontend/library/commander/commander.js
@@ -1,3 +1,4 @@
+#!/usr/bin/env node
const { program } = require('commander');
diff --git a/src/frontend/library/commander/commander.md b/src/frontend/library/commander/commander.md
index 22f550b..f64a358 100644
--- a/src/frontend/library/commander/commander.md
+++ b/src/frontend/library/commander/commander.md
@@ -1,7 +1,7 @@
# commander.js
## 名词概念
-1. 选项(options):终端传递的以`-`或者`--`开头的参数。
+1. 选项(option):终端传递的以`-`或者`--`开头的参数。
2. 命令(command):终端可以调用的命令,例如git add .中的add
3. 子命令(sub-command):一个独立的文件,名称默认为`主命令文件名称-子命令名称`
4. 选项参数,命令参数:跟在选项或者命令之后的参数,<>表示必选,[]表示可选,终端没出现该选项名称或者命令名称时候,默认为undefined
@@ -29,7 +29,7 @@ node ./commander.js start clone placeA placeB // 会调用同级目录下面的c
```
const { program } = require('commander'); // program是一个全局的Command实例
-program.options("-s --search") // 返回全局Command实例
+program.option("-s --search") // 返回全局Command实例
.command('commandA") // 创建一个CommandA实例
.command('commandB") // 在CommandA实例下面创建一个新的CommandB实例
@@ -41,6 +41,6 @@ program.command('commandC') //在全局Command下面创建一个新的CommandC
[具体见官方文档](https://github.com/tj/commander.js/blob/HEAD/Readme_zh-CN.md)
- option
- command
-- action 参数为命令的所有参数,外加上解析出来的options和command实例
+- action 参数为命令的所有参数,外加上解析出来的option和command实例
- version
- hook
\ No newline at end of file
diff --git a/src/frontend/library/commander/index-source.md b/src/frontend/library/commander/index-source.md
new file mode 100644
index 0000000..118fd49
--- /dev/null
+++ b/src/frontend/library/commander/index-source.md
@@ -0,0 +1,72 @@
+
+```
+ #!/usr/bin/env node
+const { program } = require('commander');
+
+
+let op1 = program.option('-s --search', 'search')
+// 通过绑定处理函数实现命令(这里的指令描述为放在`.command`中)
+// 返回新生成的命令(即该子命令)以供继续配置
+let a = program
+ .command('clone