07-03-2012, 08:20 AM | #196 | ||
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
I may be wrong but I believe the dialog is written that way because it means exactly what it says. Quote:
|
||
07-03-2012, 08:43 AM | #197 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
I can probably make the message a bit more explicit along the lines of what Walt has said - something like "Modify ePub has modified x file(s) into a temporary location. Proceed with replacing the versions in your library?"
|
07-03-2012, 08:51 AM | #198 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
|
07-03-2012, 09:12 AM | #199 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
First things first - no I am not going to add an explicit option on the UI for removing @page - for all the reasons stated perfectly by Idolse.
I do agree that writing a blank @page {} section for when you have your defaults set to zero is a minor bug. I also found a bug in the existing version of the code which would cause the plugin to error - if you set your default margins to zero, and run it against an ePub which has margins specified (i.e. an epub that has been converted by calibre). However in looking through and fixing/experimenting with all of this, I have a bigger question, which perhaps Kovid can answer. When I set margins to zero and do a calibre conversion, calibre will write out an @page directive with margin-top: 0 and margin-bottom: 0. Now if JSWolf had his way, he doesn't want that to exist. This plugin behaves differently to calibre - if a margin is set to zero, it does not write any style attribute out for it - i.e. rather than writing "margin-top: 0" it will omit the margin-top atribute from that style. With my fixes/enhancements then if the style declaration has no other attributes then the style itself gets deleted, and if the css file has no other styles then the css file gets deleted and any links removed to it from other files. Which negates the need for any special "Remove @page" type of option completely. However my big question is whether that the right thing to be doing? It is my understanding of the html standard that it is possible for a *browser* to enforce margins on a document. Does such a thing exist in the ePub reader world? The advantage of what Kovid's conversion logic does is that it ensures that the browser margins if they exist will get override to be zero. If you instead omit the margin-top: 0, then according to the standard the document will inherit the "browser's" top margin. My concern is that if we continue the "zero margins means make sure no attribute in the style for it" approach then it actually becomes counter-productive and the users end up with a bigger margin that they can't control? I don't care about cosmetic reasons on whether an @page directive does or does not exist in the css file. However I am *very* interested in the implications of a zero margin versus an unspecified margin in an @page directive. Thoughts? |
07-03-2012, 09:20 AM | #200 |
creator of calibre
Posts: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
In calibre if you set the margins to less than zero then no @page is written out.
|
07-03-2012, 09:35 AM | #201 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Ahhh... *less* than zero is the trick, thanks, that now makes sense.
I think this plugin should follow along those same lines then. If your defaults are set to less than zero, then it will do its *current* behaviour of omitting attributes from the style, and with my fixes propagate that to removing the style if it has no other attribution, then the css file if it has no other styles. So with the new version JSWolf should just be able to run the plugin again against your epubs and have all the stuff you don't like disappear. Note however if the @page or body style has other attributes set on it (like padding for instance) it will stay in the css file with just those attributes, just like it does today. If you set your calibre margin defaults to either zero or a positive value, then the plugin will *always* write out that value, which is different to how it behaves today but inline with what a calibre conversion does. Hopefully that is the right middle ground on this. |
07-03-2012, 10:40 AM | #202 | |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Can we please have the @page and the body dealt with separately? While yes, I want the @page changed, I may not want the body style changed. |
|
07-03-2012, 10:52 AM | #203 | |
Well trained by Cats
Posts: 29,817
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
If you set a Negative page margin, you get NO @page |
|
07-03-2012, 10:58 AM | #204 |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
07-03-2012, 12:21 PM | #205 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@JSWolf - in the gui if you use the spin up/down buttons to set your defaults, if you go one less than 0.0 it will say "No margin" (under the covers calibre stores that as -1.0). As far as this plugin will be concerned any negative value will be fine.
|
07-03-2012, 12:38 PM | #206 |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I just found a bug in the plugin. I had the Remove unused image files checked and it removed the cover image. Yes, the cover image is used.
See PM for a link to the book that shows the problem. Last edited by JSWolf; 07-03-2012 at 12:41 PM. |
07-03-2012, 01:57 PM | #207 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Beta for v1.2.8
@JSWolf - nice find and thanks for the PM. The issue is caused by there being multiple children in that svg container area of the xhtml page. I'm including the fix in this attachment.
To anyone - can someone please have a quick sanity check of the attachment to make sure you are happy with the changes made to the margins handling. As noted it still does not do anything about margins for named body classes, but all the other behaviour discussed recently should be in place. @diapdealer - I haven't forgotten your @import url() thing for xpgt files, but it is a non-trivial change that I will put in a following release, given the bug just found in remove unused images I want this version out there asap. Last edited by kiwidude; 07-04-2012 at 02:51 PM. |
07-03-2012, 02:12 PM | #208 | |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
As for the @page, it seems to be working now. So we can add or remove as desired based on the margin settings. This work well. |
|
07-03-2012, 02:29 PM | #209 | |
Grand Sorcerer
Posts: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
07-03-2012, 02:30 PM | #210 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@JSWolf - Yes it considers all images for deletion, yes as you found in the epub you sent me thumbnails if not referenced anywhere will also get deleted, and yes if it decides an image is unused it removes all references to it from the manifest, be it items, spine or guide. Glad to hear the margins stuff is working well too.
|
Tags |
modify epub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Quality Check | kiwidude | Plugins | 1184 | 04-17-2024 06:17 PM |
[GUI Plugin] Open With | kiwidude | Plugins | 403 | 04-01-2024 08:39 AM |
[GUI Plugin] Manage Series | kiwidude | Plugins | 166 | 02-13-2024 11:31 AM |
Modify ePub plugin dev thread | kiwidude | Development | 346 | 09-02-2013 05:14 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |