|
|
#1 |
|
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Apr 2026
Device: Calibre
|
Direct annotations through CSS, is it practical?
I'm quite a fan of annotations but the fact that they don't really stay inside EPUB files sort of bugs me.
So how viable and safe is it to simply edit the CSS of the EPUB itself, through the Calibre EPUB Editor for instance, using a class like ``` .highlightgreen { background-color: lightgreen; } ``` Do you think it would be safe and is there a plugin that supports it? The methods most people mention don't involve editing the EPUB directly but using external metadata
|
|
|
|
|
|
#2 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 191
Karma: 1537710
Join Date: Jul 2021
Device: N/A
|
First of all, I guess you're aware that you can annotate an epub wjhen you're using the calibre's epub reader, annotations are stored inside the epub itself, in the "calibre_bookmarks.txt" file (in the prefs, choose miscellaneous / "Keep a copy of annotations/bookmarks in the e-book file, for easy sharing").
But, of course, they are readable only with the calibre's epub reader itself, not even the editor is understanding the content of the file calibre_bookmarks.txt. If you want to be able to share the annotations with other people that don't use calibre, you're solution is possible, but it needs to write a plugin that, for example with a button on the toolbar, get the current selection and put it inside a span using the css class you've told (the same plugin would create this class at its first call in the current epub). So it's not a trivial solution. Edit: Or another one that — using the code that Kovid already wrote in the ebook-viewer — would get the content of calibre_bookmarks.txt and put it inside the code of the epub. Last edited by lomkiri; 04-04-2026 at 11:18 AM. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,664
Karma: 64144480
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
The CSS is where you create a STYLE that the book can use.
You would the need to add a span class= "highlightgreen"> around the annotation anchor text. |
|
|
|
|
|
#4 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,809
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
<mark>This is some text I need to highlight/annotate</mark> My CSS mark { background-color: yellow; } https://developer.mozilla.org/en-US/.../Elements/mark Last edited by Karellen; 04-04-2026 at 01:48 PM. |
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Save annotations to a file in ebook viewer, then view these annotations in the browse | Sys_eng | Library Management | 2 | 11-10-2023 09:41 PM |
| Libra 2 "Unable to import annotations as the annotations column has not been configured..." | Liudprand | Kobo Reader | 2 | 07-29-2023 10:56 PM |
| Annotations: Capture/Convert Kobo-Kindle (uses OpenWith and Annotations Plugins) | EnergyLens | Related Tools | 12 | 03-28-2020 01:04 PM |
| Pdf annotations and Kindle annotations | BranMakMorn | Calibre | 0 | 06-25-2011 02:42 PM |
| css pseudo elements and adjacent combinators in extra css? | ldolse | Calibre | 2 | 12-21-2010 05:09 PM |