Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 05-01-2019, 09:42 PM   #1216
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by JimmXinu View Post
And actually, no I didn't do a name collision check. In theory, it would be nice, but seriously, if your epub has chap01.htm and chap01.xhtml in the same dir in the same epub, you have bigger problems.
That’s a wonderful theory for primary content, but it can fail rather horribly when considering frontmatter, backmatter, and auto-generated content. (Example: An EPUB 3 toc.xhtml navigation document can happily coexist with a frontmatter toc.html table of contents. Similar content, different purposes, one visible to the user and one not, and overwriting one with the other will break the EPUB. This is not at all rare.) Plus, have you seen ebooks? Many of them do have big problems, and at the very least, our duty is to not make those worse.

A name collision check should be regarded as mission-critical, especially given the possibility of data loss and how trivial it is to fix. If a collision is found, just set up a counter and keep testing (name)_(counter).(extension) until you find an available name. Boom, done.

Last edited by Rev. Bob; 05-01-2019 at 09:46 PM.
Rev. Bob is offline   Reply With Quote
Old 05-01-2019, 10:28 PM   #1217
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,243
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JimmXinu View Post
And actually, no I didn't do a name collision check. In theory, it would be nice, but seriously, if your epub has chap01.htm and chap01.xhtml in the same dir in the same epub, you have bigger problems.
I've downloaded several books from one indie author that has the cover in titlepage.xhtml and the title page in titlepage.html. When I asked about this, her response was to blame calibre since she was using calibre to convert docx to epub and then modify epub to add the cover.
DNSB is offline   Reply With Quote
Old 05-01-2019, 10:47 PM   #1218
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,973
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Actually, I take it back--I did implement a collision detection, but all it does is raise an exception and crash out of changing that book. Then I promptly forgot about it apparently...

Given the complexities of finding and changing all the possible embedded URLs I, for one, am not interested trying to implement a increment-number-name version.
JimmXinu is offline   Reply With Quote
Old 05-02-2019, 10:29 PM   #1219
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by JimmXinu View Post
Given the complexities of finding and changing all the possible embedded URLs I, for one, am not interested trying to implement a increment-number-name version.
You mean the very same complexities that already exist with the extension change?

If you’re not already dealing with those, you shouldn’t be tinkering with the plugin at all; you’re half-assing it and breaking the plugin. If you are, adding an “okay, is THIS one taken?” loop/check is an insanely simple fix.

Do it right, or don’t do it at all.
Rev. Bob is offline   Reply With Quote
Old 05-03-2019, 07:03 AM   #1220
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
I'm not sure whether this helps or hinders ...

Good news: calibre has its own utility (rename_files in calibre.ebooks.oeb.polish.replace) for changing filenames inside an epub. This is the help info:
Code:
Rename files in the container, automatically updating all links to them.
:param file_map: A mapping of old canonical name to new canonical name, for
    example: :code:`{'text/chapter1.html': 'chapter1.html'}`.
Bad news: All calibre's own epub manipulation relies on using its standard EpubContainer class. Unfortunately kiwidude's Modify Epub plugin pre-dates EpubContainer so it has its own earlier version of a Container class.

I don't know how much work would be involved in getting the ME Container to use calibre.ebooks.oeb.polish.replace.rename_files.

Ideally ME needs a complete overhaul to use pure calibre container functionality for everything ... but that's not a trivial exercise.
jackie_w is offline   Reply With Quote
Old 05-03-2019, 09:49 AM   #1221
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,973
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Rev. Bob View Post
Do it right, or don’t do it at all.
Okay.
JimmXinu is offline   Reply With Quote
Old 05-06-2019, 08:37 AM   #1222
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Mass Style Sheet Replace?

I have a children's book series (55+ books).

The good news is that each has an identical style sheet, different name in each

The bad news is that the original style sheet doesn't look good (i.e. the way I'd like it), so I modified it.

I thought maybe the Conversion process might have some options, but didn't see any

Q: is there a way to do a mass replace of the style sheet? I've been editing one book at a time, but it's tedious, and if I fall into a routine I just know I'll miss something.

There are also 4 fonts in the books but I'm removing them (since I removed references to them in the CSS) and just using the reader choices
phossler is offline   Reply With Quote
Old 05-06-2019, 02:20 PM   #1223
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 195
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Here is one idea that I have not tried: The Modify ePub plug-in will work on multiple files at the same time. Among its configuration options, right next to "Remove Embedded Fonts" is an option for "Append Extra CSS."

