Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make converting a kepub-formatted epub a no-op #73

Open
dstaley opened this issue Oct 8, 2021 · 3 comments
Open

Make converting a kepub-formatted epub a no-op #73

dstaley opened this issue Oct 8, 2021 · 3 comments

Comments

@dstaley
Copy link

dstaley commented Oct 8, 2021

Comparing the output of passing a kepub from the Kobo store through kepubify, there's a pretty large diff of extremely minor changes that, if I'm understanding correctly, don't actually affect how the book renders.

It'd be nice to make passing a kepub-formatted epub a no-op (other than adding the kepub.epub extension), either by default or through a CLI flag.

@pgaskin
Copy link
Owner

pgaskin commented Oct 8, 2021

If you're referring to the whitespace and tag node name casing/attribute changes, those are a inherent part of how kepubify works. The HTML5 decoder follows the spec, so it ends up being subject to some normalization (the same way as any compliant renderer, which indeed doesn't make any difference in how it renders, nor even how it's represented internally when re-parsed). The encoder follows the spec except that it makes a few minor changes (see the html branch for these) to ensure the output is polyglot XHTML/HTML.

I suppose I could allow .kepub.epub to be passed to the --copy/-x option if that would work for you.

@dstaley
Copy link
Author

dstaley commented Oct 8, 2021

Forgive my ignorance as I'm a newbie to the Kobo community, but is there not a way to determine if a given epub is already a kepub outside of the filename? If not, I think we can close this as the changes made by kepubify are generally a good idea, and I wouldn't mind if it ran on my Kobo-sourced epubs as well :)

@pgaskin
Copy link
Owner

pgaskin commented Oct 8, 2021

There is a way to determine it via the koboSpans, and I could abort a conversion from there if it's already a kepub. That would be a breaking change, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants