![]() |
#31 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 202
Karma: 62362
Join Date: Jul 2015
Device: Sony
|
Manual updated
|
![]() |
![]() |
![]() |
#32 |
More Wiserer
![]() Posts: 9
Karma: 10
Join Date: Jan 2024
Device: Pocketbook Era (KOReader)
|
Thank you so much for making this plugin! I think it will help me on a project, but I'm having trouble and I hope I can get your help to better understand it.
Below is some background, but the tl;dr is: I want to use your plugin to programmatically change the formatting of footnotes by inserting the footnotes into the ebook main text, and then re-create the footnote documents in a way that updates their formatting. However, I don't know how to translate the existing HTML to the "Advanced Options" input table in your plugin. I am also open to better or alternative solutions if you have any for me. Background: I recently discovered KOReader can present a properly formatted footnote in an EPUB3 ebook at the foot of the current page instead of purely as a link. I just bought the entire collection of Terry Pratchett books, and I'm trying to "fix" their footnotes. The collection is mixed between EPUB2 and EPUB3, but I'm going to convert them all to EPUB3, which should make them all a little more similar. For example, here's an (anonymized) footnote and link from the book "Sourcery": Code:
<!--Inline text with numbered footnote link--> <p class="para"><span xmlns="http://www.w3.org/1999/xhtml" class="koboSpan" id="kobo.277.1">This is some text that needs a footnote</span><a class="nounder" href="9780061807145_Footnote.xhtml#fn2" id="fn_2"><span class="sup"><span xmlns="http://www.w3.org/1999/xhtml" class="koboSpan" id="kobo.278.1">*</span></span></a></p> <!-- Footnote content in a separate xhtml document, with appropriate headers etc.--> <p class="footnotePara"><a class="nounder" href="9780061807145_Chapter_1.xhtml#fn_2" id="fn2"><span class="sup"><span xmlns="http://www.w3.org/1999/xhtml" class="koboSpan" id="kobo.3.1">*</span></span></a><span xmlns="http://www.w3.org/1999/xhtml" class="koboSpan" id="kobo.4.1"> This is the content of the footnote. </span></p> Code:
<!--Inline text with numbered footnote link--> <p>This is some text that needs a footnote.<a href="FN_Section0001.xhtml#fn2" epub:type="noteref" id="fn_2">[1]</a></p> <!-- Footnote content in a separate xhtml document, with appropriate headers etc.--> <body> <aside epub:type="footnote" id="fn2"> <p><a href="9780061807145_Chapter_1_split_000.xhtml#fn_2">↩</a>This is the content of the footnote. </p> </aside> </body> I want to use your plugin to identify footnotes, reintegrate the text to the main document, and then extract them back into the footnote.xhtml documents using into the appropriate format. Assuming that your plugin works the way I think it does, here's the information I've used for the "Advanced Options": 1. The name of the xhtml footnote section -I think this is where all the footnotes are written if in a single file. -9780061807145_Footnote.xhtml 2. Footnote heading -I'm not sure what this is, so I left it blank. I think, though, this would be something like this, right? Code:
<title>Sourcery Footnotes</title> -Not sure what this would be either, so I would leave this as "Footer" 4. ID for each footnote -I think this is the ID for the actual footnote, in the example above, fn2 -fn 5. Class name for each footnote -I think this is the overall class name for the footnote, which I think is "footnotePara" 6. ID for each hyperlink -I think this is the ID for the hyperlink to the footnote, in the example above, fn_2 -fn_ 7. Class name for highlighting footnotes in the main body of the text -either "nounder" or "sup", but unsure 8. Include epub:type elements -I think I should turn this on to add the epub:type attributes. I know I've got something wrong because whether I run "Insert footnotes" or "Reinstate footnotes," nothing happens. Any idea what I'm missing? Anyway, thank you taking a look at this and for any help you can provide! I really appreciate it. |
![]() |
![]() |
![]() |
#33 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 202
Karma: 62362
Join Date: Jul 2015
Device: Sony
|
Examining the text in your example that needs to be turned into a footnote I assume that all such text requiring a footnote has the following format in the sequence shown:
a number followed by quotes and a closing angular bracket > The text that needs a footnote html tags that include Footnote.xhtml# Using your example, this is: Code:
1">This is some text that needs a footnote</span><a class="nounder" href="9780061807145_Footnote.xhtml#fn2" id="fn_2"> Use the following to do this: Code:
Find: (\d)">(.*?)<(.*?)Footnote.xhtml#(.*?)> Replace: \1"><span class="FNOTE">\2<\3Footnote.xhtml#\4 This will leave the section href="9780061807145_Footnote.xhtml#fn2" id="fn_2" in place in case it is needed by other links in the book eg the contents page, if any. If you do not need this then you could modify the search criteria to remove this. section too. After doing the search and replace run the plugin and it will produce the footnotes in its standard format. You will need to do another search and replace to remove the unwanted existing footnotes. I hope this helps to resolve the issue. |
![]() |
![]() |
![]() |
#34 |
More Wiserer
![]() Posts: 9
Karma: 10
Join Date: Jan 2024
Device: Pocketbook Era (KOReader)
|
Thank you! Sorry, I didn't see that you'd responded; I did some work on it this weekend and I discovered that the formatting between the ebooks is super varied, so it's going to be a longer road than I anticipated. Thank you again!
|
![]() |
![]() |
![]() |
#35 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 39,157
Karma: 153098470
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
That is pretty much the usual. Everybody seems to have their own ideas about formatting, styling, etc. And then we have the idiots who decide that using <div> is better than <p> for wrapping paragraphs or that inline styles are the only way to fly.
|
![]() |
![]() |
![]() |
#36 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Aug 2024
Location: Portugal, Europe
Device: Kindle Scribe, Kindle Oasis
|
Changing Code to (optionally) support <aside>
Hi,
I have been using this plugin, it is fantastic, but there are ate least on my perspective two caveats. 1. It allows a style to be defined for the FOOTNOTE, if it is placed in the current xhtml section, BUT, in case the option is to place it in a new xhtml section, that style (class name for footnote heading) is not respected. We end up with a new xhtml section with a heading not respecting what is defined in the CSS ?!! My simple suggestion: allow for different heading styles selection (and footnote/endnote heading names) in case of selecting "current xhtml" or "new xhtml". 2. Following what [QUOTE=WiseGuru;4392512] mentioned, in what respects having in ePUB3 with pop-up footnote using the <aside> element, I would also suggest to change the way the footnote is built, or a selectable option for having footnotes built with the the <aside> element. Code:
<!-- Footnote content with appropriate headers for aside.--> <aside epub:type="footnote" id="fn2"> <p><a href="9780061807145_Chapter_1_split_000.xhtml#fn_2">↩</a>This is the content of the footnote. </p> </aside> Code:
FootNote='<aside id="'+self.prefs['FootnoteID'] + Ref +'"'+self.eTypeFootnote+'><p class="'+self.prefs['FootnoteClass']+'"><a href="../' + self.textCurrentSection +'#'+self.prefs['HyperlinkID']+Ref+'">'+self.entryPrefixFooter.get() + insertRef+self.entrySuffixFooter.get()+'</a>' + " " +FN+'</p></aside>' Cheers. |
![]() |
![]() |
![]() |
#37 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 202
Karma: 62362
Join Date: Jul 2015
Device: Sony
|
@ruychi: I'm glad that you find the plugin useful. In response to your comments:
1. The "style (class name for footnote heading) is not respected". The style for the footnote heading is applied from the stylesheet named Footnotes.css. This stylesheet is not generated by the plugin but has to be supplied by the user. If you use the style sheet provided in the manual and you use different class names (eg for the footnote heading) then you will need to change the names of the relevant styles in your style sheet. 2. "I would also suggest ... selectable option for having footnotes built with the <aside> element." I have implemented your suggestion in the updated version of the plugin in the first post of this thread. Clicking the Advanced button on the main dialog and then selecting the box Include epub 3 types? builds footnotes with the <aside> tag. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copyright - posthumous publications | GrannyGrump | General Discussions | 23 | 11-22-2012 08:11 AM |
Double copies of news publications | mark_e_h | Calibre | 2 | 02-10-2012 01:13 AM |
Testing ePub publications with an Android emulator for OSX | Giordano Galli | Android Developer's Corner | 0 | 09-08-2011 02:49 PM |
Manning publications 35% to 50% off | thinkpad | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 11-23-2010 03:30 PM |