From 5c91041dad80fec23ba7f425aa8f9785a65d5899 Mon Sep 17 00:00:00 2001 From: Zdenek Crha Date: Tue, 10 Mar 2020 18:32:12 +0100 Subject: [PATCH] Mention that .gitignore is used for watch excludes (#1160) The serve and watch commands use .gitignore file in book root directory to read exclude patterns used when watching for changed files. A .gitignore from parent directory or user home is not used though. Add documentation of this behaviour to both commands. --- book-example/src/cli/serve.md | 11 +++++++++++ book-example/src/cli/watch.md | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/book-example/src/cli/serve.md b/book-example/src/cli/serve.md index 0629d9ca..3bd6dd93 100644 --- a/book-example/src/cli/serve.md +++ b/book-example/src/cli/serve.md @@ -46,3 +46,14 @@ The `--dest-dir` (`-d`) option allows you to change the output directory for the book. Relative paths are interpreted relative to the book's root directory. If not specified it will default to the value of the `build.build-dir` key in `book.toml`, or to `./book`. + +#### Specify exclude patterns + +The `serve` command will not automatically trigger a build for files listed in +the `.gitignore` file in the book root directory. The `.gitignore` file may +contain file patterns described in the [gitignore +documentation](https://git-scm.com/docs/gitignore). This can be useful for +ignoring temporary files created by some editors. + +_Note: Only `.gitignore` from book root directory is used. Global +`$HOME/.gitignore` or `.gitignore` files in parent directories are not used._ diff --git a/book-example/src/cli/watch.md b/book-example/src/cli/watch.md index 68dcd562..bc8c3821 100644 --- a/book-example/src/cli/watch.md +++ b/book-example/src/cli/watch.md @@ -25,3 +25,15 @@ The `--dest-dir` (`-d`) option allows you to change the output directory for the book. Relative paths are interpreted relative to the book's root directory. If not specified it will default to the value of the `build.build-dir` key in `book.toml`, or to `./book`. + + +#### Specify exclude patterns + +The `watch` command will not automatically trigger a build for files listed in +the `.gitignore` file in the book root directory. The `.gitignore` file may +contain file patterns described in the [gitignore +documentation](https://git-scm.com/docs/gitignore). This can be useful for +ignoring temporary files created by some editors. + +_Note: Only `.gitignore` from book root directory is used. Global +`$HOME/.gitignore` or `.gitignore` files in parent directories are not used._