Find file Copy path
4150455 Mar 7, 2016
2 contributors

Users who have contributed to this file

@SamyPesse @Soreine
67 lines (49 sloc) 1.82 KB

Directory Structure

GitBook uses a simple directory structure. All Markdown/Asciidoc files listed in the SUMMARY will be transformed as HTML. Multi-Lingual books have a slightly different structure.

A basic GitBook usually looks something like this:

β”œβ”€β”€ book.json
β”œβ”€β”€ chapter-1/
|   β”œβ”€β”€
|   └──
└── chapter-2/

An overview of what each of these does:

File Description
book.json Stores configuration data (optional) Preface / Introduction for your book (required) Table of Contents (See Pages) (optional) Lexicon / List of terms to annotate (See Glossary) (optional)

Static files and Images

A static file is a file that is not listed in the All static files, unless ignored, are copied to the output.

Ignoring files & folders {#ignore}

GitBook will read the .gitignore, .bookignore and .ignore files to get a list of files and folders to skip. The format inside those files, follows the same convention as .gitignore:

# This is a comment

# Ignore the file

# Ignore everything in the directory "bin"

Project integration with subdirectory {#subdirectory}

For software projects, you can use a subdirectory (like docs/) to store the book for the project's documentation. You can configure the root option to indicate the folder where GitBook can find the book's files:

β”œβ”€β”€ book.json
└── docs/

With book.json containing:

    "root": "./docs"