epubveri for Sigil 0.1.1
Validates the book open in Sigil with
epubveri — no Java, sub-second, and
reporting epubcheck's own message IDs. It reads your book and reports; it
changes nothing.
Install: Plugins → Manage Plugins → Add Plugin, choose
epubveri_v0.1.1.zip. Do not rename the file — Sigil takes the plugin's
folder name from the part before the first underscore. Then run it from
Plugins → Validation → epubveri.
On first use it downloads the epubveri binary for your platform (~3 MB) and
verifies it against that release's SHA256SUMS.txt. The zip contains no
binary.
Fixed since 0.1.0
- A result about the book as a whole no longer says "Invalid Book Path
Provided". The summary line named no file by passing an empty string, and
that is the one value Sigil's result table reads as a mistake rather than as
an absence. It now passes a single space, so the File column comes out blank.
Reported by DNSB on Windows, line found by Doitsu. The same empty
string was in seven other places, including every finding epubveri makes
about the container rather than about a file. - Positions in
content.opfland in the document Sigil is showing. The
panel said line 95 and the cursor went to 96. The copied OPF was being
overwritten withget_opf(), which is a rebuild from Sigil's model: it sorts
the manifest byidand rewrites every entry. The line numbers were right
for that rebuild and for nothing else — on the book that caught it the cover
entry is at line 91 in the file, 95 in the rebuild, and 96 on screen. The
substitution was never needed:readotherfilealready returns the live
rebuild when the OPF has unsaved edits and the file from the ebook root
otherwise. - The plugin has an icon,
plugin.svgwith aplugin.pngbeside it.
Suggested by DNSB. A filled tile rather than an outline, because Sigil
has a dark theme too.
Known limit
With unsaved OPF edits, positions in the OPF refer to Sigil's rebuild
rather than to the text on screen. A plugin cannot ask Code View what it is
holding. Every other file is unaffected, saved or not.
What it does
- Every finding in Sigil's validation panel with its file, line and character
offset, so double-clicking lands on the character rather than the file. - Validates what Sigil currently holds, including unsaved edits.
- Labels every line —
ERROR,WARNING,USAGE,ADVISORY— and each
advisory says epubcheck does not report it and the verdict is unaffected. - Verifies the binary before every run, ~1.8 ms for 2.8 MB. If the file has
changed since it was verified, nothing is run and the plugin says so. - Keeps epubveri current, at most once an hour, by reading 842 bytes of
checksums rather than asking an API. Turn it off with
"autoupdate": falseinplugins_prefs/epubveri/epubveri.json; then it
never touches the network. - Offline is silent. No error, nothing missing from the report.
How much it has been used
0.1.0 ran for one day. It has now been used on macOS, Windows (DNSB) and
Linux, the AppImage build (PeterT) — 0.1.0 shipped with none of the last
two tried. The calibre plugin in this repository is still unfinished; do not
package it.
Three defects were found on 0.1.0's first day by running it in Sigil, and
three more on its second, none of which 26 unit tests had caught and all of
which needed a real editor to see. That rate has not flattened, which is why
this is 0.1.1 and not 1.0.0.
Bug reports here. A wrong finding rather than a wrong plugin belongs in
epubveri — a wrong error on a
good book is the report we most want.
Credit
Doitsu wrote the first epubveri plugins for Sigil and calibre and proved the
idea; thiago.eec contributed to the calibre one. This is an independent
implementation rather than a fork — none of their code is used — but what it
needed to do was learned from theirs. autostart is his suggestion, and so is
the fix in the first item above.