mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-29 05:29:02 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7fd7732345 | |||
| 960ef4d945 | |||
| 92523fb4b5 | |||
| 66bb46df22 | |||
| 0454710d3b | |||
| c9a31cc987 | |||
| f03c316274 | |||
| 001a4f91be |
@@ -1,5 +1,8 @@
|
||||
# Release notes
|
||||
|
||||
## 1.4.1
|
||||
- Fix command 'install' without arguments
|
||||
|
||||
## 1.4.0
|
||||
- Add command `gitbook install` to install plugins from book.json
|
||||
- `package.json` is no longer necessary
|
||||
|
||||
@@ -16,6 +16,11 @@ GitBook can be installed from **NPM** using:
|
||||
$ npm install gitbook -g
|
||||
```
|
||||
|
||||
Create the directories and files for a book from its [SUMMARY.md](https://github.com/GitbookIO/gitbook#book-format) file using
|
||||
```
|
||||
$ gitbook init
|
||||
```
|
||||
|
||||
You can serve a repository as a book using:
|
||||
|
||||
```
|
||||
@@ -52,9 +57,10 @@ Here are the options that can be stored in this file:
|
||||
// It's not advised this option in the book.json
|
||||
"generator": "site",
|
||||
|
||||
// Book title and description (defaults are extracted from the README)
|
||||
// Book metadats (somes are extracted from the README by default)
|
||||
"title": null,
|
||||
"description": null,
|
||||
"isbn": null,
|
||||
|
||||
// For ebook format, the extension to use for generation (default is detected from output extension)
|
||||
// "epub", "pdf", "mobi"
|
||||
|
||||
@@ -51,6 +51,11 @@ var makeBuildFunc = function(converter) {
|
||||
|
||||
// Exit process with failure code
|
||||
process.exit(-1);
|
||||
})
|
||||
.then(function() {
|
||||
// Prevent badly behaving plugins
|
||||
// from making the process hang
|
||||
process.exit(0);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@@ -83,6 +83,8 @@ build.command(prog.command('serve [source_dir]'))
|
||||
build.commandEbook(prog.command('install [source_dir]'))
|
||||
.description('Install plugins for a book')
|
||||
.action(function(dir, options) {
|
||||
dir = dir || process.cwd();
|
||||
|
||||
console.log("Install plugins in", dir);
|
||||
genbook.config.read({
|
||||
input: dir
|
||||
|
||||
@@ -17,9 +17,10 @@ var CONFIG = {
|
||||
// Configuration file to use
|
||||
"configFile": "book",
|
||||
|
||||
// Book title and description (defaults are extracted from the README)
|
||||
// Book metadats (somes are extracted from the README by default)
|
||||
"title": null,
|
||||
"description": null,
|
||||
"isbn": null,
|
||||
|
||||
// For ebook format, the extension to use for generation (default is detected from output extension)
|
||||
// "epub", "pdf", "mobi"
|
||||
|
||||
@@ -30,6 +30,7 @@ Generator.prototype.finish = function() {
|
||||
"--cover": that.options.cover,
|
||||
"--title": that.options.title,
|
||||
"--comments": that.options.description,
|
||||
"--isbn": that.options.isbn,
|
||||
"--authors": that.options.author,
|
||||
"--publisher": "GitBook",
|
||||
"--chapter": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter ')]",
|
||||
|
||||
+14
-1
@@ -64,7 +64,20 @@ var getFiles = function(path) {
|
||||
module.exports = {
|
||||
list: getFiles,
|
||||
readFile: Q.denodeify(fs.readFile),
|
||||
writeFile: Q.denodeify(fs.writeFile),
|
||||
//writeFile: Q.denodeify(fs.writeFile),
|
||||
writeFile: function(filename, data, options) {
|
||||
var d = Q.defer();
|
||||
|
||||
try {
|
||||
fs.writeFileSync(filename, data, options)
|
||||
} catch(err) {
|
||||
d.reject(err);
|
||||
}
|
||||
d.resolve();
|
||||
|
||||
|
||||
return d.promise;
|
||||
},
|
||||
mkdirp: Q.denodeify(fsExtra.mkdirp),
|
||||
copy: Q.denodeify(fsExtra.copy),
|
||||
remove: Q.denodeify(fsExtra.remove),
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitbook",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.2",
|
||||
"homepage": "http://www.gitbook.io/",
|
||||
"description": "Library and cmd utility to generate GitBooks",
|
||||
"main": "lib/index.js",
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ staticBase }}/images/apple-touch-icon-precomposed-152.png">
|
||||
<link rel="shortcut icon" href="{{ staticBase }}/images/favicon.ico" type="image/x-icon">
|
||||
{% if options.isbn %}
|
||||
<meta name="identifier" content="{{ options.isbn }}" scheme="ISBN">
|
||||
{% endif %}
|
||||
{% block head %}{% endblock %}
|
||||
{{ htmlSnippet("head:end")|default("") }}
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user