HamePub
, (*1)
HemePub's living example is hametuha. It's a WordPress site which is able to publish it's contents to ePub., (*2)
If you maintain PHP-based web apps, HamePub will help your multi-publishing., (*3)
NOTICE: HamePub means nothing sexual. I wrote like this, because it sounds meaningful in Japanese.(HamePubはePub作成のためのPHPライブラリであり、エッチな出来事が起きるパブではありません), (*4)
How to Install
Use composer., (*5)
composer require haemtuha/hamepub
How to Use
You can user HamePub for dynamic ePub generation, but suppose that you have a static HTML collection like below:, (*6)
dist
- index.html
- content.html
- colophon.html
- css
- style.css
- img
- cover.jpg
- graph.jpg
- barchart.png
Now we have CLI tool hamepub
and you can run CLI command in your working directory., (*7)
# Dump setting file.
./vendor/bin/hamepub init setting.json
Next, edit JSON file like below:, (*8)
{
"root": "./dist/",
"id": "my-first-ebook",
"isbn": "1234567890123",
"title": "My First Book",
"author": "Fumiki Takahashi",
"target": "./out",
"published": "2023-01-01T23:00:00Z",
"direction": "ltr",
"cover": "./dist/img/cover.jpg"
}
Then, run command., (*9)
./bendor/bin/hamepub generate
You will get ePub file my-first-ebook.epub
., (*10)
Resources
Below are important resources., (*11)
Acknowledgement
The sample picture is credited by Public Domain Pictures and Nadi Lindsay., (*12)
License
This library is released under MIT., (*13)