mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
docs(markdown): update markdown config
This commit is contained in:
parent
7b6a2ac404
commit
a6d823b826
@ -111,7 +111,7 @@ Add TOC in custom sidebar.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
subMaxLevel: 3
|
subMaxLevel: 2
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -219,6 +219,17 @@ See [Markdown configuration](/markdown).
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
|
// object
|
||||||
|
markdown: {
|
||||||
|
smartypants: true,
|
||||||
|
renderer: {
|
||||||
|
link: function() {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// function
|
||||||
markdown: function (marked, renderer) {
|
markdown: function (marked, renderer) {
|
||||||
// ...
|
// ...
|
||||||
return marked
|
return marked
|
||||||
|
|||||||
@ -1,14 +1,18 @@
|
|||||||
# Markdown configuration
|
# 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
|
```js
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
markdown: {
|
markdown: {
|
||||||
smartypants: true
|
smartypants: true,
|
||||||
|
renderer: {
|
||||||
|
link: function() {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
?> Configuration Options Reference [marked documentation](https://github.com/chjj/marked#options-1)
|
?> Configuration Options Reference [marked documentation](https://github.com/chjj/marked#options-1)
|
||||||
|
|||||||
@ -113,7 +113,7 @@ window.$docsify = {
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
subMaxLevel: 3
|
subMaxLevel: 2
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -212,12 +212,23 @@ window.$docsify = {
|
|||||||
|
|
||||||
## markdown
|
## markdown
|
||||||
|
|
||||||
- 类型: `Function`
|
- 类型: `Object|Function`
|
||||||
|
|
||||||
参考 [Markdown 配置](/zh-cn/markdown)。
|
参考 [Markdown 配置](/zh-cn/markdown)。
|
||||||
|
|
||||||
```js
|
```js
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
|
// object
|
||||||
|
markdown: {
|
||||||
|
smartypants: true,
|
||||||
|
renderer: {
|
||||||
|
link: function() {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// function
|
||||||
markdown: function (marked, renderer) {
|
markdown: function (marked, renderer) {
|
||||||
// ...
|
// ...
|
||||||
return marked
|
return marked
|
||||||
|
|||||||
@ -1,14 +1,18 @@
|
|||||||
# Markdown 配置
|
# Markdown 配置
|
||||||
|
|
||||||
内置的 Markdown 解析器是 [marked](https://github.com/chjj/marked),可以修改它的配置。
|
内置的 Markdown 解析器是 [marked](https://github.com/chjj/marked),可以修改它的配置。同时可以直接配置 `renderer`。
|
||||||
|
|
||||||
```js
|
```js
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
markdown: {
|
markdown: {
|
||||||
smartypants: true
|
smartypants: true,
|
||||||
|
renderer: {
|
||||||
|
link: function() {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
?> 完整配置参数参考 [marked 文档](https://github.com/chjj/marked#options-1)
|
?> 完整配置参数参考 [marked 文档](https://github.com/chjj/marked#options-1)
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
# 快速开始
|
||||||
|
|
||||||
推荐安装 `docsify-cli` 工具,可以方便创建及本地预览文档网站。
|
推荐安装 `docsify-cli` 工具,可以方便创建及本地预览文档网站。
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user