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 01-25-2017, 01:25 PM   #121
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 15,727
Karma: 83282878
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by phossler
and thought that your PI is smart and could delete the class="something" only inside <img> tags
It wouldn't work for that case even if the img tag was added. You can delete a tag (and its closing tag), you can change a tag to a different tag, and you can change all attributes of a tag to something else ... but the plugin doesn't currenty have the sophisication to alter/delete one particular attribute of a tag.

When it comes to attributes, you can either wipe them completely, copy the existing ones to a new tag, or you can replace all the attributes with something else (static), but you can't modify/delete one attribute while retaining the rest. I'm not "capturing" the attributes of each tag processed for reuse in a replace function.

In other words: if you wanted to delete the class attribute of all img tags of the class "blahblahblah", you'd have to delete ALL the attibutes of img tags of the class "blahblahblah". Probably not very handy.

Last edited by DiapDealer; 01-25-2017 at 01:30 PM.
DiapDealer is offline   Reply With Quote
Advert
Old 01-25-2017, 02:06 PM   #122
phossler
Guru
phossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensionsphossler can understand the language of future parallel dimensions
 
Posts: 703
Karma: 51620
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
@Terisa - thanks, I'm 0% familiar with python and PI's

@DiapDealer -- gotcha - I'll just do it the regular way

I mostly use your PI to remove empty <span> and <div> tags and it works wonderfully for the basic things I do
phossler is offline   Reply With Quote
Old 01-25-2017, 02:29 PM   #123
Terisa de morgan
Wizard
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: 4,058
Karma: 4080089
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Aura, Kobo Aura One, XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by phossler View Post
@Terisa - thanks, I'm 0% familiar with python and PI's
I wasn't at the beginning, but writing software was my job (now, only papers ) and one of my hobbies
Terisa de morgan is offline   Reply With Quote
Old 01-25-2017, 03:48 PM   #124
Terisa de morgan
Wizard
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: 4,058
Karma: 4080089
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Aura, Kobo Aura One, XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
I've checked, it works OK for me... and my config windows was already resized, so I think I've open it at some moment.

Thank you, it saves me to have to modify the plugin each time you publish a new plugin (not hard work in this case, more in other ones...)

And thank you for the plugin, I use it every time I clean a book in calibre (every book which goes to my reader).
Terisa de morgan is offline   Reply With Quote
Old 01-25-2017, 04:58 PM   #125
BetterRed
null operator
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: 8,277
Karma: 6993173
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DiapDealer View Post
@BetterRed: the plugin's menu entry should now have the same functionality as the Toolbar entry. Users shouldn't have to use the Toolbar entry to configure the plugin any more. Please make sure that is the case.


Still think the Convert..., Edit..., and Smarten options should be in a Diap's Toolbag flyout - but that's presumably a PI framework issue, I can't think of another multipurpose calibre plugin.*

If I were to use this PI, rather than Tag Mechanic, I'd probably be Robinson Crusoe in wanting to use it from the menu rather than a toolbar So no need to do anything further for me.

* apart from Job Spy

BR
BetterRed is offline   Reply With Quote
Advert
Old 01-26-2017, 09:08 AM   #126
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 15,727
Karma: 83282878
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BetterRed View Post
Still think the Convert..., Edit..., and Smarten options should be in a Diap's Toolbag flyout - but that's presumably a PI framework issue, I can't think of another multipurpose calibre plugin*
That's entirely on me. The shiny, new Editor Plugin framework advertised the ability to create multiple Tools within one plugin, and I had to make sure it worked as advertised.

They really should be split into three separate plugins (and the Span Div Editor renamed to match the Sigil version), but that's a lot of work/time for something that would look and behave exactly as it did before from a user perspective. Maybe someday, though. *shrug*
DiapDealer is offline   Reply With Quote
Old 01-26-2017, 05:02 PM   #127
BetterRed
null operator
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: 8,277
Karma: 6993173
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DiapDealer View Post
That's entirely on me. The shiny, new Editor Plugin framework advertised the ability to create multiple Tools within one plugin, and I had to make sure it worked as advertised.

