用doctoc生成的目录放到SUMMARY中点击菜单可滑到对应位置
npm i doctoc
doctoc .
* [简介](README.md)
* [types](./src/types/README.md)
* [date](./src/types/README.md#date)
* [browser](./src/types/README.md#browser)
* [browser version](./src/types/README.md#browser-version)
2、gitbook编译
1、根目录下创建book.json,并添加常用的配置。 gitbook install下载插件
{
"title": "utils工具函数",
"language": "zh-hans",
"author": "pgli",
"gitbook": "3.2.3",
"root": ".",
"links": {
"sidebar": {
}
},
"structure": {
"readme": "README.md"
},
"plugins": [
"chapter-fold",
"code",
"github",
"pageview-count",
"custom-favicon",
"hide-element",
"back-to-top-button",
"splitter",
"-lunr",
"-search",
"search-pro",
"-sharing",
"sharing-plus"
],
"pluginsConfig": {
"chapter-fold": {},
"code": {
"copyButtons": true
},
"github": {
"url": "https://github.com/ligaopeng123-npm/utils"
},
"favicon": "./favicon.ico",
"hide-element": {
"elements": [
".gitbook-link"
]
},
"sharing": {
"douban": true,
"facebook": false,
"google": false,
"pocket": false,
"qq": true,
"qzone": false,
"twitter": false,
"weibo": true,
"all": [
"douban",
"facebook",
"google",
"instapaper",
"linkedin",
"twitter",
"weibo",
"messenger",
"qq",
"qzone",
"viber",
"whatsapp"
]
}
}
}
2、build数据到docs目录
gitbook build . docs
3、github配置pages
|