Skip to content

Commit a6d823b

Browse files
committed
docs(markdown): update markdown config
1 parent 7b6a2ac commit a6d823b

File tree

5 files changed

+40
-9
lines changed

5 files changed

+40
-9
lines changed

docs/configuration.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Add TOC in custom sidebar.
111111

112112
```js
113113
window.$docsify = {
114-
subMaxLevel: 3
114+
subMaxLevel: 2
115115
}
116116
```
117117

@@ -219,6 +219,17 @@ See [Markdown configuration](/markdown).
219219

220220
```js
221221
window.$docsify = {
222+
// object
223+
markdown: {
224+
smartypants: true,
225+
renderer: {
226+
link: function() {
227+
// ...
228+
}
229+
}
230+
},
231+
232+
// function
222233
markdown: function (marked, renderer) {
223234
// ...
224235
return marked

docs/markdown.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Markdown configuration
22

3-
The Markdown parser is [marked](https://github.com/chjj/marked). You can customize how docsify renders your Markdown content to HTML.
3+
The Markdown parser is [marked](https://github.com/chjj/marked). You can customize how docsify renders your Markdown content to HTML. Support customize `renderer`.
44

55
```js
66
window.$docsify = {
77
markdown: {
8-
smartypants: true
9-
// ...
8+
smartypants: true,
9+
renderer: {
10+
link: function() {
11+
// ...
12+
}
13+
}
1014
}
1115
}
1216
```

docs/zh-cn/configuration.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ window.$docsify = {
113113

114114
```js
115115
window.$docsify = {
116-
subMaxLevel: 3
116+
subMaxLevel: 2
117117
}
118118
```
119119

@@ -212,12 +212,23 @@ window.$docsify = {
212212

213213
## markdown
214214

215-
- 类型: `Function`
215+
- 类型: `Object|Function`
216216

217217
参考 [Markdown 配置](/zh-cn/markdown)
218218

219219
```js
220220
window.$docsify = {
221+
// object
222+
markdown: {
223+
smartypants: true,
224+
renderer: {
225+
link: function() {
226+
// ...
227+
}
228+
}
229+
},
230+
231+
// function
221232
markdown: function (marked, renderer) {
222233
// ...
223234
return marked

docs/zh-cn/markdown.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Markdown 配置
22

3-
内置的 Markdown 解析器是 [marked](https://github.com/chjj/marked),可以修改它的配置。
3+
内置的 Markdown 解析器是 [marked](https://github.com/chjj/marked),可以修改它的配置。同时可以直接配置 `renderer`
44

55
```js
66
window.$docsify = {
77
markdown: {
8-
smartypants: true
9-
// ...
8+
smartypants: true,
9+
renderer: {
10+
link: function() {
11+
// ...
12+
}
13+
}
1014
}
1115
}
1216
```

docs/zh-cn/quickstart.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# 快速开始
12

23
推荐安装 `docsify-cli` 工具,可以方便创建及本地预览文档网站。
34

0 commit comments

Comments
 (0)