Generate an ePub book from a simple plaintext descriptor.
Install via:
npm install -g epubify
Copy this somewhere:
Name: Simple ePub demonstration
Cover: cover.png
Image-Content: simple/chapter_image.png
Content: simple/ctnt.html
Author: nabijaczleweli
Date: 2017-02-08T15:30:18+01:00
Language: en-GB
Modify to your liking, then, assuming you put the file in "example/test.epupp" and want to write the result to "out/test.epub", run:
epubify example/test.epupp out/test.epub
For more detailed usage information and tag list, see the manpage, and for a full guide see the webpage.
The original in AWK.
A rewrite in Rust.
A rewrite in C++.
A rewrite in Scala.
Extends Error
Generic book parsing error.
Parse specified file content into a Book
instance.
Parameters
Returns Book
Format string to parse RFC3339 with moment
.
Type: string
Regex for extracting chapter titles.
Type: RegExp
Check whether a file with the specified path exists.
Parameters
path
string The file for whose existence to check.
Returns boolean Whether the specified file exists.
Get content of string-content, having provided the content of that string-content (yes).
Parameters
content
string String data of that string content.
Returns string String content to include in e-book.
Get img filler for image-content.
For full image string content one need do epubify.util.string_content(util.image_content_string(img_path))
.
Parameters
img_path
string Packed path of image.
Returns string Stringified <img> tag.
Get e-book ID for the specified relative path.
Parameters
file_path
string Pathname specified in"Content"
key.
Returns string E-book ID to use for content.
Get packed e-book path for the specified relative path.
Parameters
file_path
string Pathname specified in"Content"
key.
Returns string E-book path to use for content.
Get e-book ID for the specified URL.
Parameters
url
URLfile_path
Pathname specified in"Remote-*"
key.
Returns string E-book ID to use for content.
Get packed e-book path for the specified URL.
Parameters
url
URL Pathname specified in"Remote-*"
key.
Returns string E-book path to use for content.
Get MIME-type for the specified MIME type.
Parameters
pathname
string File to get MIME type for.
Returns string MIME type for that file.
A unified config.
Constructor: parse commandline arguments.
Parameters
argv
Array<string> command-line argument array without executable nor script name.out
Console (optional, default: globalconsole
object)
The descriptor file to read from.
Type: string
The file to which output the resulting ePub.
Type: string
Relative root for file paths.
Type: string
Separator for keys/values.
Default: ":"
.
Type: string
Whether to try to parse non-RFC3339 date formats.
Default: false
.
Type: boolean