You need to install'gitbook-cli'to have accessto the gitbook command anywhere on your system. If you've installed this package globally, you need to uninstall it. >> Run 'npm uninstall -g gitbook' then 'npm install -g gitbook-cli'
versions list installed versions versions:print print current version to usein the currentdirectory versions:available list available versionson NPM versions:install [version] forceinstall a specific versionof gitbook versions:link [version] [folder] link a versionto a local folder versions:uninstall [version] uninstall a specific versionof gitbook helplist commands for a specific versionof gitbook * run a command with a specific gitbook version
Options:
-h, --help output usage information -V, --version output the version number -v, --gitbook [version] specify GitBook version to use -d, --debug enable verbose error
執行
1
$ gitbook -V
會顯示
1
0.3.3
然後執行
1
$ gitbook versions
會顯示
1 2
There isno versions installed You can instal the latest version using:"gitbook versions:install latest"
build [book] [output] build a book --format Format to build to (Defaultis website; Values are website, json, ebook) --log Minimum log level to display (Defaultis info; Values are debug, info, warn, error, disabled)
pdf [book] [output] build a book to pdf --log Minimum log level to display (Defaultis info; Values are debug, info, warn, error, disabled)
epub [book] [output] build a book to epub --log Minimum log level to display (Defaultis info; Values are debug, info, warn, error, disabled)
mobi [book] [output] build a book to mobi --log Minimum log level to display (Defaultis info; Values are debug, info, warn, error, disabled)
serve [book] Build then serve a gitbook from a directory --port Port forserverto listen on (Defaultis4000) --lrport Port for livereload serverto listen on (Defaultis35729) --watch Enable/disable file watcher (Defaultistrue) --format Format to build to (Defaultis website; Values are website, json, ebook) --log Minimum log level to display (Defaultis info; Values are debug, info, warn, error, disabled)
install [book] install plugins dependencies
init [directory] create files and folders based on contents of SUMMARY.md