If the plug-in appends your changed styles, the rules should separately override the previous rules. Worth a try?
Brett Merkey is offline   Reply With Quote
Old 05-06-2019, 03:35 PM   #1224
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Anything is worth trying -- thanks for the idea

I tried the PI, but the checkbox for Append Extra CSS wants the file in my Calibre Defaults Directory. I tried putting my new CSS file into the one that the Preference "Open calibre configuration directory" gave me, but it didn't seem to take

Any idea what "calibre Defaults" meant?
phossler is offline   Reply With Quote
Old 05-06-2019, 05:17 PM   #1225
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,730
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by phossler View Post
Anything is worth trying -- thanks for the idea

I tried the PI, but the checkbox for Append Extra CSS wants the file in my Calibre Defaults Directory. I tried putting my new CSS file into the one that the Preference "Open calibre configuration directory" gave me, but it didn't seem to take

Any idea what "calibre Defaults" meant?
AFAIK the Modify ePub->Append Extra CSS option will use whatever you have in Preferences->Conversion->Common options->Look and Feel->Styles->Extra CSS

BR
BetterRed is offline   Reply With Quote
Old 05-06-2019, 05:19 PM   #1226
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 195
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
tried the PI, but the checkbox for Append Extra CSS wants the file in my Calibre Defaults Directory
I did my own test and absolutely nothing happened. The checkbox had no effect either way. In fact, the help page for the plug-in does not mention that option. Appears to be seriously broken feature...
Brett Merkey is offline   Reply With Quote
Old 05-06-2019, 05:24 PM   #1227
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,730
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Brett Merkey View Post
I did my own test and absolutely nothing happened. The checkbox had no effect either way. In fact, the help page for the plug-in does not mention that option. Appears to be seriously broken feature...
See ==>> https://www.mobileread.com/forums/sh...&postcount=490

Took me all of 10 secs to find that with a thread search for Extra CSS.

BR
BetterRed is offline   Reply With Quote
Old 05-06-2019, 05:30 PM   #1228
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,730
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
And in the first post for the plugin there's this:

Quote:
Version 1.3.9 - 01 Sep 2013
Fix for users who do not have any Extra CSS in their defaults trying to use the Append Extra CSS option.

Version 1.3.8 - 30 Aug 2013
Add a "Append extra CSS" option to allow appending any css style information from Preferences->Common Options->Look & Feel->Extra CSS to each .css file in the ePub.
BR
BetterRed is offline   Reply With Quote
Old 05-06-2019, 05:35 PM   #1229
Brett Merkey
Not Quite Dead
Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.Brett Merkey ought to be getting tired of karma fortunes by now.
 
Posts: 195
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
Quote:
Add a "Append extra CSS" option to allow appending any css style information from Preferences->Common Options->Look & Feel->Extra CSS to each .css file in the ePub.
Excellent and critical information. Perhaps it may eventually be added to the Help page of the plug-in. I have v. 1.3.13
Brett Merkey is offline   Reply With Quote
Old 05-06-2019, 05:58 PM   #1230
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,730
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Brett Merkey View Post
Excellent and critical information. Perhaps it may eventually be added to the Help page of the plug-in. I have v. 1.3.13
I had forgotten there was a help page

Append extra CSS is not the only option not documented there, which is odd, because that update was done by Kiwidude. In its 'defence' it does have this at then end of the page

Quote:
Further Help

For any problems, issues or obtaining the latest version of this plugin, please refer to the MobileRead forums for calibre plugins.
There are some updates to the PI in progress, I'll ask JX and Rev.Bob if they want to update the Help doco.

Can you confirm the option works - i.e. it will use the extra CSS in Preferences.

BR
BetterRed is offline   Reply With Quote
Reply

Tags
modify epub


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1251 07-07-2025 09:13 PM
[GUI Plugin] Open With kiwidude Plugins 404 02-21-2025 05:42 AM
[GUI Plugin] Manage Series kiwidude Plugins 167 07-28-2024 03:07 PM
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


All times are GMT -4. The time now is 02:31 AM.


MobileRead.com is a privately owned, operated and funded community.