mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-28 13:08:57 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ba2134c480 | |||
| 4705548860 | |||
| 7d51ae3689 |
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user