diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-03-31 22:54:22 -0700 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-03-31 22:54:22 -0700 |
commit | eed1dfb243fb1fff9755eb73722e89a225160a1e (patch) | |
tree | c62483217bbf989689bcd854006376dbc9c95259 | |
parent | aefbfaf057da43f57afa1e8a34bdba1ddb2d0a73 (diff) | |
download | gitbook-eed1dfb243fb1fff9755eb73722e89a225160a1e.zip gitbook-eed1dfb243fb1fff9755eb73722e89a225160a1e.tar.gz gitbook-eed1dfb243fb1fff9755eb73722e89a225160a1e.tar.bz2 |
Only convert markdown file from the navigation
-rwxr-xr-x | bin/gitbook.js | 4 | ||||
-rw-r--r-- | lib/generate/index.js | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/bin/gitbook.js b/bin/gitbook.js index ad251f2..6cb4798 100755 --- a/bin/gitbook.js +++ b/bin/gitbook.js @@ -50,9 +50,9 @@ prog ); }) .then(function(output) { - console.log(output); + console.log("Done!"); }, function(err) { - console.log(err.stack, err); + console.log(err.stack || err); }); }); diff --git a/lib/generate/index.js b/lib/generate/index.js index b9d3d9b..b9edcc4 100644 --- a/lib/generate/index.js +++ b/lib/generate/index.js @@ -71,11 +71,11 @@ var generate = function(root, output, options) { // Copy file and replace markdown file .then(function() { - console.log(files, summary); return Q.all( _.chain(files) .map(function(file) { if (!file) return; + var _html = file.replace(".md", ".html"); // Folder if (file[file.length -1] == "/") { @@ -84,8 +84,8 @@ var generate = function(root, output, options) { ); } - // Markdown file - else if (path.extname(file) == ".md") { + // Markdown file (only from the summary) + else if (path.extname(file) == ".md" && navigation[_html] != null) { return tpl(file, file.replace(".md", ".html")); } |