Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-22-2021, 05:13 AM   #1
capink
Guru
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 658
Karma: 211740
Join Date: Aug 2015
Device: Kindle
[Editor Plugin] Editor Chains (**Experimental**)

For people familiar with the Action Chains plugin, this is a similar plugin for the calibre editor. It allows the user to chain multiple actions and run them together. Currently the plugin has only two builtin actions defined:

Currently Available Actions:
  • Tag Actions: Allows the user to locate individual tag(s) or a range(s) of tags, based on multiple criteria, and apply variety of actions to them. See below for examples of how to use this action.

    This action enables the user to specify criteria by applying a group of filters to tags, and supports subgroups with "and/or" operators.
  • Search and replace: This action is based on calibre editor's search and replace. I included this mainly to be able to do search and replace on multiple books, leveraging the editor's function replace mode. More on this on the section on how to integrate the plugin with the action chains plugin.


Integration with Action Chains:
If you have the latest version of Action Chains installed, you can run your editor chains on multiple books in you library. You need first to tun on the experimental mode in Action Chains plugin (Calibre > preferences > tweaks > plugin tweaks):

Code:
action_chains_experimental = True
After having done that, you should now see an action called "Run Editor Chain". (provided you installed Editor Chains plugin.)

Examples of how to use Tag Actions:
Below you can find links to two chains that you can import (Editor Chains > Add/Modify Chains > Right Click > Import Chain)
  • The first chain will match a range(s) of adjacent span tags that all share one similar class called "italic". This is an exact match, so it will not apply for spans containing other additional classes (although you can modify to do so if you want). And then, it merges all these spans into one span. You can download it from here.
  • The second chain goes one step further, by merging any adjacent spans with similar classes without having to specify what the classes are. You can download it from here.

Note: The criteria above makes sure there is no text between the spans that can break their continuity. But it still allows for text containing only white-space. You can refine this to include whatever punctuation characters you want, by modifying the regular expression in the text filters.

Note on Module Editor:
  • Similar to Action Chains plugin, this plugin provides a module editor for people who want to write their own actions. For information on how to write your own actions, see the comments in calibre_plugins.editor_chains.actions.base

Final Notes:
  • This is an experimental plugin. My knowledge of xhtml and other web technologies is not very deep. Things can go wrong, so always double check the results before saving.
  • The plugin does not have many builtin actions so it is intended more as a framework for people who can write their own actions. I will be adding actions as I need them. I encourage others who might write their actions to share them.
  • In Action Chains plugin there is an action called "Calibre Actions" that enables the user to select any calibre builtin action. It does not make sense to make a similar action in Editor Chains, since almost all editor actions are interactive (they pop up a dialog), and not suitable for use in a chain.
Attached Files
File Type: zip Editor Chains_0.4.1.zip (142.2 KB, 36 views)

Last edited by capink; 11-25-2021 at 05:44 AM.
capink is offline   Reply With Quote
Old 11-22-2021, 05:13 AM   #2
capink
Guru
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 658
Karma: 211740
Join Date: Aug 2015
Device: Kindle
reserved.
capink is offline   Reply With Quote
Advert
Old 11-22-2021, 05:14 AM   #3
capink
Guru
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 658
Karma: 211740
Join Date: Aug 2015
Device: Kindle
Attached are examples to "Tag Actions" chains.
Attached Files
File Type: zip merge italic spans.zip (1.5 KB, 33 views)
File Type: zip merge similar spans.zip (1.5 KB, 37 views)
capink is offline   Reply With Quote
Old 11-25-2021, 05:05 AM   #4
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 387
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
I think it could be very useful to me. I will give it a try.
Thank you in advance!
jbacelar is offline   Reply With Quote
Old 11-27-2021, 04:35 AM   #5
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 387
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
I have tried it with "Run Editor Chain" (until now it was impossible to modify something in several books at the same time) and it works great.
Thank you very much again!
jbacelar is offline   Reply With Quote
Advert
Old 11-28-2021, 04:17 AM   #6
capink
Guru
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 658
Karma: 211740
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by jbacelar View Post
I have tried it with "Run Editor Chain" (until now it was impossible to modify something in several books at the same time) and it works great.
Thank you very much again!
Nice to heat that . Make sure to backup and examine the results.
capink is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Editor Plugin] EpubCheck Doitsu Plugins 114 12-06-2021 07:27 AM
[Editor Plugin] LanguageTool Doitsu Plugins 7 12-12-2019 09:56 PM
[Editor Plugin] - Enabling 'Customize plugin' dialog directly from the Editor thiago.eec Development 7 01-09-2019 09:05 PM
Sample Plugin for the Editor DiapDealer Editor 77 12-10-2014 08:16 AM
Editor plugin question DiapDealer Development 2 07-28-2014 11:23 PM


All times are GMT -4. The time now is 07:13 PM.


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