Giter Site home page Giter Site logo

Comments (10)

debiedowner avatar debiedowner commented on May 21, 2024 3

It's not about CSS, the reason is explained here: https://www.mobileread.com/forums/showthread.php?t=276477

The KePub reader assumes that the first HTML file of the book is a cover page and automatically displays it in a special full-screen mode that is only suitable for images. If the publisher has included other material in the first HTML file after the cover, then that gets displayed full-screen too.

If you know how to do it then editing the book and splitting it into seperate files so that the first HTML file contains nothing but the cover image should fix the problem, or if the book doesn't have a proper cover page then using Calibre to add one is usually faily easy. Otherwise siideload the book as an ePub instead, as the ePub reader doesn't have this problem.

(Although if the publisher has combined the cover with other material into one file, then chances are they will have done the same thing in other parts of the book such as including multiple chapters in one file, and that can cause other problems with things like TOC and reading stats.)

I can confirm that the chapters included in the second html file and later were displayed fine in the kepubified ebook. I was able to get the initial chapters displayed correctly as well, by simply moving them to the second html file. There is probably a more elegant solution; I am not very familiar with the epub format yet. The cover still did not appear correctly, but then the original Gutenberg epubs did not display the correct cover on Kobo either.

I don't know if this fix would possible to do easily with kepubify (perhaps just adding a dummy html file at the start would work?), if not, kepubify will just have to have the disclaimer that it can only kepubify epubs that already obey the kepub constraints.

Or maybe, since Gutenberg epubs are popular and only they seem to have this issue, maybe kepubify or another tool can include a fix specifically for them, perhaps fixing the cover issue as well, if anybody is interested in implementing that.

from kepubify.

pgaskin avatar pgaskin commented on May 21, 2024 2

I had a look at some Gutenberg ebooks, and it seems their 0.5em margin on the body has a more specific CSS selector (body and a class) than the kepubify margin selector (just body).

Kepubs require a base margin of 0 for it to display properly, and I need to have a look at the margin overriding to see if I need to do more than make the kepubify selector more specific (html>body).

To fix this temporarily, you can remove the margin from the CSS in the epub.

from kepubify.

pgaskin avatar pgaskin commented on May 21, 2024 2

I've decided that a workaround for this is in-scope for kepubify, since it's a limitation imposed by the KEPUB format.

I will implement this for kepubify v4, which I'm planning to release sometime in the next week or two.

from kepubify.

pgaskin avatar pgaskin commented on May 21, 2024 1

That looks quite unusual. I'm going to look at the epub later this week and try and figure out why it does this in the kepub reader.

And no, --fullscreenfixes is not necessary anymore, as it seems to have been fixed. There's no harm leaving it on though.

from kepubify.

pgaskin avatar pgaskin commented on May 21, 2024 1

Thanks for the info! I'd rather not add too many book specific workarounds to kepubify (and I'm trying to avoid adding ones to fix malformed epubs), but this seems to be one I could do.

I'll probably add an option to add a dummy cover page if the first page in the flow is more than a certain number of words or elements. Adding it will be simple enough, as all I'd need to do is add the doc to the manifest items and add the page to the beginning of the spine in the package document. In fact, I could probably do it using regexps if I needed to (kepubify tries to avoid touching the structure as much as possible), because I only need to insert an element directly after the start tag of each.

from kepubify.

pgaskin avatar pgaskin commented on May 21, 2024 1

I've implemented this option in the pgaskin/rewrite-conversion-code branch. If you want to test this before I release v4, you can build kepubify from that branch.

from kepubify.

jasonperry avatar jasonperry commented on May 21, 2024

I have the same issue, version 2.3.1 installed with brew on MacOS 10.14.3, Aura H2O v2, Software version 4.12.12111. Converted epub from (http://www.gutenberg.org/ebooks/31)

The left margin goes to the very edge, it overflows the right edge when justifying, and margin settings have no effect.

from kepubify.

pgaskin avatar pgaskin commented on May 21, 2024

Does adding the option --css "body {margin: 0 !important}" fix this issue?

from kepubify.

jasonperry avatar jasonperry commented on May 21, 2024

I tried it for http://www.gutenberg.org/ebooks/863 and http://www.gutenberg.org/ebooks/31 and it did not work for either. I had previously tried deleting several margin settings manually inside the epub CSS, also with no luck, but I wasn't sure if I was hitting the right places.

from kepubify.

pgaskin avatar pgaskin commented on May 21, 2024

I will be releasing this later this week.

from kepubify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.