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 12-25-2025, 08:14 AM   #121
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 595
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
This is a great Christmas gift for me. Thank you very much.
nqk is offline   Reply With Quote
Old 04-11-2026, 09:00 AM   #122
Capricorn
Belgian Pommes Frites
Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.
 
Posts: 147
Karma: 35038
Join Date: Jan 2012
Device: Pocketbook Touch HD
I have been using some simple editor chains for some time now. Some search&replace items. That works well, and saves me time (thanks). But I would like to add some actions that only work on the opf file eg remove page-map. Is this possible or not? My knowledge of editor chains is still in its infancy. And I did not see any posts that clearly indicate this possibility.
Capricorn is offline   Reply With Quote
Old 04-11-2026, 11:01 AM   #123
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,339
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by Capricorn View Post
I have been using some simple editor chains for some time now. Some search&replace items. That works well, and saves me time (thanks). But I would like to add some actions that only work on the opf file eg remove page-map. Is this possible or not? My knowledge of editor chains is still in its infancy. And I did not see any posts that clearly indicate this possibility.
Yes, you can achieve this using filename filters. See the example below: it searches only in the OPF and removes the <tours> element.
Attached Thumbnails
Click image for larger version

Name:	filters.png
Views:	37
Size:	19.4 KB
ID:	222454  
thiago.eec is offline   Reply With Quote
Old 04-14-2026, 02:13 AM   #124
Capricorn
Belgian Pommes Frites
Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.
 
Posts: 147
Karma: 35038
Join Date: Jan 2012
Device: Pocketbook Touch HD
Oh man....that is so cool. I did not know this fuctionality was there.
Thank you.
Capricorn is offline   Reply With Quote
Old 04-14-2026, 06:35 AM   #125
Capricorn
Belgian Pommes Frites
Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.Capricorn turned on, tuned in, and dropped out.
 
Posts: 147
Karma: 35038
Join Date: Jan 2012
Device: Pocketbook Touch HD
Thiago, In Post #99 you provide code to solve invaild IDs. That is something I would like to automate too, but how does this code work? I have no clue as to the steps needed to do so? I have read your post and the ones before and after, but I am still clueless. My knowledge is definitely not up to scratch. Any chance as to a step by step explanation how to do this? Would be much appreciated. Thanks in advance.
Capricorn is offline   Reply With Quote
Old Yesterday, 08:25 AM   #126
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,339
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by Capricorn View Post
Thiago, In Post #99 you provide code to solve invaild IDs. That is something I would like to automate too, but how does this code work? I have no clue as to the steps needed to do so? I have read your post and the ones before and after, but I am still clueless. My knowledge is definitely not up to scratch. Any chance as to a step by step explanation how to do this? Would be much appreciated. Thanks in advance.
First you need to create the Module via Manage Modules > Create > Replace the existing text by this:

Spoiler:

Code:
from qt.core import (Qt, QApplication)

from calibre.ebooks.oeb.polish.check import parsing
from calibre.ebooks.oeb.polish.check.main import fix_errors

from calibre_plugins.editor_chains.actions.base import EditorAction

class ReplaceIDs(EditorAction):

    name = 'Replace IDs'
    headless = True

    def run(self, chain, settings, *args, **kwargs):
        container = chain.current_container
        QApplication.setOverrideCursor(Qt.WaitCursor)
        QApplication.processEvents()
        errors = parsing.check_ids(container)
        changed = fix_errors(container, errors)
        QApplication.restoreOverrideCursor()


Then, you need to create the chain, via Add/Modify Chains > Plus sign (+) > Choose a name > Gear icon (Settings) > You can choose an icon or not > Plus sign (+) > Select the new line > Double click in the Action field > User actions > Replace IDs > Ok.

Now, the new action will appear as option in the main menu. You can also use it as part of more complex chain, like the one you asked about before, doing search and replace.

Last edited by thiago.eec; Yesterday at 08:28 AM.
thiago.eec is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Editor Plugin] EpubCheck Doitsu Plugins 230 04-10-2026 03:19 AM
[Editor Plugin] LanguageTool Doitsu Plugins 17 04-20-2024 02:21 PM
[Editor Plugin] - Enabling 'Customize plugin' dialog directly from the Editor thiago.eec Development 7 01-09-2019 08:05 PM
Sample Plugin for the Editor DiapDealer Editor 77 12-10-2014 07:16 AM
Editor plugin question DiapDealer Development 2 07-28-2014 10:23 PM


All times are GMT -4. The time now is 06:23 AM.


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