diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-02-11 17:30:58 +0100 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-02-11 17:30:58 +0100 |
commit | 98a13cf487e3b2823cfde38ab1d1b8f97f614517 (patch) | |
tree | 81d07c7095822867ba180a79e9a5b1343d81de0e /lib/book.js | |
parent | 7f9aa214a412f3d173ac52042bd7250aacda6143 (diff) | |
download | gitbook-98a13cf487e3b2823cfde38ab1d1b8f97f614517.zip gitbook-98a13cf487e3b2823cfde38ab1d1b8f97f614517.tar.gz gitbook-98a13cf487e3b2823cfde38ab1d1b8f97f614517.tar.bz2 |
Add conrefs loader for nunjucks
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/book.js b/lib/book.js index f615833..a2a11a7 100644 --- a/lib/book.js +++ b/lib/book.js @@ -287,6 +287,14 @@ Book.prototype.isMultilingual = function() { return this.langs.count() > 0; }; +// Return true if file is in the scope of this book +Book.prototype.isInBook = function(filename) { + return pathUtil.isInRoot( + this.root, + this.resolve(filename) + ); +}; + // Return true if file is in the scope of a child book Book.prototype.isInLanguageBook = function(filename) { return _.some(this.langs.list(), function(lang) { |