11-10-2019, 06:12 AM | #1 |
Addict
Posts: 202
Karma: 62362
Join Date: Jul 2015
Device: Sony
|
FootnoteManipulator plugin
FootnoteManipulator plugin
Recently I produced an ePub that contained a plethora of footnotes. As the ePub developed and went through several reviews, I found that I needed to add/delete footnotes and this became time consuming. Consequently, I developed the attached plugin with the following features:
This plugin has been tested on epub 2.0 books and epub 3.0 using Sigil version 0.9.14 running on windows 11. Important: Please backup your epub before running this plugin. How to install this plugin: See the manual. Licence: See the manual. Update to version 0.1.1.0
Updated to version 0.1.1.2
Updated to version 0.1.1.3 This version will produce popup footnotes for ePub 3 books. To enable popup footnotes click the Advanced button in the main dialog and then tick the box marked Include ePub types. Last edited by CalibUser; 08-10-2024 at 10:00 AM. Reason: Updated to version 0.1.1.3 |
11-10-2019, 02:58 PM | #2 |
Guru
Posts: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
|
The plugin works great.
I've been waiting for years for the footnote plugin, which will have the "Reinstate Footnotes" button. Thank you! It is worth thinking about adapting the plugin to Sigil 1.0, because currently some paths are hardcoded (Text, Styles). One suggestion (removing spaces before the text when calling reinstate, because repeated use of Insert-Reinstate causes the space to grow with each use): Code:
FNtext=self.FNList[j][2].lstrip() #Get the text for the footnote Last edited by BeckyEbook; 11-10-2019 at 03:05 PM. |
Advert | |
|
11-10-2019, 04:03 PM | #3 |
Addict
Posts: 202
Karma: 62362
Join Date: Jul 2015
Device: Sony
|
@BeckyEbook: Glad you find the plugin useful. Thank you for your suggestion and for providing an icon for the plugin. I will incorporate your suggestion and icon in the next update (I will wait a short while in case anybody else has any suggestions or reports any bugs).
|
11-13-2019, 12:37 PM | #4 |
Guru
Posts: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
|
I have some suggestions.
Let me list them below: * Adaptation to Sigil 1.x This should not be difficult, first of all you use an additional condition will detect whether this is version 0.9.991+ Code:
if bk.launcher_version() >= 20190927: Code:
bk.group_to_folders("Text") Code:
bk.group_to_folders("Styles") * Additional options for names used in names of ids, files and styles (just as you can change FNID), it is worth giving the option to change: class FNOTE id FOOTNOTE class Footer name in footer FOOTNOTES class Footnote filename Footnotes.xhtml It will be a nod towards non-English users * Option to enable/disable the fragment with the footer (currently the footer is always added, although it is not necessary after all). * The plugin does not take into account the situation when the file name is not necessary if it applies to the same file. Then Code:
<a href="../Text/Section001.xhtml#fnid1"> Code:
<a href="#fnid1"> * It is true that it is dangerous when it is used on a file with errors, so I would add at the top of the plugin window such a bold inscription "Always work on a copy of the file – you may lose many hours of your work!" Edit: * Add the option to enable/disable adding epub:type="noteref" and epub:type="footnote" Look here. Last edited by BeckyEbook; 11-13-2019 at 12:49 PM. Reason: New suggestion |
11-14-2019, 12:20 PM | #5 | |
Addict
Posts: 202
Karma: 62362
Join Date: Jul 2015
Device: Sony
|
@BeckyEbook: Thank you for your suggestions. I am far from an expert in the structure of epubs so I need to look into the structures allowed by Sigil 1.0 - I have always used the older (standard?) structures. Your tips will be very useful.
Quote:
My first priority will be to adapt the plugin for Sigil 1.0 then I will look at implementing your other suggestions. |
|
Advert | |
|
12-01-2019, 07:52 AM | #6 | |||
Addict
Posts: 202
Karma: 62362
Join Date: Jul 2015
Device: Sony
|
Although I intended to adapt the plugin for Sigil 1.0 before making any other amends to this plugin, I decided to implement other changes first:
Quote:
Quote:
I have also corrected a bug that caused the plugin to freeze when an update was posted. Quote:
I will look at updating the plugin to cope with Sigil 1.0 when I get some more time. |
|||
12-01-2019, 07:16 PM | #7 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Thank you for your work.
Quote:
The FootnoteLinker plugin creates full footnote links (href + id) from scratch for ePub2 and ePub3 (with aside and relevant epub:type elements). If need be (when footnotes definitions are scattered in various places) the FootnoteMover plugin can just collect them and put them together in the same file before the processing with FootnoteLinker takes place. Last edited by roger64; 12-01-2019 at 08:14 PM. |
|
12-01-2019, 08:23 PM | #8 |
Guru
Posts: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
|
Probable bug (five times in the plugin code):
Code:
<p class="'+self.prefs['HyperlinkID'] Code:
<p class="'+self.prefs['FootnoteClass'] |
12-08-2019, 09:11 AM | #9 | |
Addict
Posts: 202
Karma: 62362
Join Date: Jul 2015
Device: Sony
|
Quote:
However, the latest version of the FootnoteManipulator plugin does provide the additional features of the FootnoteLinker plugin so I can see your point; the reference to the other footnote plugin is now redundant so I have decided to remove references to this and the other plugins from my first post. Thank you for pointing out this bug. I have posted an update in the first post for this thread. |
|
12-08-2019, 05:15 PM | #10 |
null operator (he/him)
Posts: 21,006
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
This plugin doesn't have entry in the Sigil Plugin Index.
BR |
12-08-2019, 05:26 PM | #11 |
Grand Sorcerer
Posts: 28,042
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
12-08-2019, 05:37 PM | #12 |
null operator (he/him)
Posts: 21,006
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
I have a suspicion it's not the only one.
BR |
12-08-2019, 06:43 PM | #13 |
Grand Sorcerer
Posts: 28,042
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
12-08-2019, 07:26 PM | #14 | |
null operator (he/him)
Posts: 21,006
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
The problem with plugin index threads is that they don't go bold when they're changed - grumble, grumble BR |
|
12-08-2019, 08:43 PM | #15 |
Grand Sorcerer
Posts: 28,042
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copyright - posthumous publications | GrannyGrump | General Discussions | 23 | 11-22-2012 09:11 AM |
Double copies of news publications | mark_e_h | Calibre | 2 | 02-10-2012 02:13 AM |
Testing ePub publications with an Android emulator for OSX | Giordano Galli | Android Developer's Corner | 0 | 09-08-2011 03:49 PM |
Manning publications 35% to 50% off | thinkpad | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 11-23-2010 04:30 PM |