Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 09:57 AM   #1
0x6f677548
Hugo Batista
0x6f677548 began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Jan 2024
Device: kobo clara hd
suggestion - kepubify: optimize spans for compatibility with text-modifying plugins

The kepubify approach adds spans that interact unexpectedly with text modifications made by other plugins, such as the (Intellireading Metaguiding plugin). This causes performance issues on some Kobo devices, particularly affecting users who rely on accessibility features.

Currently, the plugin wraps each phrase in a `<span class="koboSpan">` tag. When used with plugins that modify text structure (e.g., by adding bold tags), this results in a higher number of spans than intended. For example:

Original text:

Code:
Chapter 1
After (Intellireading Metaguiding plugin)
Code:
<b>Chap</b>ter <b>1</b>
After kepubify:
Code:
<b><span class="koboSpan" id="kobo.2.1">Chap</span></b><span class="koboSpan" id="kobo.3.1">ter</span><b><span class="koboSpan" id="kobo.4.1">1</span></b>
I would like to propose the optimization of the span insertion process by:

1. Avoiding inserting spans on text modification tags (italic, bold, underline)
2. Reducing the overall number of spans inserted


An optimized output could look like this:

Code:
<span class="koboSpan" id="kobo.1.1"><b>Chap</b>ter <b>1</b></span>
This approach would maintain the necessary Kobo-specific metadata while preserving text modifications made by other plugins, potentially improving device performance.

Currently, there are no effective workarounds. Users experiencing this issue are facing out-of-memory exceptions and significant slowdowns when loading chapters on their Kobo devices. I am currently testing a device driver approach where epub is converted to kepub before metaguiding, but that seems a bit over-engineering, and it would be great if the base kepubify process could change the way it handles these tags


How useful could this be

This enhancement could be highly useful to a significant number of users, particularly those with dyslexia or other reading difficulties who rely on text-modifying plugins like (Intellireading Metaguiding plugin). It would improve compatibility between accessibility features and device-specific optimizations, enhancing the reading experience for these users while maintaining the benefits of the Kobo TouchDriver.

Additional context

I've reported this issue on the past on the kobotouch extended plugin:
https://github.com/jgoguen/calibre-k...ver/issues/182

let me know your thoughts.
thanks
0x6f677548 is offline   Reply With Quote
Old Yesterday, 06:52 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,860
Karma: 168802811
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Given that there is little empirical proof that modifying the text as suggested does anything to improve reader comprehension or reading speed (much as the various fonts claimed to be better for dyslexic readers have failed to show any reproducible improvement in several studies), IMO, time spent on this is not a good use of calibre's developers time.

As for the out of memory error? I tried using your plugin on an omnibus volume (1371332 words, 10.6MB) and there were no issues with opening it on a Kobo Glo, Clara HD, Sage (4.38.23171). or Kobo Libra Colour (4.41.23145). No out of memory (checked this from a NickelMenu option) nor did I notice any noticeable slowdown between the unmodified and modified versions sent as kepub or epub when opening the ebook or changing chapters.
DNSB is online now   Reply With Quote
Old Today, 04:53 AM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,144
Karma: 144284184
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by 0x6f677548 View Post
The kepubify approach adds spans that interact unexpectedly with text modifications made by other plugins, such as the (Intellireading Metaguiding plugin). This causes performance issues on some Kobo devices, particularly affecting users who rely on accessibility features.

Currently, the plugin wraps each phrase in a `<span class="koboSpan">` tag. When used with plugins that modify text structure (e.g., by adding bold tags), this results in a higher number of spans than intended. For example:

Original text:

Code:
Chapter 1
After (Intellireading Metaguiding plugin)
Code:
<b>Chap</b>ter <b>1</b>
After kepubify:
Code:
<b><span class="koboSpan" id="kobo.2.1">Chap</span></b><span class="koboSpan" id="kobo.3.1">ter</span><b><span class="koboSpan" id="kobo.4.1">1</span></b>
I would like to propose the optimization of the span insertion process by:

1. Avoiding inserting spans on text modification tags (italic, bold, underline)
2. Reducing the overall number of spans inserted


An optimized output could look like this:

Code:
<span class="koboSpan" id="kobo.1.1"><b>Chap</b>ter <b>1</b></span>
This approach would maintain the necessary Kobo-specific metadata while preserving text modifications made by other plugins, potentially improving device performance.

Currently, there are no effective workarounds. Users experiencing this issue are facing out-of-memory exceptions and significant slowdowns when loading chapters on their Kobo devices. I am currently testing a device driver approach where epub is converted to kepub before metaguiding, but that seems a bit over-engineering, and it would be great if the base kepubify process could change the way it handles these tags


How useful could this be

This enhancement could be highly useful to a significant number of users, particularly those with dyslexia or other reading difficulties who rely on text-modifying plugins like (Intellireading Metaguiding plugin). It would improve compatibility between accessibility features and device-specific optimizations, enhancing the reading experience for these users while maintaining the benefits of the Kobo TouchDriver.

Additional context

I've reported this issue on the past on the kobotouch extended plugin:
https://github.com/jgoguen/calibre-k...ver/issues/182

let me know your thoughts.
thanks
What you are doing is not Intellireading. It's actually Bionic Reading. https://bionic-reading.com and Bionic Reading is pure BS. It doesn't work. It just makes it harder to actually read.

If you want to use Bionic Reading, have the plugin do the modification to an ePub eBook and then use calibre to convert to KePub from there. Problem solved.
JSWolf is offline   Reply With Quote
Old Today, 05:02 AM   #4
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,860
Karma: 168802811
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
What you are doing is not Intellireading. It's actually Bionic Reading. https://bionic-reading.com and Bionic Reading is pure BS. It doesn't work. It just makes it harder to actually read.

If you want to use Bionic Reading, have the plugin do the modification to an ePub eBook and then use calibre to convert to KePub from there. Problem solved.
Reading his original message, what he wants is for Kovid to add special case logic to hand the mass of <b>....</b> that are added to the code. He claims that those extra spans added around the <b>s are causing out of memory errors and slow chapter turning. I did test his plugin with an ~1.4M word omnibus and could see little difference in performance when I send any of the 4 variants I generated to my Sage. According to running free -m from NickelMenu, none of the 4 variants caused even close to an out of memory issue.
DNSB is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugins page [Suggestion for Calibre website] Horus68 Calibre 12 09-20-2020 03:05 PM
Just a suggestion to the subforum text svenlind Calibre Companion 6 11-22-2016 04:18 AM
Empty Spans for iBooks compatibility JSWolf Workshop 24 12-19-2015 01:46 PM
PlugIns Screen UI Comment/Suggestion phossler Calibre 23 11-19-2014 10:04 PM
Tiny suggestion for plugins-locking user data bauerhjb Plugins 3 04-30-2014 10:50 PM


All times are GMT -4. The time now is 05:36 AM.


MobileRead.com is a privately owned, operated and funded community.