Skip to content

Commit 47b52a5

Browse files
authored
Merge 9db15a8 into 5eceb25
2 parents 5eceb25 + 9db15a8 commit 47b52a5

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed

docs/plugins/markdown/markdown-include.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ icon: between-horizontal-end
66

77
<NpmBadge package="@vuepress/plugin-markdown-include" />
88

9-
Add additional features to your markdown includes.
9+
Add markdown include features to your VuePress site.
1010

1111
## Usage
1212

@@ -30,13 +30,13 @@ export default {
3030

3131
Use `<!-- @include: filename -->` to include a file.
3232

33-
To partially import the file, you can specify the range of lines to be included:
33+
To partially import a file, you can specify the range of lines to be included:
3434

3535
- `<!-- @include: filename{start-end} -->`
3636
- `<!-- @include: filename{start-} -->`
3737
- `<!-- @include: filename{-end} -->`
3838

39-
Also, you can include file region:
39+
Also, you can include a file region:
4040

4141
- `<!-- @include: filename#region -->`
4242

@@ -214,7 +214,7 @@ class MyClass:
214214
#region snippet
215215
def sayHello(self):
216216
print("Hello " + self.msg + "!")
217-
#region snippet
217+
#endregion snippet
218218

219219
def sayBye(self):
220220
print("Bye " + self.msg + "!")
@@ -340,7 +340,7 @@ int main() {
340340
### deep
341341

342342
- Type: `boolean`
343-
- Details: Whether enable figure support.
343+
- Details: Whether to recursively include files referenced in included Markdown files.
344344

345345
### useComment
346346

docs/zh/plugins/markdown/markdown-include.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ icon: between-horizontal-end
66

77
<NpmBadge package="@vuepress/plugin-markdown-include" />
88

9-
向你的 VuePress 添加导入文件功能
9+
为你的 VuePress 站点添加 Markdown 导入功能
1010

1111
## 使用方法
1212

@@ -30,13 +30,13 @@ export default {
3030

3131
使用 `<!-- @include: filename -->` 导入文件。
3232

33-
如果要部分导入文件,你可以指定导入的行数
33+
如果要部分导入文件,你可以指定导入的行数
3434

3535
- `<!-- @include: filename{start-end} -->`
3636
- `<!-- @include: filename{start-} -->`
3737
- `<!-- @include: filename{-end} -->`
3838

39-
同时你也可以导入文件区域:
39+
同时你也可以导入文件区域
4040

4141
- `<!-- @include: filename#region -->`
4242

@@ -214,7 +214,7 @@ class MyClass:
214214
#region snippet
215215
def sayHello(self):
216216
print("Hello " + self.msg + "!")
217-
#region snippet
217+
#endregion snippet
218218

219219
def sayBye(self):
220220
print("Bye " + self.msg + "!")
@@ -340,7 +340,7 @@ int main() {
340340
### deep
341341

342342
- 类型:`boolean`
343-
- 详情:是否启用图片 Figure 支持
343+
- 详情:是否递归包含被包含的 Markdown 文件中引用的文件
344344

345345
### useComment
346346

plugins/markdown/plugin-markdown-include/src/node/markdownIncludePlugin.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ import type { MarkdownEnv } from 'vuepress/markdown'
66
import { path } from 'vuepress/utils'
77
import type { MarkdownIncludePluginOptions } from './options.js'
88

9+
/**
10+
* Markdown include plugin
11+
*
12+
* Markdown 导入插件
13+
*
14+
* @param options - Plugin options / 插件选项
15+
*
16+
* @example
17+
* ```ts
18+
* import { markdownIncludePlugin } from '@vuepress/plugin-markdown-include'
19+
*
20+
* export default {
21+
* plugins: [
22+
* markdownIncludePlugin({
23+
* deep: true,
24+
* useComment: true,
25+
* }),
26+
* ],
27+
* }
28+
* ```
29+
*/
930
export const markdownIncludePlugin =
1031
(options: MarkdownIncludePluginOptions): Plugin =>
1132
(app) => {

plugins/markdown/plugin-markdown-include/src/node/options.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type { MarkdownItIncludeOptions } from '@mdit/plugin-include'
22

3+
/**
4+
* Options for @vuepress/plugin-markdown-include
5+
*
6+
* @vuepress/plugin-markdown-include 插件的选项
7+
*/
38
export type MarkdownIncludePluginOptions = Omit<
49
MarkdownItIncludeOptions,
510
'currentPath'

0 commit comments

Comments
 (0)