summaryrefslogtreecommitdiffstats
path: root/lib/plugins/listDepsForBook.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-06-10 22:04:19 +0200
committerSamy Pesse <samypesse@gmail.com>2016-06-10 22:04:19 +0200
commit94a4310c1e4b9ee71def9cbd9efd8a4c491f4444 (patch)
tree5f221cb283e5f4591a3764112569ee62220e6da2 /lib/plugins/listDepsForBook.js
parente8ee57be83adf3de2933373e7969c7675bf5372d (diff)
downloadgitbook-94a4310c1e4b9ee71def9cbd9efd8a4c491f4444.zip
gitbook-94a4310c1e4b9ee71def9cbd9efd8a4c491f4444.tar.gz
gitbook-94a4310c1e4b9ee71def9cbd9efd8a4c491f4444.tar.bz2
Adapt Plugins.loadForBook to use correct order
Diffstat (limited to 'lib/plugins/listDepsForBook.js')
-rw-r--r--lib/plugins/listDepsForBook.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/plugins/listDepsForBook.js b/lib/plugins/listDepsForBook.js
new file mode 100644
index 0000000..196e3aa
--- /dev/null
+++ b/lib/plugins/listDepsForBook.js
@@ -0,0 +1,18 @@
+var listDependencies = require('./listDependencies');
+
+/**
+ * List all plugin requirements for a book.
+ * It can be different from the final list of plugins,
+ * since plugins can have their own dependencies
+ *
+ * @param {Book}
+ * @return {List<PluginDependency>}
+ */
+function listDepsForBook(book) {
+ var config = book.getConfig();
+ var plugins = config.getPluginDependencies();
+
+ return listDependencies(plugins);
+}
+
+module.exports = listDepsForBook;