Skip to content

Commit

Permalink
docs(markdown): update markdown config
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Feb 18, 2017
1 parent ee77deb commit 1b479cb
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 9 deletions.
13 changes: 12 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Add TOC in custom sidebar.

```js
window.$docsify = {
subMaxLevel: 3
subMaxLevel: 2
}
```

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

```js
window.$docsify = {
// object
markdown: {
smartypants: true,
renderer: {
link: function() {
// ...
}
}
},

// function
markdown: function (marked, renderer) {
// ...
return marked
Expand Down
10 changes: 7 additions & 3 deletions docs/markdown.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Markdown configuration

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

```js
window.$docsify = {
markdown: {
smartypants: true
// ...
smartypants: true,
renderer: {
link: function() {
// ...
}
}
}
}
```
Expand Down
15 changes: 13 additions & 2 deletions docs/zh-cn/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ window.$docsify = {

```js
window.$docsify = {
subMaxLevel: 3
subMaxLevel: 2
}
```

Expand Down Expand Up @@ -212,12 +212,23 @@ window.$docsify = {

## markdown

- 类型: `Function`
- 类型: `Object|Function`

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

```js
window.$docsify = {
// object
markdown: {
smartypants: true,
renderer: {
link: function() {
// ...
}
}
},

// function
markdown: function (marked, renderer) {
// ...
return marked
Expand Down
10 changes: 7 additions & 3 deletions docs/zh-cn/markdown.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Markdown 配置

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

```js
window.$docsify = {
markdown: {
smartypants: true
// ...
smartypants: true,
renderer: {
link: function() {
// ...
}
}
}
}
```
Expand Down
1 change: 1 addition & 0 deletions docs/zh-cn/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 快速开始

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

Expand Down

0 comments on commit 1b479cb

Please sign in to comment.