mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
30 lines
757 B
JavaScript
30 lines
757 B
JavaScript
var Immutable = require('immutable');
|
|
var PluginDependency = require('../models/pluginDependency');
|
|
|
|
var pkg = require('../../package.json');
|
|
|
|
/**
|
|
* Create a PluginDependency from a dependency of gitbook
|
|
* @param {String} pluginName
|
|
* @return {PluginDependency}
|
|
*/
|
|
function createFromDependency(pluginName) {
|
|
var npmID = PluginDependency.nameToNpmID(pluginName);
|
|
var version = pkg.dependencies[npmID];
|
|
|
|
return PluginDependency.create(pluginName, version);
|
|
}
|
|
|
|
/*
|
|
* List of default plugins for all books,
|
|
* default plugins should be installed in node dependencies of GitBook
|
|
*/
|
|
module.exports = Immutable.List([
|
|
'highlight',
|
|
'search',
|
|
'lunr',
|
|
'sharing',
|
|
'fontsettings',
|
|
'theme-default'
|
|
]).map(createFromDependency);
|