A Harp boilerplate for generating EPUB3 ebooks.
- Install Harp
This boilerplate is for Harp, the static web server with built-in preprocessing. Harp can flatten the preprocessed code—in this case, Jade, Stylus and Markdown—to HTML & CSS. Then, it can easily be turned into a .epub
file.
Install Harp globally:
sudo npm install harp -g
- Clone this boilerplate
Next, clone this boilerplate.
git clone https://github.com/kennethormandy/hb-epub3 ebook
cd ebook
- Compile your
.epub
using Harp
Then, using the OS’ zip
command, the generated folder can be compressed into a valid .epub
file.
harp compile . ebook; cd ebook; zip -X0 \../ebook.epub mimetype; zip -rDX9 \../ebook.epub * -x "*.DS_Store" -x mimetype; cd \../
Now, if you want to make some quick changes and just view them in the browser, you can serve a locally:
harp server
# The content is now visible at http://harp.nu:9000/OPS/book/content
- Properly support everything listed in
harp.json
- Further improve typographic defaults
- Automatically use any Markdown in
_content/
- Restore text sizing in iBooks
- Run against accessibility checklist