Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-03-2026, 10:32 PM   #31
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 14,089
Karma: 83429614
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Installed and working on intel chromebook; sigil installed via appimage
PeterT is offline   Reply With Quote
Old Yesterday, 10:46 AM   #32
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,712
Karma: 212474403
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Kayadelenium View Post
And the one nobody reported. Testing this build, content.opf said line 95 and the cursor landed on 96. The OPF only. I had been overwriting the copied OPF with get_opf, which is a rebuild from Sigil's model: it sorts the manifest by id and rewrites every entry. My line numbers were correct for that rebuild and for nothing else. On the book that caught it, the cover entry sits at line 91 in the file, 95 in the rebuild, and 96 in what Sigil was displaying. Three numbers for one line, and the two a user can see were not the one I sent. The substitution was there so unsaved manifest and spine edits would still be validated, and it was never needed: the OPF is not a manifest item, so readotherfile already hands back the live rebuild when there are unsaved OPF edits and the file from the ebook root otherwise. Removing it keeps both. One limit stays, and I would rather say it than have someone find it: with unsaved OPF edits, positions in the OPF refer to Sigil's rebuild rather than to the text on screen. I cannot see a way to ask a plugin what Code View is holding.
I'm a little confused by what you're doing here. Any unsaved changes in the epub (including the opf file) are supposed to be flushed to disk (to Sigil's temp scratch area) before any plugin runs. So the copy of the files that Sigil gives each plugin should already contain any and all changes that the user sees in Sigil (even if the epub has not been saved yet). So I don't quite understand why you'd be overwriting that opf with anything when you build the epub that epubveri needs to validate. The plugin framework has already given you (or should have anyway) the very latest staged edits. If it hasn't, then we have a problem somewhere in Sigil.

Last edited by DiapDealer; Yesterday at 11:15 AM.
DiapDealer is online now   Reply With Quote
Advert
Old Yesterday, 01:16 PM   #33
Kayadelenium
Zealot
Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.
 
Kayadelenium's Avatar
 
Posts: 124
Karma: 200000
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
DiapDealer — short answer: the plugin does not overwrite the OPF. It did in the first release; the post you quoted was announcing that it stopped.

What it does today, all of it: it calls copy_book_contents_to into a temporary folder of its own, zips that folder into an .epub, runs epubveri on the zip, and deletes the whole thing when the run ends. The zip step is there because epubveri validates a packaged file rather than a folder. Nothing is written into Sigil's scratch area, and nothing is written back into the book — the plugin reads and reports.

One thing is left over, and it may well be intended. For an OPF the user has edited in the session, readotherfile does not return the file: it returns build_opf(). So the plugin is handed a rebuild, and any line number it reports for that file is a line in the rebuild rather than in what Code View is showing. On the book where I ran into it, one manifest entry was at line 91 in the file, 95 in the rebuild and 96 in Code View.

Everything else lines up: every other file in the book matches exactly, and so does an OPF nobody has edited in the session.

So this is not a request, just a question with a short answer either way: is the rebuild what a plugin is meant to get there? If it is, I will note it in the plugin's documentation and leave it alone.
Kayadelenium is offline   Reply With Quote
Old Yesterday, 01:56 PM   #34
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,712
Karma: 212474403
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Kayadelenium View Post
DiapDealer — short answer: the plugin does not overwrite the OPF. It did in the first release; the post you quoted was announcing that it stopped.
Understood. Thanks for clarifying.

Quote:
Originally Posted by Kayadelenium View Post
What it does today, all of it: it calls copy_book_contents_to into a temporary folder of its own, zips that folder into an .epub, runs epubveri on the zip, and deletes the whole thing when the run ends. The zip step is there because epubveri validates a packaged file rather than a folder. Nothing is written into Sigil's scratch area, and nothing is written back into the book — the plugin reads and reports.
Seems to be a bit overkill--albeit harmless. Every plugin is already handed a temporary folder (which is a copy of Sigil's scratch area for that epub). Only the epub you create for epubveri to use would need to be created in its own temporary folder.
Strike that. A plugin IS given a copy of the contents of the epub, but for the purposes of building a temporary copy of the epub, copy_book_contents_to is probably the much simpler route.

Quote:
Originally Posted by Kayadelenium View Post
One thing is left over, and it may well be intended. For an OPF the user has edited in the session, readotherfile does not return the file: it returns build_opf(). So the plugin is handed a rebuild, and any line number it reports for that file is a line in the rebuild rather than in what Code View is showing. On the book where I ran into it, one manifest entry was at line 91 in the file, 95 in the rebuild and 96 in Code View.

Everything else lines up: every other file in the book matches exactly, and so does an OPF nobody has edited in the session.

So this is not a request, just a question with a short answer either way: is the rebuild what a plugin is meant to get there? If it is, I will note it in the plugin's documentation and leave it alone.
Let me do some checking, but yes... the rebuild is what a plugin is meant to get there. But I was under the impression that the flush-to-disk before a plugin run would mean that what Sigil shows and what a plugin gets should be identical. That was the intention anyway. We'll have to do some investigating to make sure that is the case (or why it's not).

Last edited by DiapDealer; Yesterday at 02:23 PM.
DiapDealer is online now   Reply With Quote
Old Yesterday, 02:34 PM   #35
Kayadelenium
Zealot
Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.
 
Kayadelenium's Avatar
 
Posts: 124
Karma: 200000
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
On the extra copy being overkill: you are right that it is one copy more than necessary, and the reason is only that ebook_root is reachable through the wrapper's private attributes while copy_book_contents_to is the documented way to get the book's files somewhere I can zip them — if reading the folder Sigil already hands us is fair game for a plugin, I will drop the copy.
Kayadelenium is offline   Reply With Quote
Advert
Old Yesterday, 02:40 PM   #36
Kayadelenium
Zealot
Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.Kayadelenium ought to be getting tired of karma fortunes by now.
 
Kayadelenium's Avatar
 
Posts: 124
Karma: 200000
Join Date: Jul 2026
Location: Planet Earth
Device: Kobo Forma
epubveri for Sigil 0.3.0 — one setting, and one thing written down.

https://github.com/veripublica/epubv...g/sigil-v0.3.0

The order of the findings is a setting now, in the same JSON file as the display switches: "sort", one of severity (the default), severity-low, or document. It is written into the file on the first run, like the others, so the file shows that the choice exists.

Severest first was already what this plugin did. What changed is that you can ask for something else, and that each severity group now keeps the book's order instead of being re-sorted by file name. Advisory findings sort last, since they never move the verdict. The words are epubveri's own — the command line takes --sort severity and --sort document — and the calibre plugin's setting uses the same three, so the two never need different vocabulary.

A setting rather than clickable columns because Sigil draws the results table: its columns are File, Line, Offset and Message, and clicking Message sorts the severities alphabetically, which puts ERROR above FATAL. What the plugin hands over is the only correct severity order available here. Ran all three orders through Sigil's own launcher before releasing.

And one limit is now in the README rather than only in this thread: if you have edited the OPF in the session and not saved, a position in that file can be a line or two away from what Code View shows, because a plugin is handed a rebuild of a modified OPF rather than the text on screen. Everything else in the book, and an OPF you have not edited, matches exactly. DiapDealer is looking at whether the two ought to line up; if they come to, the note goes away.

Thanks again to PeterT for the Linux run and to DNSB for Windows on the last one.
Kayadelenium is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin]Simple Goal sheldonrrr Plugins 2 08-09-2026 12:46 AM
[Plugin] ACE - DAISY EPUB Accessibility Checker wrapper Doitsu Plugins 40 12-10-2025 10:53 AM
[Plugin] ImgShrinker (ImageMagick-Wrapper) Mark Nord Plugins 19 06-26-2025 11:35 AM
Help with simple plugin development libeluratio KOReader 3 07-14-2024 05:13 AM
[Plugin] CSSLint - Simple CSSLint wrapper Doitsu Plugins 1 03-23-2016 06:51 PM


All times are GMT -4. The time now is 03:19 PM.


MobileRead.com is a privately owned, operated and funded community.