gitbook serve
http://localhost:4000/
{
"title": "lzw笔记",
"outputfile": "SUMMARY.md",
"catalog": "all",
"ignores": [],
"unchanged": [],
"sortedBy": "-",
"disableTitleFormatting": true,
"plugins": [
"favicon-absolute",
"katex",
"-lunr",
"-search",
"search-pro",
"splitter",
"page-treeview",
"edit-link",
"anchor-navigation-ex",
"expandable-chapters",
"copy-code-button"
],
"pluginsConfig": {
"page-treeview": {
"copyright": "Copyright © aleen42",
"minHeaderCount": "2",
"minHeaderDeep": "2"
},
"edit-link": {
"base": "//github.com/xxx/notebook/edit/master",
"label": "编辑此页面"
},
"favicon-absolute": {
"favicon": "/favicon.ico"
}
}
}
1.book.json内添加插件 "plugins": ["插件名"]
,新插件放前面,install完了就中断。 gitbook install2.也可以分别直接用淘宝镜像下载npm包,更快
gitbook-summary
, 根目录执行 book sm"expandable-chapters"
"copy-code-button"
"anchor-navigation-ex"
,2025mac安装报错,则在配置中删除,然后手动安装,再build:npm install gitbook-plugin-anchor-navigation-ex --save
"splitter"
"page-treeview"
"edit-link"
"katex"
> "mathjax-pro"
calibre
自带的:在插件名前-;引入的:json中删除
>"plugins":[ "-search"]
>
xxx.github.io
或者其他花名main分支只有源代码和配置文件;
gh-pages分支生成gitbook,删除其他所有不必要的内容,上传到仓库后会被同步到gitpage网站。
使用gh-pages插件将本地静态页面HTML文件推送到远处仓库gh-pages分支
https://cdn.jsdelivr.net/gh/xxx/notebook-img
npm install gitbook-cli -g
;gitbook -V
查看是否安装成功(这里V是大写)。TypeError: cb.apply is not a function
,根据报错信息C:\Users\MyPC\AppData\Roaming\npm\node_modules\gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js:287
,可知需要更新依赖项。cd C:\Users\MyPC\AppData\Roaming\npm\node_modules\gitbook-cli\node_modules\npm\node_modules\
graceful-fs
依赖模块——npm install graceful-fs@latest --save
gitbook -V
查看是否解决。Error: read ECONNRESET
。npm install -g cnpm --registry=https://registry.npm.taobao.org
npm install @gitbook-ng/gitbook
site:l2w.top
,一般没有收录所以查询不到.html
验证文件,上传到网址根目录——自行测试该网址成功后回到console完成验证npm install staticrypt
mima
换成自己的)#!/bin/zsh
cd ~/Desktop/notebook && book sm && cp SUMMARY.md README.md && mv 9me/test.md node_modules/test.md && gitbook build && mv _book/search_plus_index.json node_modules/search_plus_index.json && mv node_modules/test.md 9me/test.md && gitbook build && staticrypt _book/9me/test.html mima --short && rm _book/9me/test.html && mv _book/9me/test_encrypted.html _book/9me/test.html && mv 9me/test.md node_modules/test.md && mv node_modules/search_plus_index.json _book/search_plus_index.json && gh-pages -d _book && git add --all && git commit -a -m "." --no-verify && git push && mv node_modules/test.md 9me/test.md && echo ====================success==================