mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-24 03:16:40 +00:00
Add method setSummary to book
This commit is contained in:
@@ -191,6 +191,18 @@ Book.prototype.addLanguageBook = function(language, book) {
|
||||
return this.set('books', books);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Set the summary for this book
|
||||
|
||||
@param {Summary}
|
||||
@return {Book}
|
||||
*/
|
||||
Book.prototype.setSummary = function(summary) {
|
||||
return this.set('summary', summary);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Change log level
|
||||
|
||||
|
||||
@@ -30,8 +30,6 @@ function parseSummary(book) {
|
||||
|
||||
var summary = Summary.createFromParts(file, result.parts);
|
||||
|
||||
|
||||
|
||||
// Insert readme as first entry
|
||||
var firstArticle = summary.getFirstArticle();
|
||||
if (!firstArticle || firstArticle.getRef() !== readmeFile.getPath()) {
|
||||
@@ -41,9 +39,8 @@ function parseSummary(book) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Set new summary
|
||||
return book.set('summary', summary);
|
||||
return book.setSummary(summary);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user