epubveri plugin for calibre's Edit Book tool
=============================================

What it does
------------
Adds a "Validate with epubveri" tool, and a separate "epubveri
preferences ..." tool, to calibre's Edit Book application (Preferences >
Toolbars & menus / Plugins menu, once installed).

Validate with epubveri:

1. Looks for the epubveri binary in calibre's plugins folder
   (%appdata%\calibre\plugins on Windows, the "plugins" subfolder of
   calibre's config folder on macOS/Linux). If it is missing, it is always
   downloaded from GitHub (https://github.com/veripublica/epubveri),
   regardless of the update-check preference below - there is no other way
   to get a working binary in place. If a binary is already installed,
   whether it is checked for a newer release depends on the "Check for
   epubveri updates" preference and, if enabled, the configured check
   frequency; if it's not yet due, the existing binary is used as-is
   without contacting GitHub at all. In every case, the correct binary for
   your operating system and processor is selected automatically.
2. Creates an undo checkpoint ("Before: epubveri") and commits all open
   editors to the book's container, then writes the current state of the
   book to a temporary EPUB file (the file open in the editor and your
   library copy are not touched).
3. Runs "epubveri --format json -i <temp epub>" against that temporary copy
   and parses the JSON report.
4. If epubveri reports any findings, they are shown in a dock widget at the
   bottom of the editor window, similar to calibre's built-in "Check Book"
   tool: one sortable row per finding, with file name, line, column and
   message columns. Rows are colored by severity (fatal/error: pink,
   warning: yellow, info/usage: pale blue). One or more rows can be
   selected with click, Ctrl+Click, Shift+Click, or Ctrl+A (select all);
   Ctrl+C copies the selected row(s) to the clipboard as tab-delimited
   text. Double-clicking a row with a line/column position opens that file
   and moves the cursor there; rows without a position show an
   informational message instead.
   If there are no findings, an informational dialog is shown instead of
   the dock widget (and any dock left over from a previous run is closed
   automatically).

epubveri preferences:

Opens a small dialog with two settings:
  - "Check for epubveri updates" (on by default) - whether an already
    installed epubveri binary should ever be checked against GitHub for a
    newer release.
  - "Check every: N day(s)" (7 by default) - how often, in days, that
    check should happen when the above is enabled. 0 means "Always (every
    run)" - check for a newer release every single time the tool is run.
These same settings are also reachable from calibre's own Preferences >
Plugins > select epubveri > Customize plugin, when running inside the full
calibre library GUI.

Installation
------------
In calibre: Preferences > Plugins > Load plugin from file, and select this
zip file. Restart calibre's Edit Book tool, then add the "Validate with
epubveri" and "epubveri preferences ..." tools to a toolbar or the Plugins
menu via Preferences > Toolbars & menus if they are not already visible.

Files in this plugin
---------------------
__init__.py                      Plugin metadata (EditBookToolPlugin) and
                                  calibre's standard "Customize plugin" hook.
main.py                          The Tool implementations, epubveri binary
                                  manager, preferences (ConfigWidget/
                                  ConfigDialog), and results dock widget.
plugin-import-name-epubveri.txt  Fixes the plugin's internal import name.
README.txt                       This file.
