Skip to content

Commit 81e869f

Browse files
committed
docs: add missing options
1 parent d6dbc79 commit 81e869f

6 files changed

Lines changed: 130 additions & 0 deletions

File tree

docs/reference/config.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,18 @@ Since VuePress will load temp files during dev and build, the temp directory sho
253253
- Also see:
254254
- [Frontmatter > permalinkPattern](./frontmatter.md#permalinkpattern)
255255

256+
### userStyle
257+
258+
- Type: `string | null`
259+
260+
- Default: `null`
261+
262+
- Details:
263+
264+
Specify the path of a custom style file, which will be injected at the bottom of the client.
265+
266+
Themes can also set this option, but user config takes precedence over theme config.
267+
256268
## Dev Config
257269

258270
### host
@@ -398,6 +410,32 @@ const defaultOptions = {
398410
You should not configure it unless you understand what it is for.
399411
:::
400412

413+
#### markdown.assets.aliasSupport
414+
415+
- Type: `boolean | '@-prefix'`
416+
417+
- Default: `true`
418+
419+
- Details:
420+
421+
Use aliases for non-strict relative paths.
422+
423+
This is a path that does not start with `./` or `../` or `/` or `<protocol header>`:
424+
`<img src="path1/path2.png" />`
425+
- If the option is `true`. `path1` is regarded as an alias.
426+
- If the option is `false`. It is regarded as a relative path.
427+
- If the option is `"@-prefix"`. If the path starts with `@`, `path1` is regarded as an alias; Otherwise, it is regarded as a relative path.
428+
429+
#### markdown.assets.absolutePathPrependBase
430+
431+
- Type: `boolean`
432+
433+
- Default: `true`
434+
435+
- Details:
436+
437+
Whether to prepend [base](#base) to absolute path.
438+
401439
### markdown.component
402440

403441
- Type: `undefined | false`

docs/reference/plugin-api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,3 +360,15 @@ export default {
360360
- Details:
361361

362362
This hook will be invoked once VuePress app has generated static files.
363+
364+
### onPageUpdated
365+
366+
- Type: `(type: 'create' | 'delete' | 'update', page: Page, oldPage: Page | null) => void | Promise<void>`
367+
368+
- Details:
369+
370+
This hook will be invoked once a page has been created, deleted or updated.
371+
372+
`type` indicates the type of page change: `'create'` means the page is created, `'delete'` means the page is deleted, `'update'` means the page is updated.
373+
374+
`oldPage` is the old page before update or delete, it only exists when `type` is `'update'` or `'delete'`.

docs/reference/theme-api.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,18 @@ export default {
101101

102102
- Also see:
103103
- [Config > templateDev](./config.md#templatedev)
104+
105+
### userStyle
106+
107+
- Type: `string | null`
108+
109+
- Default: `null`
110+
111+
- Details:
112+
113+
Specify the path of a custom style file, which will be injected at the bottom of the client.
114+
115+
It would override the default value, and could be overridden by user config.
116+
117+
- Also see:
118+
- [Config > userStyle](./config.md#userstyle)

docs/zh/reference/config.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,18 @@ VuePress 在开发和构建时会加载临时文件,因此临时文件目录
252252
- 参考:
253253
- [Frontmatter > permalinkPattern](./frontmatter.md#permalinkpattern)
254254

255+
### userStyle
256+
257+
- 类型: `string | null`
258+
259+
- 默认值: `null`
260+
261+
- 详情:
262+
263+
指定自定义样式文件的路径,该样式文件将被注入到客户端底部。
264+
265+
主题也可以设置该选项,但用户配置的优先级高于主题配置。
266+
255267
## Dev 配置项
256268

257269
### host
@@ -397,6 +409,32 @@ const defaultOptions = {
397409
除非你了解它的用途,否则你不应该设置该配置项。
398410
:::
399411

412+
#### markdown.assets.aliasSupport
413+
414+
- 类型: `boolean | '@-prefix'`
415+
416+
- 默认值: `true`
417+
418+
- 详情:
419+
420+
对非严格相对路径使用别名。
421+
422+
非严格相对路径是指不以 `./``../``/``<protocol header>` 开头的路径:
423+
`<img src="path1/path2.png" />`
424+
- 如果设置为 `true``path1` 会被视为别名。
425+
- 如果设置为 `false`,它会视为相对路径。
426+
- 如果设置为 `"@-prefix"`,当路径以 `@` 开头时,`path1` 会被视为别名;否则视为相对路径。
427+
428+
#### markdown.assets.absolutePathPrependBase
429+
430+
- 类型: `boolean`
431+
432+
- 默认值: `true`
433+
434+
- 详情:
435+
436+
是否将绝对路径添加 [base](#base) 前缀。
437+
400438
### markdown.component
401439

402440
- 类型: `undefined | false`

docs/zh/reference/plugin-api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,3 +360,15 @@ export default {
360360
- 详情:
361361

362362
该 Hook 会在 VuePress App 完成静态文件生成后被立即调用。
363+
364+
### onPageUpdated
365+
366+
- 类型: `(type: 'create' | 'delete' | 'update', page: Page, oldPage: Page | null) => void | Promise<void>`
367+
368+
- 详情:
369+
370+
该 Hook 会在页面被创建、删除或更新后被立即调用。
371+
372+
`type` 表示页面的变更类型:`'create'` 表示页面被创建,`'delete'` 表示页面被删除,`'update'` 表示页面被更新。
373+
374+
`oldPage` 表示更新或删除前的旧页面,仅在 `type``'update'``'delete'` 时存在。

docs/zh/reference/theme-api.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,18 @@ export default {
101101

102102
- 参考:
103103
- [配置 > templateDev](./config.md#templatedev)
104+
105+
### userStyle
106+
107+
- 类型: `string | null`
108+
109+
- 默认值: `null`
110+
111+
- 详情:
112+
113+
指定自定义样式文件的路径,该样式文件将被注入到客户端底部。
114+
115+
它会覆盖默认值,同时也会被用户配置覆盖。
116+
117+
- 参考:
118+
- [配置 > userStyle](./config.md#userstyle)

0 commit comments

Comments
 (0)