Merge pull request #307 from budziq/theme_reload

Now changes to `theme` directory trigger rebuild for `mdbook serve`
This commit is contained in:
Mathieu David 2017-06-01 13:56:26 +02:00 committed by GitHub
commit 272022621d
2 changed files with 4 additions and 1 deletions

View File

@ -4,7 +4,7 @@ The default renderer uses a [handlebars](http://handlebarsjs.com/) template to r
included in the mdBook binary.
The theme is totally customizable, you can selectively replace every file from the theme by your own by adding a
`theme` directory in your source folder. Create a new file with the name of the file you want to override
`theme` directory next to `src` folder in your project root. Create a new file with the name of the file you want to override
and now that file will be used instead of the default file.
Here are the files you can override:

View File

@ -346,6 +346,9 @@ fn trigger_on_change<F>(book: &mut MDBook, closure: F) -> ()
::std::process::exit(0);
};
// Add the theme directory to the watcher
watcher.watch(book.get_theme_path(), Recursive).unwrap_or_default();
// Add the book.{json,toml} file to the watcher if it exists, because it's not
// located in the source directory
if watcher