![]() |
#61 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
|
![]() |
![]() |
![]() |
#62 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
@lumpynose if you're interested in creating Apple Books (iBooks) compatible popup footnotes, you might want to read the footnote section of the Apple Books Asset Guide, because Apple is really picky when it comes to footnote id attributes. It expects:
Code:
<aside id="myNote" epub:type="footnote"> <p style="direction:rtl">Text in popup</p> </aside> Code:
<div id="myNote" epub:type="footnote"> <p style="direction:rtl">Text in popup</p> </div> |
![]() |
![]() |
Advert | |
|
![]() |
#63 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
|
![]() |
![]() |
![]() |
#64 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,125
Karma: 144284184
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
But remember, it has to also work with reading software that doesn't do popup footnotes.
|
![]() |
![]() |
![]() |
#65 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 105
Karma: 87300
Join Date: Feb 2011
Device: kindle 3w, dxg, 5, Kv
|
Transferring Footnotes from a Website
Hi All,
I hope this is the right thread to pose the following question: I'm trying to convert an ebook on a website where a book's footnotes already "pop-up" in a new window. I'd like to have the main text of the book not interrupted with those numerous footnotes (which would be the case were I to attempt to convert the "printed" version of the page to epub) with the latter being available by clicking on their corresponding number (doesn't matter if they "pop-up" or not). The website in question is a great one: UC Press e-books collection, where 700 of them are accessible by the public. The book in question is The Fabrication of Labor by R. Biernacki. The main text is supplied with numerous footnotes. Now, to avoid having the footnotes displayed under each page (as is the case under "Print View") I make the Firefox "Show Only" the right frame under normal view, save the page as such (Web page, complete) and add the html file to Sigil. The footnotes in Sigil are linked to like this: <sup class="ref">[<a href="javascript://" onclick="javascript:window.open('https://publishing.cdlib.org/ucpressebooks/view?docId=ft8g5008n9&doc.view=popup&chunk .id=d0e2555','popup','width=300,height=300,resizab le=yes,scrollbars=yes')">1</a>]</sup> In the resulting epub file, clicking on footnotes leads nowhere. Is there anything one can do to properly transfer the links to the footnotes as well? If there is, I hope one can do the same for the other publicly available books on this site as well since their current format doesn't seem optimal (for me) to read or annotate them. Many thanks... |
![]() |
![]() |
Advert | |
|
![]() |
#66 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
|
That is not a valid epub link. You do not need nor should you use javascript or onclick for hyperlinks in xhtml.
Replace the: <a href="blah" ... > blah part with the correct link to a local xhtml file inside the epub the corresponds to what gets popped up on the website when you click on that footnote (most likely ... an element with an id of d0e2555 inside the xhtml file that represents the ft8g5008n9 document). |
![]() |
![]() |
![]() |
#67 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
All the footnote text is there + the code is all clean. All you'd have to do is use a few regexes to convert their code into the EPUB footnote HTML already discussed. Quote:
Here's the relevant code for page 8: Spoiler:
So, what I'd do is 2 regexes: Search: <sup class="ref">\[(\d+)\]</sup> Replace: <a class="ref" href="#fn\1" id="ft\1">[\1]</a> Search: <p>\[(\d+)\] Replace: <p class="footnote"><a href="#ft\1" id="fn\1">[\1]</a> That gets you all your EPUB clickable footnotes. Now you'd just be left with the typical HTML cleanup:
Last edited by Tex2002ans; 07-25-2021 at 05:33 PM. |
||
![]() |
![]() |
![]() |
#68 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 105
Karma: 87300
Join Date: Feb 2011
Device: kindle 3w, dxg, 5, Kv
|
Thank you so much for these elaborate , thoughtful instructions. I will try to implement them, let you know, hopefully, of the satisfactory results and express my gratitude again!
|
![]() |
![]() |
![]() |
#69 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 105
Karma: 87300
Join Date: Feb 2011
Device: kindle 3w, dxg, 5, Kv
|
I really didn't want to pose another question without trying your suggestions first. The conversion of the numbers to footnote links worked great.
Yet, after many hours of trying, I should give up and say that I still cannot figure out how I can move the footnote paragraphs to the end of the xhtml file or to a new xhtml. (i.e., footnotes to endnotes) This should be something ridiculously simple I hope, yet, as it turns out, for someone other than me... |
![]() |
![]() |
![]() |
#70 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
![]() Quote:
A while back, I created a little Python program to move all footnotes to the bottom of the HTML file. It's very helpful when dealing with footnotes mixed right in the middle of the text (mostly due to OCR). * * * And on Footnotes vs. Endnotes: I think it's best to have Footnotes at the bottom of each HTML file. This ensures:
Very rarely do I do an Endnotes file. The only times I use it is when:
Like in this recent thread, 2021: "superscript code", we went off on a tangent about a 1100-page Winston Churchill book with ~5.3k endnotes + ~300 footnotes... ~800KB of only notes. That's one of the rare ones where separate Endnotes file/s might make sense. But in all the hundreds of ebooks I've done, I've maybe only done this 5 times. Last edited by Tex2002ans; 07-29-2021 at 02:25 PM. |
|
![]() |
![]() |
![]() |
#71 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 105
Karma: 87300
Join Date: Feb 2011
Device: kindle 3w, dxg, 5, Kv
|
I'm sending you the files (the bundle of html files + the epub file), Thank you so much!
The only thing I could do with the epub though was applying for Regex search/ replace instructions and removing the color and font from the Css file (which had made the text whiteish). A python script to do that sounds great! It would definitely be most useful for me as well, when trying to convert other html texts from that as site at least. (I don't why we cannot copy all instances of a search result simultaneously though -- that doesn't apply to Sigil only, of course. It would render the transfer of notes quite quick). Sure, footnotes at the end of the xhtml would definitely work for me... Even many hard copy books tend to put notes at the end of each chapter nowadays... You have been immensely helpful already, Texas2002ans, thank you again! |
![]() |
![]() |
![]() |
#72 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
![]() Quote:
They tend to make problems when users switch to Night Mode, etc. See 2020: "Colored Text, EPUB, Android Dark Mode". Quote:
I wrote about it back in 2020: "I have a DOCX with footnotes that I wanna turn to pop-up notes in ePub on Kobo Forma": Spoiler:
|
|||
![]() |
![]() |
![]() |
#73 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 105
Karma: 87300
Join Date: Feb 2011
Device: kindle 3w, dxg, 5, Kv
|
All this help is simply incredible. Thank you so much for all your replies and instructions as well as amending the file for me, here and, in a more detailed fashion, in your PM. Simply amazing! I'm most grateful!
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Displaying end/foot notes in ePub | FlorenceArt | Apple Devices | 0 | 12-10-2015 07:31 AM |
Asterisk (link to foot notes) almost invisible | HansTWN | Kobo Reader | 1 | 08-15-2013 04:36 AM |
How to skip foot notes: normal flow | theducks | ePub | 7 | 11-27-2012 11:00 AM |
Multiple foot notes with same id | Ti-Ron | ePub | 2 | 10-04-2012 07:27 PM |
Handling end notes | Artha | Sigil | 5 | 11-22-2011 04:05 PM |