Compare commits

...

3 Commits

Author SHA1 Message Date
Aaron O'Mullan ba2134c480 Bump version to 0.6.3 2014-07-30 10:23:11 -07:00
Aaron O'Mullan 4705548860 Fix resource normalization in when loading plugins
Fixes #384
2014-07-30 10:17:07 -07:00
Samy Pessé 7d51ae3689 Add changelogs for 0.6.2 2014-07-30 00:26:44 -07:00
4 changed files with 27 additions and 6 deletions
+5
View File
@@ -1,5 +1,10 @@
# Release notes
## 0.6.2
- Support generating a plugin's book info dynamically
- Improve navigation on dark theme
- Improve path normalization when parsing SUMMARY.md
## 0.6.0
- Generate header id the same as github
- Custom links can be added at top of sidebar
+19 -3
View File
@@ -65,7 +65,7 @@ Plugin.prototype.normalizeResource = function(resource) {
};
// Return resources
Plugin.prototype.getResources = function() {
Plugin.prototype._getResources = function() {
var book = this.infos.book;
// Nothing specified, fallback to default
@@ -80,7 +80,24 @@ Plugin.prototype.getResources = function() {
}
// Plain data object
return Q(book);
return Q(_.cloneDeep(book));
};
// Normalize resources and return them
Plugin.prototype.getResources = function() {
var that = this;
return this._getResources()
.then(function(resources) {
_.each(RESOURCES, function(resourceType) {
resources[resourceType] = (resources[resourceType] || []).map(that.normalizeResource);
});
return resources;
});
};
// Test if it's a valid plugin
@@ -165,7 +182,6 @@ Plugin.normalizeNames = function(names) {
// Extract data from a list of plugin
Plugin.fromList = function(names, root, generator) {
var that = this;
var failed = [];
// Load plugins
+2 -2
View File
@@ -202,12 +202,12 @@ Generator.prototype.copyAssets = function() {
return plugin.copyAssets(pluginAssets)
.then(function(copiedStuff) {
// Nothing was copied
if(!copiedStuff) return;
if(!copiedStuff) { return; }
return that.manifest.addFolder(pluginAssets, "gitbook/plugins/"+plugin.name);
});
})
);
})
});
};
// Dump search index to disk
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gitbook",
"version": "0.6.2",
"version": "0.6.3",
"homepage": "http://www.gitbook.io/",
"description": "Library and cmd utility to generate GitBooks",
"main": "lib/index.js",