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 02-20-2019, 07:43 AM   #1201
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,758
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by BetterRed View Post
Thanks jackie, I noticed kiwidude was the last person to update the first post, but for some reason I thought you did the work. But now I think about it maybe you offered me your personal version.

The loss of current book highlight isn't critical, and it can be worked around by checking the suppress notify setting. Calibre version 4 is on the horizon, I don't have any insight as to whether it will necessitate any changes to PI's, if it does, whoever makes those changes can have a look at it then.



And if they're inclined, I'd like an option to strip selected dc elements from the opf - e.g, description, subjects, and identifiers.

BR
What I would like to see stripped (if there is another version) is ePub 3 specific code in both the XHTML files OPF.
JSWolf is offline   Reply With Quote
Old 02-26-2019, 01:09 PM   #1202
Rob557
Zealot
Rob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-books
 
Posts: 108
Karma: 810
Join Date: Jul 2012
Device: Kobo
modify epub - jumps to top of book list on completion

Quote:
Originally Posted by stumped View Post
... if i display a list of books e.g. i list those where read=n, then i process one item by using modify epub... when I accept the modify epub changes I am not then returned to that book in the list. I am returned to top of list ... with a long list the book I just modified is often nowhere to be seen as it's now off screen ...
Quote:
Originally Posted by ilovejedd View Post
... it scrolled to the top of the list but the book remained selected so pressing an arrow key got the (highlighted) book back ...
Quote:
Originally Posted by BetterRed View Post
@ilovejedd ... unchecking "Prompt to save ePubs" in the PI configuration
I frequently use "Modify ePub" and, similar to Stumped, earlier this year began experiencing the non-intuitive annoyance of the screen display always jumping to the start of the book list after I saved the result of the Modify ePub, but I always want to return to the modified book itself so that I can delete the original pre-modified version, and perhaps move to the next book on the list.

Although both approaches suggested by ILoveJedd and BetterRed provide an easy work-around, it still seems a strange and unnecessary glitch. Using the arrow keys (or scrolling down to find the still-highlighted book) works if I'm not distracted by something else and remember what it was I was doing. I'd prefer to not disable the "prompt to save ePubs" functionality because a) sometimes I've made a mistake and decide not to save the modified ePub, and b) auto-saving a problematic modification can have a domino effect by deleting e a prior original version (just ignore this last comment 'b' if not self-explanatory as explaining would just distract from the main consideration). Hopefully there is an easy answer to removing the glitch itself.

Last edited by Rob557; 02-26-2019 at 01:12 PM.
Rob557 is offline   Reply With Quote
Advert
Old 02-27-2019, 02:44 AM   #1203
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 JSWolf View Post
What I would like to see stripped (if there is another version) is ePub 3 specific code in both the XHTML files OPF.
You say that as if it’s a simple function. Far from it. I, for one, have no intention of going anywhere near that particular can of worms.

While it’s true that some EPUB 3 books are basically “EPUB 2 with a couple of tiny changes,” many actually take advantage of the enhanced capabilities of the EPUB 3 format. Those simply cannot be automagically downgraded to EPUB 2; such a change requires complex intervention which is far beyond the scope of the Modify EPUB plugin.

So, you can wish for it all you like, but you’d probably have better luck looking for dedicated conversion software or pleading for someone to create an entirely new plugin for that specific task.
Rev. Bob is offline   Reply With Quote
Old 04-21-2019, 08:26 AM   #1204
Bilal93
Junior Member
Bilal93 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Apr 2019
Device: SkyEpub
Great Plugin! This is very helpful!

But I have 2 more questions about it:
1) Is there a feature to remove html files with a certain name (e.g.: Last-chapter.xhtml)?
2) Is there a feature to change the page progression direction from rlt to ltr inside the opf file?
(changing: <spine toc="ncx" page-progression-direction="rtl">
to
<spine toc="ncx">)
or vice versa (ltr to rtl)?


Thank you so much in advance.
Bilal93 is offline   Reply With Quote
Old 04-21-2019, 03:40 PM   #1205
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,758
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Bilal93 View Post
Great Plugin! This is very helpful!

But I have 2 more questions about it:
1) Is there a feature to remove html files with a certain name (e.g.: Last-chapter.xhtml)?
2) Is there a feature to change the page progression direction from rlt to ltr inside the opf file?
(changing: <spine toc="ncx" page-progression-direction="rtl">
to
<spine toc="ncx">)
or vice versa (ltr to rtl)?


Thank you so much in advance.
1. No
2. No

But you can ue the Calibre editor to edit these sorts of things since it's very easy to do.
JSWolf is offline   Reply With Quote
Advert
Old 04-22-2019, 04:11 AM   #1206
Bilal93
Junior Member
Bilal93 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Apr 2019
Device: SkyEpub
Quote:
Originally Posted by JSWolf View Post
1. No
2. No

But you can ue the Calibre editor to edit these sorts of things since it's very easy to do.
Thank you, I know about this step. But I have more than 700 ePubs and I was wondering if there is a plugin to do them all together automatically as one bulk instead of opening them and changing them manually one by one. Do you know any plugin that can do that?

Appreciated.
Bilal93 is offline   Reply With Quote
Old 04-22-2019, 04:57 AM   #1207
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,631
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by Bilal93 View Post
Thank you, I know about this step. But I have more than 700 ePubs and I was wondering if there is a plugin to do them all together automatically as one bulk instead of opening them and changing them manually one by one. Do you know any plugin that can do that?

