Quote:
Originally Posted by ldolse
Calibre's preferences are hard-coded to pts.
If you want no margins in @page or body, then set your calibre preferences under 'page setup' in common conversion options to have all the margins zero - this will cause the plugin to work exactly as the initial implementation I posted did - any margins in @page or body will simply be deleted.
Otherwise, the plugin will delete all existing margins in body or @page, and then replaces them with the pt based margins specified in Calbre's preferences. It only puts the new margin settings in @page, so all margins set on body are always removed.
Capnm is correct in the extremely rare case that the epub css has multiple @page statements, some using 'ID', they will all be re-written, but any using an ID will just have them removed. I'm actually inclined to think that @page statements with an ID is invalid css anyway, but we'll see if someone else can provide some further enlightenment on that point. @page statements using a psuedo selector like :first would actually be ignored.
@JSWolf, I chose to put them in @page because this is the advice I've read from epub guru's like pdurrant, Kovid, and Jelby. I believe @page is more focused on device page boundaries vs. the entire text, which is what body will do. I would have liked to be able to research it more, but try googling @page - big fail. Removing the xpgt file entirely is a bit outside of the scope of this plugin, as it's focused on non/minimally-destructive changes. As Jelby has pointed out in the epub sub-forum, there are some potentially good uses for it, such as detecting whether ADE is the renderer and creating some work-around css styles that only it will render.
Edit - one last point I didn't see - if you don't like Calibre specifying top and bottom margins, simply set those to zero under page setup. That should eliminate them during conversions and with this plugin.
|
The idea was to REMOVE @page and not add one. So if there is an @page in the CSS, it gets dumped and if there isn't, it doesn't get added. The problem is you state is that you add @page if there isn't one and remove it if there is one. That's not going to work. We don't know if there is or isn't one. I just want it gone. Now if I run Modify ePub again, the @page is not touched. It should be gone. If you want, make an option to add/modify @page. But don't just add it in. I want to get rid of it. So please make an option to dump @page. As it is now, the @page/body option is a major (serious) bug that needs to go or be fixed. As it is written, the option is to rewrite @page/body and if there is none, adding it is incorrect based on the what the option is said to do. You cannot rewrite something that does not exist. Adding it if it's not there is not rewriting it. My need is to remove @page where it is be it in some CSS or XML. I'm not needing the body style modified as I have to fix that by hand anyway.