fix
This commit is contained in:
36
book/node_modules/honkit/lib/output/preparePlugins.js
generated
vendored
Normal file
36
book/node_modules/honkit/lib/output/preparePlugins.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins_1 = __importDefault(require("../plugins"));
|
||||
const promise_1 = __importDefault(require("../utils/promise"));
|
||||
/**
|
||||
* Load and setup plugins
|
||||
*
|
||||
* @param {Output}
|
||||
* @return {Promise<Output>}
|
||||
*/
|
||||
function preparePlugins(output) {
|
||||
const book = output.getBook();
|
||||
return ((0, promise_1.default)()
|
||||
// Only load plugins for main book
|
||||
.then(() => {
|
||||
if (book.isLanguageBook()) {
|
||||
return output.getPlugins();
|
||||
}
|
||||
else {
|
||||
return plugins_1.default.loadForBook(book);
|
||||
}
|
||||
})
|
||||
// Update book's configuration using the plugins
|
||||
.then((plugins) => {
|
||||
return plugins_1.default.validateConfig(book, plugins).then((newBook) => {
|
||||
return output.merge({
|
||||
book: newBook,
|
||||
plugins: plugins
|
||||
});
|
||||
});
|
||||
}));
|
||||
}
|
||||
exports.default = preparePlugins;
|
Reference in New Issue
Block a user