They really should be split into three separate plugins (and the Span Div Editor renamed to match the Sigil version), but that's a lot of work/time for something that would look and behave exactly as it did before from a user perspective. Maybe someday, though. *shrug*


Never liked Swiss army knives. Whenever I needed to pick a stone from Dobbin's offside front hoof, the wife was invariably using the bodkin to skin a rabbit for the evening stew - or filing her nails

BR
BetterRed is offline   Reply With Quote
Old 01-29-2017, 11:41 AM   #128
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 15,727
Karma: 83282878
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Another beta version for testing.

Changes to all three tools:
The configuration dialog is available via the plugin menu as well as the Toolbar menus.


Changes to the Span/Div Editor tool:

1) the consolidation of tons redundant code--all of which makes it easier to maintain and dead-simple to add new tags.

2) made the tag/attribute customization dialog dynamically multi-column so it still fits on lower-resolution screens.

3) fixed a bug that would butcher html comments under certain conditions.

If someone could please verify that I didn't inadvertently break something else with my changes before I update the first post with the new version, I'd appreciate it.

EDIT: Removed beta attachment and published new version to first post.

Last edited by DiapDealer; 01-30-2017 at 03:49 PM.
DiapDealer is offline   Reply With Quote
Old 02-04-2017, 03:14 PM   #129
pmorris
Member
pmorris began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Mar 2008
Location: Yucca Valley, California
Device: Kindle Keyboard (K3)
Uh, I'm probably being very shortsighted, but... how does it work now? When I click on the plugin (in Calibre), I am given a choice of checking or unchecking a box for single or (I presume) multiple files, and Customization, with a plethora of options(?). But I do not see how to identify what I specifically want to do and how to apply it. For example, suppose I want to replace in every file, any instance of <span class="calibre6"> with <i>. How is that done with the updated plugin? Or is by some chance my install screwed up? It certainly feels as if something is missing...

BTW, thanks for all the hard work and being so responsive!
pmorris is offline   Reply With Quote
Old 02-04-2017, 03:27 PM   #130
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 15,727
Karma: 83282878
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by pmorris View Post
Uh, I'm probably being very shortsighted, but... how does it work now? When I click on the plugin (in Calibre), I am given a choice of checking or unchecking a box for single or (I presume) multiple files, and Customization, with a plethora of options(?). But I do not see how to identify what I specifically want to do and how to apply it. For example, suppose I want to replace in every file, any instance of <span class="calibre6"> with <i>. How is that done with the updated plugin? Or is by some chance my install screwed up? It certainly feels as if something is missing...

BTW, thanks for all the hard work and being so responsive!
I see what you mean when launching from the plugin menu. You can't actually launch the plugin itself! That's a pretty serious bummer.

While I figure out what went wrong there, remember that you can still launch the plugin(s) normally from the Toolbar. Which I imagine is how most people are doing it. Otherwise they'd probably be screaming at me.
DiapDealer is offline   Reply With Quote
Old 02-05-2017, 12:18 PM   #131
pmorris
Member
pmorris began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Mar 2008
Location: Yucca Valley, California
Device: Kindle Keyboard (K3)
Hah! Never occurred to me to add the plugin to the toolbar. Duh. Once I figured out how to do that, I'm copacetic! Thanks for the hint!
pmorris 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
Sample Plugin for the Editor DiapDealer Editor 77 12-10-2014 07:16 AM
Diaps Editing Toolbag.zip Index Error phossler Editor 2 10-01-2014 08:05 PM
Editor plugin question DiapDealer Development 2 07-28-2014 10:23 PM
japi - a text editor capable of editing ePub directly hekkel ePub 5 02-20-2009 08:46 AM


All times are GMT -4. The time now is 08:10 PM.


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