MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   KOReader (https://www.mobileread.com/forums/forumdisplay.php?f=276)
-   -   Why do some epub files not show in-page foonotes? (https://www.mobileread.com/forums/showthread.php?t=341500)

xversion1 08-30-2021 12:11 PM

Why do some epub files not show in-page foonotes?
 
I like to use in-page footnotes option but it works with some files and not with some others even I check all 6 options. Does anyone know why and how to fix it (I can use basic function of Calibre)?
Thanks!

Here a example file with a lot of notes, click on them and go back slowing my reading speed like 10x and really annoying: https://www.mediafire.com/file/zw8ft...bled.epub/file

Jellby 08-30-2021 03:10 PM

That book is most likely copyrighted (although I didn't check whether the translation and notes are CC or something, I confess). You can scramble it if you'd like others to look at it. I think there's a calibre plugin for that.

xversion1 08-30-2021 10:50 PM

Quote:

Originally Posted by Jellby (Post 4150381)
That book is most likely copyrighted (although I didn't check whether the translation and notes are CC or something, I confess). You can scramble it if you'd like others to look at it. I think there's a calibre plugin for that.

What do you mean by "scramble it"? Sorry, I don't familiar with the term.

Jellby 08-31-2021 04:33 AM

Alter the text, but keep the format: https://www.mobileread.com/forums/sh...d.php?t=267998

xversion1 08-31-2021 09:21 AM

Quote:

Originally Posted by Jellby (Post 4150523)
Alter the text, but keep the format: https://www.mobileread.com/forums/sh...d.php?t=267998

Here the scrambled file, hope it's OK :): https://www.mediafire.com/file/zw8ft...bled.epub/file

Frenzie 09-02-2021 05:57 AM

It's not immediately clear to me why the .footnote class there isn't resulting in in-page footnotes, @poire-z should know. There are some limitations to the system when trying to do the best thing with what are effectively regular old links.

But there's a second footnote system in settings → taps & gestures → links → show footnotes in popups which does detect these.

xversion1 09-02-2021 06:39 AM

Quote:

Originally Posted by Frenzie (Post 4151108)
It's not immediately clear to me why the .footnote class there isn't resulting in in-page footnotes, @poire-z should know. There are some limitations to the system when trying to do the best thing with what are effectively regular old links.

But there's a second footnote system in settings → taps & gestures → links → show footnotes in popups which does detect these.

Thanks a lot! This new trick is much better. For months I wondered why Koreader doesn't show notes as Kindle does and struggled with it taking me to another page every time I want to see a note, took me while to setup a gesture to go back to previous page as quick as possible. Now I can see notes as using Kindle. Still it'll be best if notes appear as in-page footnotes, no touching needed.

Frenzie 09-02-2021 09:27 AM

In-depth answer here: https://www.mobileread.com/forums/sh...d.php?t=341500

Quote:

Still it'll be best if notes appear as in-page footnotes, no touching needed.
It's quite rare for me to come across one that doesn't work out of the box, let alone one that can't be massaged into it. Hopefully it'll be a case of first and only. :)

xversion1 09-03-2021 12:10 AM

Quote:

Originally Posted by Frenzie (Post 4151136)
In-depth answer here: https://www.mobileread.com/forums/sh...d.php?t=341500


It's quite rare for me to come across one that doesn't work out of the box, let alone one that can't be massaged into it. Hopefully it'll be a case of first and only. :)

I can't open your link. Click on it lead back to this thread. :blink:

hius07 09-03-2021 04:20 AM

https://github.com/koreader/koreader...ment-911569190

Frenzie 09-03-2021 01:42 PM

Hasty copy-paste error, but already resolved.

xversion1 09-04-2021 01:41 AM

Quote:

Originally Posted by hius07 (Post 4151321)

So, as I understand, there's no way to fix this book?

Frenzie 09-04-2021 08:04 AM

Not through styletweaks, but in principle you can fairly easily fix the book itself by fixing the IDs (for example with Sigil or just an archive application + text editor).

xversion1 09-04-2021 10:52 AM

Quote:

Originally Posted by Frenzie (Post 4151606)
Not through styletweaks, but in principle you can fairly easily fix the book itself by fixing the IDs (for example with Sigil or just an archive application + text editor).

Can you elaborate? I don't know coding but I have calibre and can follow guide blindly. I guess replace function could be used to fix all IDs at once somehow?

Frenzie 09-04-2021 05:05 PM

1 Attachment(s)
The links to footnotes look like this:
Code:

<a href="part0025.html#mah0002108" id="mah0004586" class="calibre5"><sup class="EBsup">1</sup></a>
The footnote looks like this:
Code:

<p id="mah0002107" class="footnotes"><a href="part0015.html#mah0004586" id="mah0002108" class="calibre5"><sup class="EBsup">1</sup></a><em class="calibre7">Rwywbbh</em> huive zh lof. Bcq ozllz md Upqdn coxcvk ewyd ks Oyoun ucl gicp pqsottdyv dy Zdyfxgp 32 (Vggsbg 5).</p>
It will show up as a footnote if you move that ID attribute from the A element over to its parent P element:
Code:

<p id="mah0002108" class="footnotes"><a href="part0015.html#mah0004586" class="calibre5"><sup class="EBsup">1</sup></a><em class="calibre7">Rwywbbh</em> huive zh lof. Bcq ozllz md Upqdn coxcvk ewyd ks Oyoun ucl gicp pqsottdyv dy Zdyfxgp 32 (Vggsbg 5).</p>
Unfortunately I'm not sure if there's an easy way to automate that, and there are hundreds of footnotes.

There's probably something available in Node for example that'd allow you to write out a new file after performing a transformation like this
Code:

const footnotes = document.getElementsByClassName('footnotes');
// for each footnote
footnote.setAttribute('id', footnote.firstChild.getAttribute('id'));

Or as a regular expression, something along the lines of:
Code:

<p id="([a-z0-9]*)" class="footnotes"><a href="[a-z0-9]*\.html#[a-z0-9]*" id="([a-z0-9]*)"
And then you have to replace the first group by the second group…

The second would probably be easier to do, but either way I'm not sure if there's a user-friendly way to do it. Suggestions on nice GUI apps welcome. ;)


All times are GMT -4. The time now is 09:00 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.