![]() |
#1 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2025
Location: Mvskoke land, Milledgeville, GA
Device: Calibre Desktop
|
![]()
Hello Calibre Developers,
I'm joining this forum to discuss a potential enhancement for the Annotations/Highlights/Notes viewer and exporter within Calibre. My goal is to add a GUI selection for the eBook format when viewing or exporting annotations. I'm currently using Calibre for a Dharma Teacher Training program and making extensive highlights and notes. I've developed a JavaScript function (Node.js) that combines Calibre's annotations with Markdown to create a more robust HTML output, preserving highlight colors and clearly distinguishing between notes and highlights. You can find the code on my new repository here. During this process, I've consistently encountered an issue where it's unclear which eBook format's annotations are being exported when multiple formats (e.g., EPUB and PDF) are associated with the same book. This makes it difficult to manage and verify annotations from specific versions. My intent is to develop a feature that allows users to select the specific eBook format from which annotations should be displayed and exported in the GUI. I believe this would significantly improve the usability and precision of Calibre's annotation features. Seeking Collaboration I'm looking for assistance and guidance from experienced Calibre developers. While I have a background in R and JavaScript, and some familiarity with Python, I'm new to the specifics of Calibre's codebase, particularly its annotation export engine and APIs. If you have insights into: Calibre's Python architecture for handling annotations and eBook formats. The best approach for adding a GUI element for format selection. Integrating external tools or scripts (like my HTML output function) into Calibre. Please reach out! I'm eager to contribute and collaborate on implementing this feature. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,225
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Why not just use different book records for your two files instead.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2025
Location: Mvskoke land, Milledgeville, GA
Device: Calibre Desktop
|
Quote:
Given Calibre already has the ability to select the format when viewing a book, it seems like a simple dropdown with the available formats on the highlight screen could solve this problem. Do you have a sense of the process to implement a dropdown on the highlight viewer? |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,225
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Annotations are stored in the EPUB file by default. So simply add the epub file again to your library and you will get all the annotations from a separate book record. And if you want to export annotations from a particular format you can do so via the calibre viewer, by opening the highlights side panel and clicking export.
I am not going to accept a control in the annotations browser for a per format export as its a niche use case already covered by exporting via the viewer. |
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2025
Location: Mvskoke land, Milledgeville, GA
Device: Calibre Desktop
|
Thank you!
Quote:
Did you happen to see the JS function that makes an HTML version of the Highlight/Note output that was linked in my initial post? Do you think that would be a useful addition to Calibre? |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,225
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Sure you are welcome to contribute code to output in HTML format, but it will need to be in python not JS.
|
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2025
Location: Mvskoke land, Milledgeville, GA
Device: Calibre Desktop
|
HTML Output w/ Python
Ok, I'll see about reworking it in Python first for a proof of concept. Can I circle back once I've got a working Python function to ask some questions about how to integrate it?
|
![]() |
![]() |
![]() |
#8 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2025
Location: Mvskoke land, Milledgeville, GA
Device: Calibre Desktop
|
Update: I've created a Python version that uses the Markdown export and Calibre Annotations JSON to create an HTML file which can be found here. I noticed the cmd_export.py in the repository but it appears to be for exporting books. Can you provide some pointers for how to orient to the codebase to integrate this? I've used Python for browser automation for web app automated testing and haven't had experience building desktop applications with Python so it may take me some time to understand the Python desktop application framework and the file structure of the codebase.
Last edited by yogat3ch; 05-25-2025 at 10:14 AM. Reason: Elaboration |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,225
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
relevant code is in src/calibre/gui2/viewer grep for export and markdown to find it.
|
![]() |
![]() |
![]() |
Tags |
annotations, development, highlights and notes |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
recipe output is MOBI even if AZW3 is set as prefered output format. | unkn0wn | Recipes | 1 | 06-29-2022 02:27 AM |
ebook output format is larger in font and pictures | hazy4days | Conversion | 3 | 08-29-2014 01:29 AM |
Convert eBook to html format ? | vmars316 | Conversion | 2 | 07-24-2011 05:41 PM |
Epub format, B & N PubIt!, and HTML character entities | jlandahl | ePub | 3 | 04-07-2011 04:38 AM |
Kipling ebook collection in html & mobi format | FrancisT | Deals and Resources (No Self-Promotion or Affiliate Links) | 11 | 09-24-2008 03:12 AM |