05-02-2011, 06:26 PM | #136 |
Grand Sorcerer
Posts: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Why? If you remove the CSS that is causing the margins to show up, then they won't show up. Seems to me that writing an empty file is very close to equivalent to deleting it.
|
05-02-2011, 06:38 PM | #137 | |
calibre/Sigil Developer
Posts: 4,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
Either you convert them using that Calibre change introduced in 0.7.53, which removes the margins but potentially does "other stuff" to your book as well like flattened css etc. That was the main thing I was referring to in my post. Of course an alternative is to use Tweak ePub and manually do it, is that what you were referring to? Certainly that is a possible alternative. The third option is to have an option in Quality Check which automates what you would do with Tweak ePub, thereby reducing the manual effort required. Or am I missing the point? |
|
05-02-2011, 06:42 PM | #138 | |
Grand Sorcerer
Posts: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
The problem with this approach is that some tags may reference a style sheet that no longer exists. That isn't supposed to be a problem, but "isn't supposed to" isn't the same as "won't". |
|
05-02-2011, 06:43 PM | #139 | |
Grand Sorcerer
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
The drawback would be that because the xpgt is still there it wouldn't be obvious whether it had already been "neutralised". [Edit: sorry I was too slow Emptying the file sounds easier. It's an XML rather than CSS file, if it makes any difference. Last edited by jackie_w; 05-02-2011 at 06:49 PM. |
|
05-02-2011, 07:02 PM | #140 |
calibre/Sigil Developer
Posts: 4,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Ok, so now we say the "Check xpgt file" becomes a search for epubs that have a non-empty xpgt file, and a "Remove selected xpgt file" option wipes the contents of it.
I'm flying blind on this one - I have no idea what an xpgt file is, experienced for myself the problems it causes or know what problems any particular approach to "fixing" it has so all input welcomed . All I know is my vague memory from another thread where people didn't like them much for a margins issue which Calibre conversions now override. |
05-02-2011, 07:20 PM | #141 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Let me poke around I should be able to provide you with before calibre conversion and after calibre conversion xpgt files.
|
05-02-2011, 08:15 PM | #142 | |
Well trained by Cats
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Mostly, I just blow the file away when I find it with Sigil (takes care of the Manifest). The normal stylesheet prevails. If I want to pass Flightcrew/EPUBcheck, I need to remove all 'Link..." from all the files. 1)so the Quality check could just locate suspect files and let the user use OpenWith to deal individually with the book 2)An option to Auto repair when it finds a victim . |
|
05-02-2011, 09:18 PM | #143 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
FYI because I said I would find a before and after for you Here is a page-template.xpgt file before calibre's conversion: Spoiler:
Here is the same page-template.xpgt file after calibre removed the margins: Spoiler:
Here is the contents of the page-template.xpgt file that I zeroed out and used in my reader. Spoiler:
|
|
05-02-2011, 11:05 PM | #144 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
For removing adobe margins there is a class that does this, RemoveAdobeMargins(object) in calibre.ebooks.oeb.transforms.page_margin. Kovid added this a few weeks back as Dwanthny mentioned. It requires an oeb object though, which isn't something the current plugin is really creating when it extracts an epub.
An epub specific plugin which extracts to OEB and does all these epub specific checks/transformations might make more sense, and would be simpler to integrate into Calibre later, and it fits in pretty well with the existing Tweak Epub option which is just begging to be expanded. |
05-03-2011, 05:36 AM | #145 | |
calibre/Sigil Developer
Posts: 4,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
However I guess the questions I have are these. Firstly, how would you identify that an ePub requires a particular remedy? Does tweak ePub also gain the ability to search across your library for books that fit certain criteria? Secondly, tweak ePub is a single book feature. What about performing bulk operations? So you identify somehow a bunch of books that need certain actions applied, you don't really want to go through doing them one by one. It is almost like you would want a convert type of screen leading to the actions running as a background job. Or maybe like metadata download it is just a list of checkboxes of actions to perform... I am just curious as to what the scope should be and how such future integration should work. I am not in any way averse to splitting out ePub specific functionality into a separate plugin, there are a number of reasons why that makes sense. So quality check would remain focused on metadata, and leave content up to the ePub plugin. Beyond the existing released jacket features of quality check I haven't coded any of the recent suggestions as yet so doing a separate plugin is no drama for me. Perhaps you may want to write it which would be one less thing for me to support. I would just like to be sure that however we split things out that the ability to do bulk searches and updates is retained. |
|
05-04-2011, 01:18 AM | #146 | |||
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
All good questions.
Quote:
Quote:
Quote:
|
|||
05-04-2011, 05:01 AM | #147 |
calibre/Sigil Developer
Posts: 4,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Interesting. It is a fair point that (other than check and fix file size for which no alternate method to fix was available) QC doesn't currently have any remedy functions. Putting it into a separate plugin would also solve one of the other headaches I was having about some menu items being selection based and others running on your whole library. As it would be the case that QC functions would all just be whole library based and what you do with the results is up to you. Such as individual tweak ePub editing or doing as a batch.
So i guess what I could do is write a plugin that a bit like book conversions will run in the background on your ePub books to apply various transformations. It would work on your selected books, and give you a very simple dialog of checkboxes of stuff you want it to do with select none and all buttons. Then I would make sure each of those functions is coded to work independently. Then if it is deemed appropriate in future this whole plugin could just become an item on the tweak submenu. And the existing tweak dialog could offer similar functionality reusing that part of the code. Then it will be up to Quality Check as to how many of these things it offers "Check" functions for. It may only be a subset, the two plugins can grow independently. How does that sound for a plan? |
05-04-2011, 05:10 AM | #148 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
The fact that your willing to take this on makes it sound like one heck of a good plan to me.
|
05-04-2011, 05:26 AM | #149 |
calibre/Sigil Developer
Posts: 4,601
Karma: 2092290
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Haha, well, maybe. I will take a look at the tweak ePub code first to see if what it does is compatible with what I had in mind of getting the oeb object to do manipulations on the files and then putting humpty dumpty back together again afterwards without breaking anything.
|
05-04-2011, 11:16 AM | #150 | |
Well trained by Cats
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
My envisioned work flow: Run the Quality tool Use the 'Create Catalog' against the results, to make a "To Do Catalog" Manually make the changes to select files. Throw away the 'To Do' list when done |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Search the Internet | kiwidude | Plugins | 424 | Yesterday 12:16 PM |
[GUI Plugin] Open With | kiwidude | Plugins | 402 | 03-16-2024 11:44 PM |
[GUI Plugin] Clipboard Search | kiwidude | Plugins | 24 | 03-16-2024 11:06 PM |
[GUI Plugin] Kindle Collections (old) | meme | Plugins | 2070 | 08-11-2014 12:02 AM |
[GUI Plugin] Book Sync **Deprecated** | kiwidude | Plugins | 111 | 06-07-2011 07:47 PM |