Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ Then put this in your code:
Publisher name (optional)
- `cover`:
Book cover image (optional), File path (absolute path) or web url, eg. `"http://abc.com/book-cover.jpg"` or `"/User/Alice/images/book-cover.jpg"`
- `description`:
Description or blurb of the book (optional)
- `collection`:
If the book is part of a collection or series. An object with `name`, `type` and `position`, . eg. `{name: "Lord of the rings", type: "set", position: 1}`

**Object variable definition:**

- `name`:
String of the collections name.
- `type`:
Can be either `"set"` which is another name for a collection or `"series"`.
- `position`:
An numeric value that determines it's position. Can be a decimal number but not negative.
- `output`
Out put path (absolute path), you can also path output as the second argument when use `new` , eg: `new Epub(options, output)`
- `version`:
Expand Down
2 changes: 1 addition & 1 deletion index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion lib/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class EPub
return

@options = _.extend {
description: options.title
publisher: "anonymous"
author: ["anonymous"]
tocTitle: "Table Of Contents"
Expand All @@ -53,6 +52,8 @@ class EPub
customNcxTocTemplatePath: null
customHtmlTocTemplatePath: null
version: 3
collection: null
description: null
}, options

if @options.version is 2
Expand All @@ -72,6 +73,8 @@ class EPub
@options.author = ["anonymous"]
if not @options.tempDir
@options.tempDir = path.resolve __dirname, "../tempDir/"
if @options.collection != null && (@options.collection.name == undefined || @options.collection.type == undefined || @options.collection.position == undefined)
@options.collection = null
@id = uuid()
@uuid = path.resolve @options.tempDir, @id
@options.uuid = @uuid
Expand Down
35 changes: 27 additions & 8 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading