diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-04-04 16:51:28 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-04-04 16:51:28 +0200 |
commit | 57e2595a3ea65de63822d105010b2f75cd50636c (patch) | |
tree | affad469a82e9668ffa5819ce26af9ca6ac0efd0 /lib/generate | |
parent | cb9a0b82ba0478b9a5b37de6f920edff474312e1 (diff) | |
parent | b1314273bb44648547adbd1e2b7b724903ac6020 (diff) | |
download | gitbook-57e2595a3ea65de63822d105010b2f75cd50636c.zip gitbook-57e2595a3ea65de63822d105010b2f75cd50636c.tar.gz gitbook-57e2595a3ea65de63822d105010b2f75cd50636c.tar.bz2 |
Merge pull request #20 from mintbridge/github-host-url
Adding config option for github host
Diffstat (limited to 'lib/generate')
-rw-r--r-- | lib/generate/index.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/generate/index.js b/lib/generate/index.js index 315ceda..ee5ffc4 100644 --- a/lib/generate/index.js +++ b/lib/generate/index.js @@ -11,16 +11,18 @@ var generate = function(root, output, options) { var files, summary, navigation, tpl; options = _.defaults(options || {}, { - // Book title, description + // Book title, keyword, description title: null, description: "Book generated using GitBook", // Origin github repository id - github: null + github: null, + githubHost: 'https://github.com/' }); - if (!options.github || !options.title) return Q.reject(new Error("Need options.github and options.title")); - + if (!options.github || !options.title) { + return Q.reject(new Error("Need options.github and options.title")); + } // Clean output folder return fs.remove(output) @@ -39,7 +41,7 @@ var generate = function(root, output, options) { files = _files; if (!_.contains(files, "SUMMARY.md") || !_.contains(files, "README.md")) { - return Q.reject(new Error("Invalid gitbook repository: need SUMMARY.md and README.md")); + return Q.reject(new Error("Invalid gitbook repository, need SUMMARY.md and README.md")); } }) @@ -65,7 +67,8 @@ var generate = function(root, output, options) { githubAuthor: options.github.split("/")[0], githubId: options.github, - + githubHost: options.githubHost, + summary: summary, allNavigation: navigation } |