cdhigh / KindleEar

Aggregates RSS and web content(Calibre recipe), sends to Kindle, and includes an e-ink optimized online reader.
http://cdhigh.github.io/KindleEar/
MIT License
2.73k stars 630 forks source link

How do you generate the mobi/epub books? #548

Closed starkshaw closed 5 years ago

starkshaw commented 5 years ago

Hi all,

I have found this project from here. However, I am currently using a similar product (Reabble). But I am not very pleased with the font it is using. Like this image:

kindleear-rss

So, considering the fact that now Kindle supports custom font, I want to generate my own RSS magazine in order to customize the font in it. I wonder how do you generate books in your implementation? I see you have Calibre included, did you use that to generate the book? What is the template like?

Thanks.

cdhigh commented 5 years ago

Yes, The Calibre module can embed a font in book, but I didn't implement the feature yet. You can try it youself and contribute to KindleEar project.

The relevant parts are 'apps/Work/Worker.py' and 'lib/calibre/ebooks/mobi'

  1. lib/makeoeb.py -> getOpts() -> set mobi_file_type to 'both'
  2. add a manifest of font to OEB instance
  3. modify a css to use the font you added. (maybe not need to do it)
starkshaw commented 5 years ago

Hi,

I think you may misunderstood me.

I meant not embedding the font to the book, but to use the fonts stored in /fonts/. I think a simple CSS can do.

What I am curious is how to generate this “magazine” type of book and what format is it natively in, and what structure of the files are in the package.

Thanks.

cdhigh commented 5 years ago

You can browser code in worker.py. mobi = htmls + images + css.

magazine type is a feature of kindle reader, it shows the contents of book as magazine type when a bit in head of book is set to 'magazine'.