summaryrefslogtreecommitdiffstats
path: root/lib/models
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-04-26 21:48:56 +0200
committerSamy Pesse <samypesse@gmail.com>2016-04-26 21:48:56 +0200
commit27d387e3e1d2389594670babad3afab6359c15fc (patch)
tree0f48a058bbbd4999ca7dd68839ed7ec764ca90ae /lib/models
parent7b7e4f60bc12e01d397487424635a9426990884c (diff)
downloadgitbook-27d387e3e1d2389594670babad3afab6359c15fc.zip
gitbook-27d387e3e1d2389594670babad3afab6359c15fc.tar.gz
gitbook-27d387e3e1d2389594670babad3afab6359c15fc.tar.bz2
Load i18n translations
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/output.js30
1 files changed, 21 insertions, 9 deletions
diff --git a/lib/models/output.js b/lib/models/output.js
index 3e8dab8..10df67b 100644
--- a/lib/models/output.js
+++ b/lib/models/output.js
@@ -4,10 +4,21 @@ var Book = require('./book');
var Output = Immutable.Record({
book: Book(),
+
+ // Map of plugins to use (String -> Plugin)
plugins: Immutable.OrderedMap(),
+
+ // Map pages to generation (String -> Page)
pages: Immutable.OrderedMap(),
+
+ // List assets (String)
assets: Immutable.List(),
- options: Immutable.Map()
+
+ // Option for the generation
+ options: Immutable.Map(),
+
+ // Internal state for the generation
+ state: Immutable.Map()
});
Output.prototype.getBook = function() {
@@ -30,6 +41,10 @@ Output.prototype.getAssets = function() {
return this.get('assets');
};
+Output.prototype.getState = function() {
+ return this.get('state');
+};
+
/**
Return logegr for this output (same as book)
@@ -40,17 +55,14 @@ Output.prototype.getLogger = function() {
};
/**
- Create an Output instance from a book and a set of options
+ Update state of output
- @param {Book} book
- @param {Object} options
+ @param {Output} output
+ @param {Map} newState
@return {Output}
*/
-Output.createForBook = function(book, options) {
- return new Output({
- book: book,
- options: options
- });
+Output.updateState = function(output, newState) {
+ return output.set('state', newState);
};
module.exports = Output;