kemayo / leech

Turn a story on certain websites into an ebook for convenient reading
MIT License
154 stars 24 forks source link

Make sure output colors work for ebook readers #52

Closed kemayo closed 2 years ago

kemayo commented 3 years ago

Sites which allow colored text can very easily create output that's impossible to read on a greyscale device like a kindle.

Common cases are stories that color dialog for some reason, and LitRPGs with their blue boxes.

Example story: https://www.royalroad.com/fiction/37426/level-up-hero/chapter/580555/save-the-girl-save-the-world-part-1 has completely illegible boxes.

I suspect that stripping any mention of color and background-color would work for most cases. Maybe even stripping all style attributes?

TheMetalCenter commented 3 years ago

I ran into this problem with the Wandering Inn, but it is a very easy fix in Calibre during conversion to mobi or azw3. Just check to remove color under the look/feel style option (Off the top of my head, it might be under a different menu).

I could be a nice option to include in the jsons though, I imagine some people would want to keep colors if reading on a tablet.

kemayo commented 2 years ago

I added stripping of all colors in 4242aa6f633754267fb31e67dcfc08f32e5344e2. There's a new option --[no-]strip-colors that'll let you opt out if it's hurting a specific book.

There's room for improvement, but I think this'll be good enough.