Command Line gitbook usage and command line gitbook usage
GitbookHow to Use gitbook
Is a command line tool that uses git, github, and markdown to build a text version.
Website output,
1. Install
It is best to install node. js above v.4.0.0
The system is windows, linux, unix, and macos.
$ Npm install gitbook-cli-g # girbook-cli is a management plug-in that installs all girbook tools.
2. Use:
$ Gitbook init # create a book $ gitbook serve # start a book website service $ gitbook build # create a book Basic Service-static website book
Directory structure
Gitbook uses a simple directory structure. markdown/asciidoc can be replaced with html. The structure of multiple books is somewhat different.
Book. json file storage configuration data readme. md file cutting-edge introduction in your book summsry. md file directory Glossary. md file Glossary
Static files and Images
a static file is a file that is not listed in the SUMMARY.md all static files, unless ignored ,are copeied to the output.
Ignored files and folders
Gitbook will read the. gitignore,. bookignore, And. ignore files as well as the obtained files and folders and skip the list. The format of these files follows the same conventions.
# this is a commment # ignore the file test.md test.md # Ignore everything in the dictory “bin” bin/*
Integration of projects and subdirectories
The whole book can be embedded into the project.
Page and summary
Gitbook uses a summer. the md file defines the structure of the chapters and subchapters in the book. the md file is used to generate the directory format summary for books. md is just a chain list. The title of the link is used as the title of the chapter. The link is the path of the file of the chapter.
Adding a nested list to the parent chapter will create a subchapter.
Simple Example
# summary * [part i ](part1/readme.md) * [writing is nice] (part1/ writing.md) * [ gitbook is nice ](part1/ gitbook.md) * [part ii](part2/readme.md) * [we love feedbask](part2/feedback_please.md) * [better tools for authors](part2/better_tools.md)
Use anchor
# Summary ### Part I * [Part I](part1/README.md) * [Writing is nice](part1/README.md#writing) * [GitBook is nice](part1/README.md#gitbook) * [Part II](part2/README.md) * [We love feedback](part2/README.md#feedback) * [Better tools for authors](part2/README.md#tools)