summaryrefslogtreecommitdiffstats
path: root/lib/output/generateBook.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-07-11 16:27:22 +0200
committerSamy Pessé <samypesse@gmail.com>2016-07-11 16:27:22 +0200
commit6b103f4532c23b4855025029ff966abc65092ff3 (patch)
treea7374739337d90e22cbad9375d6ab50ec437d92d /lib/output/generateBook.js
parentd4fa5c18a8049986e224d98738390aac90c411be (diff)
downloadgitbook-6b103f4532c23b4855025029ff966abc65092ff3.zip
gitbook-6b103f4532c23b4855025029ff966abc65092ff3.tar.gz
gitbook-6b103f4532c23b4855025029ff966abc65092ff3.tar.bz2
Fix #1408: fix i18n in website generator and add tests for it
Diffstat (limited to 'lib/output/generateBook.js')
-rw-r--r--lib/output/generateBook.js54
1 files changed, 26 insertions, 28 deletions
diff --git a/lib/output/generateBook.js b/lib/output/generateBook.js
index 3c10b1a..46712bd 100644
--- a/lib/output/generateBook.js
+++ b/lib/output/generateBook.js
@@ -13,13 +13,12 @@ var generateAssets = require('./generateAssets');
var generatePages = require('./generatePages');
/**
- Process an output to generate the book
-
- @param {Generator} generator
- @param {Output} output
-
- @return {Promise<Output>}
-*/
+ * Process an output to generate the book
+ *
+ * @param {Generator} generator
+ * @param {Output} output
+ * @return {Promise<Output>}
+ */
function processOutput(generator, startOutput) {
return Promise(startOutput)
.then(preparePlugins)
@@ -133,27 +132,26 @@ function processOutput(generator, startOutput) {
}
/**
- Generate a book using a generator.
-
- The overall process is:
- 1. List and load plugins for this book
- 2. Call hook "config"
- 3. Call hook "init"
- 4. Initialize generator
- 5. List all assets and pages
- 6. Copy all assets to output
- 7. Generate all pages
- 8. Call hook "finish:before"
- 9. Finish generation
- 10. Call hook "finish"
-
-
- @param {Generator} generator
- @param {Book} book
- @param {Object} options
-
- @return {Promise<Output>}
-*/
+ * Generate a book using a generator.
+ *
+ * The overall process is:
+ * 1. List and load plugins for this book
+ * 2. Call hook "config"
+ * 3. Call hook "init"
+ * 4. Initialize generator
+ * 5. List all assets and pages
+ * 6. Copy all assets to output
+ * 7. Generate all pages
+ * 8. Call hook "finish:before"
+ * 9. Finish generation
+ * 10. Call hook "finish"
+ *
+ *
+ * @param {Generator} generator
+ * @param {Book} book
+ * @param {Object} options
+ * @return {Promise<Output>}
+ */
function generateBook(generator, book, options) {
options = generator.Options(options);
var state = generator.State? generator.State({}) : Immutable.Map();