Appreciated.
As far as I know, this is the only plugin which modify automatically the content of the book (aside of adding jacket or ex-libris) , but I can be wrong.
Terisa de morgan is offline   Reply With Quote
Old 04-28-2019, 05:19 PM   #1208
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
I haven't been paying much attention to who's maintaining this one lately, but I found a bug in the plugin while working on a private project.

_remove_files_if_exist(), used for 'Remove iTunes files', 'Remove calibre bookmark files' and 'Remove OS artifact files' will only remove the first file found from each list.

Here's a fixed version that removes them all as (I assume) it should work. The change is the addition of a dirtied flag instead of returning immediately on file remove.
Code:
    def _remove_files_if_exist(self, container, files):
        '''
        Helper function to remove items from manifest whose filename is
        in the set of 'files'
        '''
        dirtied = False
        self.log('\tLooking for files to remove:', files)
        files = [f.lower() for f in files]
        for name in list(container.name_path_map.keys()):
            found = False
            if name.lower() in files:
                found = True
            if not found:
                for f in files:
                    if name.lower().endswith('/'+f):
                        found = True
                        break
            if found:
                self.log('\t  Found file to remove:', name)
                container.delete_from_manifest(name)
                dirtied = True
        return dirtied
JimmXinu is offline   Reply With Quote
Old 04-30-2019, 02:04 PM   #1209
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
@Bilal93 approached me to add some features to Modify ePub. Which I have.

Bilal93 has asked that I also make a public version containing the added features in case others find them useful.

Features added:
  • Add spine rtl - Make sure <spine> tag has attribute page-progression-direction="rtl".
  • Remove spine rtl - Make sure <spine> tag doesnt have attribute page-progression-direction="rtl".
  • Rename .html files .xhtml - Change any .html files to .xhtml.
  • Remove files named - Remove files with any of the names (comma separated) below. Case insensitive.

Click image for larger version

Name:	Capture.PNG
Views:	206
Size:	141.8 KB
ID:	171186

I also bumped the version number. I leave it up to the community whether these features are worth including in the general release.

EDIT: This version also addresses the _remove_files_if_exist() issue from my previous post.

Last edited by JimmXinu; 05-01-2019 at 06:58 PM. Reason: Remove obsolete test versions
JimmXinu is offline   Reply With Quote
Old 04-30-2019, 02:31 PM   #1210
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,631
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Thank you very much.
Terisa de morgan is offline   Reply With Quote
Old 04-30-2019, 06:41 PM   #1211
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,729
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Works for me on my existing settings, I also checked the html rename option.

Would it be possible to sneak in another feature : if 'Add/replace metadata jacket' is checked allow another option - 'Put jacket at end of book' - and act accordingly

As a general principle I think we should aim to replace the existing version if no adverse issues arise.

BR
BetterRed is offline   Reply With Quote
Old 04-30-2019, 08:52 PM   #1212
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
I hesitate on that one primarily for the 'slippery slope' factor.

And because my biggest incentive to do it is because the empty space in the 'Jacket' section is unsightly.
JimmXinu is offline   Reply With Quote
Old 05-01-2019, 07:11 AM   #1213
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
I think I have some “unpretty” mods on my machine that haven’t been merged into a release version yet. I’ll try to take a look in the next couple of days and, if so, splice them into this new edition.

Oh, and it might be worthwhile to add a reciprocal option for that extension change (Change *.xhtml to *.html), and it definitely strikes me as a good idea to include .htm and .xht in the mix. (Standardizing on .jpg/.jpeg would also be handy, and a generalized routine should be able to handle pretty much any “change this extension to that one” configuration.) Granted, that requires some checking for duplicate filenames, but I’d hope you’ve already got that built into the .html to .xhtml routine…

Last edited by Rev. Bob; 05-01-2019 at 07:24 AM.
Rev. Bob is offline   Reply With Quote
Old 05-01-2019, 03:11 PM   #1214
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 839
Karma: 2657572
Join Date: Jan 2017
Location: Poland
Device: Various
Quote:
Originally Posted by JimmXinu View Post
[*]Rename .html files .xhtml - Change any .html files to .xhtml.
This function not fix guide section in OPF file (links to .html files remain)
BeckyEbook is offline   Reply With Quote
Old 05-01-2019, 06:54 PM   #1215
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 BeckyEbook View Post
This function not fix guide section in OPF file (links to .html files remain)
That... is a good point.

Here's a version that also updates <guide><reference> tags pointing to renamed .xhtml files.

Quote:
Originally Posted by JimmXinu View Post
@Bilal93 approached me to add some features to Modify ePub. Which I have.

Bilal93 has asked that I also make a public version containing the added features in case others find them useful.

Features added:
  • Add spine rtl - Make sure <spine> tag has attribute page-progression-direction="rtl".
  • Remove spine rtl - Make sure <spine> tag doesnt have attribute page-progression-direction="rtl".
  • Rename .html files .xhtml - Change any .html files to .xhtml.
  • Remove files named - Remove files with any of the names (comma separated) below. Case insensitive.

I also bumped the version number. I leave it up to the community whether these features are worth including in the general release.

This version also addresses the _remove_files_if_exist() issue from my previous post.
EDIT: BTW, yes, .htm is also changed with that option.

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.

EDIT2: Implementation rejected by the current maintainer. Test version removed.

Last edited by JimmXinu; 05-03-2019 at 09:49 AM.
JimmXinu 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 09:37 PM.


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