mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
Add method editPlugin to config modifiers
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
|
||||
/**
|
||||
* Edit ocnfiguration of a plugin
|
||||
* @param {Book} book
|
||||
* @param {String} plugin
|
||||
* @param {Object} pluginConfig
|
||||
* @return {Book}
|
||||
*/
|
||||
function editPlugin(book, pluginName, pluginConfig) {
|
||||
var config = book.getConfig();
|
||||
config = config.set('pluginsConfig.'+pluginName, pluginConfig);
|
||||
|
||||
return book.setConfig(config);
|
||||
}
|
||||
|
||||
module.exports = editPlugin;
|
||||
@@ -2,5 +2,6 @@
|
||||
module.exports = {
|
||||
addPlugin: require('./addPlugin'),
|
||||
removePlugin: require('./removePlugin'),
|
||||
togglePlugin: require('./togglePlugin')
|
||||
togglePlugin: require('./togglePlugin'),
|
||||
editPlugin: require('./editPlugin')
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user