1.创建目录:/gitbook/gitbook 和 /gitbook/html
2. /gitbook/gitbook目录下,touch新建README.md SUMMARY.md
3. docker安装gitbook
docker run --name gitbook \ -p 4000:4000 \ -v /gitbook/gitbook:/srv/gitbook \ -v /gitbook/html:/srv/html \ fellah/gitbook
4.docker进入gitbook,进行初始化
[root@it ]# docker exec -it 9c9a975c58b8 /bin/sh # ls README.md SUMMARY.md _book # gitbook Usage: gitbook [options] [command] Commands: ls List versions installed locally current Display currently activated version ls-remote List remote versions available for install fetch [version] Download and install a <version> alias [folder] [version] Set an alias named <version> pointing to <folder> uninstall [version] Uninstall a version update [tag] Update to the latest version of GitBook help List commands for GitBook * run a command with a specific gitbook version Options: -h, --help output usage information -v, --gitbook [version] specify GitBook version to use -d, --debug enable verbose error -V, --version Display running versions of gitbook and gitbook-cli # gitbook init info: create SUMMARY.md info: initialization is finished
5.每次改动md源文件后,都要重新构建,命令:
[root@it gitbook]# docker exec gitbook gitbook build . /srv/html info: 7 plugins are installed info: 6 explicitly listed info: loading plugin "highlight"... OK info: loading plugin "search"... OK info: loading plugin "lunr"... OK info: loading plugin "sharing"... OK info: loading plugin "fontsettings"... OK info: loading plugin "theme-default"... OK info: found 1 pages info: found 0 asset files info: >> generation finished with success in 0.9s ! [root@it gitbook]#
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。