06-05-2011, 12:41 PM | #1 |
Connoisseur
Posts: 52
Karma: 38
Join Date: Jun 2011
Device: Kindle 3
|
Gui Plugin for Cleaning Ebooks, Fast
Ebook Cleaner About: Many ebooks have messy and inconsistent formatting.
The original html/css structure may have been messy. Pile on to that the fact that many ebooks undergo conversions, and you are left with an impossible tangle of classes and elements
Now, you can fix it up using Sigil or Word... but it will take you many long hours... Also, attempting Word's grammer check will find issues with alot of grammer the author intended; you'll spend alot of time skipping through grammer errors. The goal of this plugin is to provide tools and methods to significantly shorten the time needed to restore and clean up an ebook. Version 0.0.6: Some major improvements in the interface and coding... also reverted back to webkit. Anyways, I think it is now 'stable', just lacking in features... Note: The plugin now only supports HTMLZ for the time being, as I don't have time to deal with ideosyncresis (how'd you spell that?) in epub format. HOWEVER, it can save to epub format (in the next update, at least). I realize that calibre's HTMLZ doesn't support all tags/css. But, for the most part (at least in my opinion, feel free to express/explain yours), an ebook that is aestheticly pleasing to the reader tries to avoid overkill in the formatting. Usage:
Plans:
Issues: I'm sure there a million others... please post them so I can deal with them. Last edited by burbleburble; 07-05-2011 at 12:46 PM. Reason: Updated Plugin to version 0.0.6 |
06-05-2011, 12:49 PM | #2 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I lack the time to read your code (given that I've never used Tk), but if you have any specific questions on PyQt, I'll try to help.
|
Advert | |
|
06-05-2011, 02:06 PM | #3 |
Addict
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
I applaud your efforts and wish someone could come in and help.
Something to clean up bad markup - check those epubs generated by Word export to HTML and how many font definitions they have on every single page- , CSS and removing embedded fonts would be a terrific feature. |
06-06-2011, 04:02 AM | #4 |
Connoisseur
Posts: 52
Karma: 38
Join Date: Jun 2011
Device: Kindle 3
|
Well, I took a crash course in Qt (read large portions of its manual), found some great tutourials, and have some idea of whats going on.
I do however have some specific questions to start with:
Thank you for your help! Last edited by burbleburble; 06-06-2011 at 04:09 AM. |
06-06-2011, 08:18 AM | #5 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I would suggest using QWebView instead, which renders HTML5 using the WebKit engine. You can set the contentEditable property in the HTML to make some fields editable. And QWebView will emit signals when a user clicks on HTML links. So you can essentially make a web app inside Qt
|
Advert | |
|
06-06-2011, 08:42 AM | #6 |
Connoisseur
Posts: 52
Karma: 38
Join Date: Jun 2011
Device: Kindle 3
|
OK, Thank You!!!
I looked at the QWebView and PyQt4 examples, and it seems to fit my needs perfectly. So, within a week or two, I hope to have a test version of the plugin ready for development and feedback. |
06-06-2011, 09:27 AM | #7 |
Connoisseur
Posts: 52
Karma: 38
Join Date: Jun 2011
Device: Kindle 3
|
I started working with the QWebView, and I cant figure out how to make only portions of the html editable.
If this isn't possible, is there a way to guarentee that an entire word is deleted (treated as one entity?), not just one letter; for example: given a label 'PATTERN01', the user shouldn't be able to delete part of it, rather the whole thing or none of it? |
06-06-2011, 10:28 AM | #8 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
http://blog.whatwg.org/the-road-to-h...ontenteditable
Simply set it on the element you want to be editable. Demo: http://html5demos.com/contenteditable |
06-14-2011, 11:12 AM | #9 |
Connoisseur
Posts: 52
Karma: 38
Join Date: Jun 2011
Device: Kindle 3
|
Question 1) I tried building the plugin files as per the instructions in the calibre manual.
Yet, every time I try adding it (even trying to add the demo plugin in the manual) I get an error: Code:
'module' object has no attribute 'InterfacePlugin' Question 2) How do a)I make it that the user runs the plugin on a book, and b)check that the book is an epub, and c) retrieve the html from the epub? Thank you for any help! Last edited by burbleburble; 06-14-2011 at 11:17 AM. |
06-14-2011, 11:24 AM | #10 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
1) post the whole error message you are getting. WHat calibre version are you on?
2-) Look at the tweak epub plugin for how to do these things (actions/tweak_epub.py in the calibre source code) |
06-14-2011, 11:29 AM | #11 |
Connoisseur
Posts: 52
Karma: 38
Join Date: Jun 2011
Device: Kindle 3
|
Thank you for responding so quickly.
I am using calibre version 0.8.4, portable build. The error is exactly: FrameTitle: ERROR: Unhandled Exception Message: AttributeError:'module' object has no attribute 'InterfacePlugin' Details: Traceback (most recent call last): File "site-packages\calibre\gui2\preferences\plugins.py", line 294, in add_plugin File "site-packages\calibre\gui2\preferences\plugins.py", line 369, in check_for_add_to_toolbars File "site-packages\calibre\customize\__init__.py", line 539, in load_actual_plugin AttributeError: 'module' object has no attribute 'InterfacePlugin' |
06-14-2011, 11:51 AM | #12 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There was a bug in 0.8.4 calibre portable with regard to plugins, upgrade to 0.8.5
|
06-14-2011, 12:08 PM | #13 |
Connoisseur
Posts: 52
Karma: 38
Join Date: Jun 2011
Device: Kindle 3
|
Thank you Kovid.
To people in general: (a)Does anyone have any ideas of how to make an intuitive, easy to use css property selector (not just a clutter of 100 comboboxes for every css property)? (b)Is it worth supporting every css property - for example in 'font-weight' there is value=bolder, value=900.... (does anyone formatting their ebook care that much?!) - should I just stick to the common values of 'bold' and 'normal'? (c)I attached two pictures of the plugin's current appearance below. I explained the basic idea of it in the first post; sorry, I am not a clear explainer... but still, does anyone see any changes I should make before going to much further; changes to make it more intuitive, or to make it easier to implement some function you see as being important to a good, fast, ebook cleaner? Thank you for any feedback |
06-14-2011, 02:02 PM | #14 | |
Well trained by Cats
Posts: 29,820
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Is there any reason tot to include the 'friendly name' next to the number (in the display only) for the old timers ? |
|
06-15-2011, 03:01 AM | #15 | |
Connoisseur
Posts: 52
Karma: 38
Join Date: Jun 2011
Device: Kindle 3
|
Thanks for your response theducks.
Please forgive my ignorance of your terminology, but what exacty are you refering to when you say Quote:
Last edited by burbleburble; 06-16-2011 at 02:55 AM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Reading List | kiwidude | Plugins | 1319 | 04-25-2024 09:27 AM |
[GUI Plugin] Open With | kiwidude | Plugins | 403 | 04-01-2024 08:39 AM |
[GUI Plugin] User Category | kiwidude | Plugins | 123 | 03-16-2024 11:59 PM |
[GUI Plugin] Find Duplicates | kiwidude | Plugins | 1096 | 03-16-2024 11:28 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |