08-26-2019, 11:03 AM | #1 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
GUI Plugin "TOC View Generator" (was: Define Content)
Hello together,
shortly I created a Calibre plugin for myself. You can see its name in the title. Its purpose is to extract content information from ebooks (actually PDF and EPUB), to be more precise from the bookmarks, and to write it to a user defined "#content" field. This field is then displayed in the details view of Calibre just before Comments (configurable). If you are interrested, you can visit my web page to get more information. Also I append this plugin in this post. It would be nice, if someone found it useful. |
09-04-2019, 10:11 AM | #2 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Bug fix and additional features
In the mean time I detected an error: an intermediate file was not overwritten - so the #content field was not updated after the first invocation of the command for an epub ebook.
So I provide this update. Additional content is better logging, exception handling an a dialog to check the requirements. I apologize for any problems. Last edited by theducks; 10-04-2019 at 06:22 AM. Reason: moved new ver PI here |
Advert | |
|
10-03-2019, 04:44 AM | #3 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Progress in the work on the plugin
Hi, I want to post some news about the progress in the work on the plugin.
The following points seem remarkable to me:
|
10-03-2019, 08:42 AM | #4 |
Resident Curmudgeon
Posts: 76,370
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
from the description of the plugin on your website, this sounds like you want to extract the eBook from the eBook file and place it in a custom field in Calibre. Do I have this correct?
|
10-03-2019, 09:43 AM | #5 |
creator of calibre
Posts: 44,530
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
FYI I ust added a function to extract the outline from PDF files to calibre itself, so no need to use pdftk.
Code:
from calibre.utils.podofo import get_outline |
Advert | |
|
10-04-2019, 06:06 AM | #6 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Hint for outline
Many thanks for Your hint. I just gave it a try. It works and I could see the generated list / dict structure.
One problem: during extraction the UI is blocked, although my code run in a ThreadedJob. With the pdftk this is not the case. Any additional hints? Thanks! |
10-04-2019, 06:09 AM | #7 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Reply to JSWolf
I do not extract the ebook from the ebook but the ebook's outline or bookmarks as it is called by Adobe reader.
The rest is correct. |
10-04-2019, 06:14 AM | #8 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
New version with bug fixes
Just after my yesterday's post I detected some bugs:
That's why this new bug fix post. Moderator Notice
Moved latest version to post #1 (a convention for releases) Last edited by theducks; 10-04-2019 at 06:20 AM. |
10-04-2019, 07:02 AM | #9 | |
Grand Sorcerer
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
But, I have to say your description of the plugin is terrible. When you first posted it, my reaction was similar to @JSWolf's. And I was only sure of what it did by reading the code. When I first saw it, I couldn't decide if "content information" was the metadata in the book, or text from the book. And the use of "bookmarks" added to the confusion as then I assumed you were extracting the user added bookmarks. |
|
10-04-2019, 07:18 AM | #10 |
Grand Sorcerer
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Looking at the code, you are assuming the NCX file is called "toc.ncx" and will either be in the OEPBS or root directory of the book. I have plenty of books where this would fail. You should be finding the file using the OPF.
Alternatively, calibre has methods to do this. Look at: Code:
from calibre.ebooks.oeb.polish.container import EpubContainer from calibre.ebooks.oeb.polish.toc import get_toc |
10-05-2019, 04:46 AM | #11 | |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
How to change name of plugin
Quote:
What's about:
|
|
10-07-2019, 06:04 AM | #12 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
New name, new features, bug fixes
Hello,
in the mean time I decided to rename the plugin to "TOC View Generator". Hopefully people can better imagine what the plugin does seeing this name. Also I added a few new features:
How can I add attachments to previous posts? I could not find any button or link for it! |
10-07-2019, 08:48 AM | #13 | |
Wizard
Posts: 1,077
Karma: 1221485
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Quote:
You can click on 'edit' on the bottom right corner of the first post. Then, click on 'Go advanced' and 'Manage Attachments'. |
|
10-07-2019, 11:57 AM | #14 |
Well trained by Cats
Posts: 30,442
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Moderator Notice Name changed. I will let the OP manage the attachment. It (releases) must be in the first post IF Calibre notifications are to work. Betas should NOT be in post 1 Use Advanced Edit mode in MR forums. Lots more options become visible. |
10-07-2019, 11:58 AM | #15 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Edit not found
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] APNX Generator | user_none | Plugins | 97 | 10-24-2024 05:54 AM |
[GUI Plugin] View Manager | kiwidude | Plugins | 415 | 05-11-2024 04:28 AM |
[GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 06:25 AM |
[GUI Plugin] Auto Datestamp and View | eater | Plugins | 3 | 04-08-2020 07:08 PM |
Bug or feature of the TOC generator? | Artha | Sigil | 10 | 11-27-2011 12:03 AM |