|
|
#1 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 312
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
|
[Plugin] epubsana - Repair the book with epubsana.
epubsana for Sigil
This plugin repairs the book you have open in Sigil with epubsana, my EPUB repair tool. epubsana fixes the defects epubveri reports where there is exactly one correct repair that keeps the content as it is, and leaves everything else alone. When you run it from Plugins, Edit, epubsana, a window lists what it can repair, and selecting a line shows every file the fix touches and what changes there. The safe fixes are ticked. The ones that make a visible change, such as dropping a repeated spine entry, are not, so you can look at them first. A few fixes are shown greyed out with the reason: Sigil does not let a plugin change the EPUB version or a media-type, and it writes the container itself. The repair goes into Sigil whole or not at all. After epubsana has applied the fixes you chose and checked the book again, the plugin reads the book back out of Sigil and compares it with what epubsana wrote. If anything differs, Sigil takes none of the changes, and the window says why. The book is not saved for you: save it to keep the repair, or close it without saving. Taking a Checkpoint first lets you compare the two versions. In an Automate list there is no window, and only the safe fixes are applied, with the same checks. On first use the plugin downloads epubsana from its GitHub release, checks it against the release's checksums, and keeps it up to date. It also tells you when a newer version of the plugin is out. Download: sigil-plugins releases on GitHub. Take the newest epubsana_sigil_vX.Y.Z.zip and add it with Plugins, Manage Plugins, Add Plugin. Please do not rename the zip: Sigil takes the plugin's folder name from it. Questions and reports are welcome here or in the GitHub issues. |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,101
Karma: 4000789
Join Date: Jan 2017
Location: Poland
Device: Various
|
I noticed a potential issue with epubsana.
In some cases, for example when the OPF is accidentally damaged by a Sigil 2.8.5 bug (issue #903), a manifest entry may be missing even though the corresponding XHTML file is still present in the EPUB. The CLI version correctly asks for confirmation before dropping the orphaned spine itemref. However, the Sigil plugin applies this fix automatically, without asking. I think epubsana should first check whether the missing file actually exists in the EPUB and, if so, restore the manifest entry rather than remove the spine reference. |
|
|
|
|
|
#3 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 312
Karma: 364036
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
|
Thank you, Becky, and thank you for the test file.
I think it is Sigil rather than the plugin that drops it. When I open your Test_File.epub, Sigil warns "Files exist in epub that are not listed in the manifest, they will be ignored. t/Section0003.xhtml", and the book it opens has no Section0003.xhtml. A plugin only ever gets the book Sigil holds, so by the time epubsana runs, that chapter is already gone. On the plugin side, epubsana proposes one fix for the file itself: dropping the Section0003.xhtml itemref. It marks that fix as needing confirmation, as the CLI does, so in the plugin's window it is not ticked, and in an Automate list it is never applied. I ran your book through Sigil's plugin launcher in Automate mode, and the plugin left the spine as it was. On restoring the manifest entry: I agree that when the file is still in the book, putting its entry back is the better repair, and I will take that to epubsana. It can only help on the command line, though. Inside Sigil the file is ignored when the book is opened, so neither the plugin nor any other one ever sees it. Until epubsana can do it, the way to keep that chapter is to add its manifest entry back in the OPF before the book is opened in Sigil. Today's CLI would only offer to drop the itemref. If you saw the plugin drop something in a book where Sigil had not already ignored the file, please tell me, and I will look again. |
|
|
|
![]() |
| Tags |
| book, ebook, epubsana, repair, veripublica |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| epubsana — automatic repair for what epubcheck reports (not an editor) | Kayadelenium | ePub | 75 | 11-29-2026 04:00 PM |
| Polish Book Plugin-How to get Arabic numerals in Book Jacket | acepenn | Library Management | 1 | 09-18-2026 09:01 PM |
| [GUI Plugin] Colophon - AI-assisted EPUB repair+proofreading (alpha, Calibre 9.5+) | jbennion | Plugins | 5 | 08-21-2026 05:51 PM |
| Check Book repair function has unexpected side-effect | DrChiper | Editor | 8 | 08-07-2015 09:50 AM |