02-12-2014, 08:35 PM | #1 |
Grand Sorcerer
Posts: 27,614
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
So I just have to ask...
Any plans/provisions for editor plugins?
Custom routines able to be applied to current/selected files would be a dream come true! |
02-12-2014, 09:14 PM | #2 |
creator of calibre
Posts: 44,019
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Sure adding support for plugins into the editor is fairly trivial, since it's in python. But I dont still have a good idea for what sorts of functionality to expose via the plugin API, since no one has floated any particular ideas for plugins yet. What would you write plugins to do?
|
Advert | |
|
02-13-2014, 08:23 AM | #3 |
Grand Sorcerer
Posts: 27,614
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
My own personal needs wouldn't be that elaborate: just the ability to launch a dialog that lets me input various criteria to parse/modify the (x)html of the selected file(s). Mostly for the purposes of cleaning: removal of empty/extraneous spans/divs, etc...
Give me a menu to launch a plugin's dialog (if it needs a dialog), a handle to the selected file (or a list of the selected files), and maybe a way examine the results of my meddling before "committing" and I'd be happy as a pig in mud! |
02-13-2014, 08:41 AM | #4 |
creator of calibre
Posts: 44,019
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Sure, should be no problem. I'll get around to it eventually. Writing the plumbing for the plugins is a bit of a chore, it will have to wait for when I'm bored with other stuff.
|
02-13-2014, 08:54 AM | #5 | |
Grand Sorcerer
Posts: 27,614
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
Advert | |
|
02-13-2014, 09:55 AM | #6 | |
Well trained by Cats
Posts: 29,981
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Because your 'to do' bin gains 2 items for every 1 you take out. I can't imagine you have time to get 'bored' |
|
02-13-2014, 10:02 AM | #7 |
creator of calibre
Posts: 44,019
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
02-13-2014, 12:01 PM | #8 |
Grand Sorcerer
Posts: 27,614
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Probably wouldn't hurt to toss in hooks to the NCX and OPF as well.
Would it make sense to be able to access all files in the ebook via some sort of iterable dictionary or class structure? Code:
for sheet in book.css: if sheet.name == file_name_parsed_from_link_in_current_xml: do_stuff Just spitballin'. |
02-13-2014, 12:16 PM | #9 |
Well trained by Cats
Posts: 29,981
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
:baloon3: I would like a text sequencing tool
That could generate sequences in a Search and Replace situation since REGEX can't do this(math or increment). Search; (<body.*>) Replace: \1<h3 class="chapno"> Chapter <sequential value> </h3> |
02-13-2014, 03:27 PM | #10 |
Bookish
Posts: 924
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
|
I like a recording facility to record / playback repeating tasks like often used search & replace sequences. Kind of macro's as in popular editors.
|
02-13-2014, 05:18 PM | #11 | |
null operator (he/him)
Posts: 20,683
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Would spell checkers be a good candidate for plugins, i.e. different PI's for different languages. BR |
|
02-13-2014, 07:02 PM | #12 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
|
02-13-2014, 08:07 PM | #13 |
null operator (he/him)
Posts: 20,683
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Which 'That' would that be then Macros or language specific spell checkers ?
I would have thought that some day the former would be in the core, I don't care if its plugged in or bolted on BR Last edited by BetterRed; 02-13-2014 at 08:11 PM. |
02-13-2014, 09:35 PM | #14 |
....
Posts: 1,547
Karma: 18068960
Join Date: May 2012
Device: ....
|
|
02-13-2014, 10:30 PM | #15 |
null operator (he/him)
Posts: 20,683
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Strewth - that'd be bonzer cobber, should only take a wee while.
Last edited by BetterRed; 02-13-2014 at 10:32 PM. |