2017-02-12 15:51:26 +08:00
|
|
|
# Markdown 配置
|
|
|
|
|
2017-02-19 00:11:16 +08:00
|
|
|
内置的 Markdown 解析器是 [marked](https://github.com/chjj/marked),可以修改它的配置。同时可以直接配置 `renderer`。
|
2017-02-12 15:51:26 +08:00
|
|
|
|
|
|
|
```js
|
|
|
|
window.$docsify = {
|
|
|
|
markdown: {
|
2017-02-19 00:11:16 +08:00
|
|
|
smartypants: true,
|
|
|
|
renderer: {
|
|
|
|
link: function() {
|
|
|
|
// ...
|
|
|
|
}
|
|
|
|
}
|
2017-02-12 15:51:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
?> 完整配置参数参考 [marked 文档](https://github.com/chjj/marked#options-1)
|
|
|
|
|
2017-02-12 20:12:36 +08:00
|
|
|
当然也可以完全定制 Markdown 解析规则。
|
2017-02-12 15:51:26 +08:00
|
|
|
|
|
|
|
```js
|
|
|
|
window.$docsify = {
|
2017-02-13 22:43:58 +08:00
|
|
|
markdown: function(marked, renderer) {
|
2017-02-12 15:51:26 +08:00
|
|
|
// ...
|
|
|
|
|
|
|
|
return marked
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|