View Single Post
Old 10-17-2014, 08:35 AM  
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,625
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
[Plugin] EpubCheck plugin for Sigil

[Plugin] EpubCheck - Simple epubcheck wrapper

Updated: May 27, 2024
Current Version: "0.4.7.1"

This plugin is a very simple EPUBCheck v5.1.0 wrapper.

Please note that I can no longer bundle the EPUBCheck Java files with this plugin, because the epubcheck-5.1.0.zip file has a file size of 28MB!

epubcheck-5.1.0.zip is not the Sigil EPUBCheck plugin. You'll need to download this file.

If you're installing the plugin, you'll need to be connected to the Internet. (Otherwise the plugin won't be able to automatically download and extract the EPUBCheck v5.1.0 Java files.)



Disclaimer:
Even though it's unlikely that the plugin will somehow corrupt the epub that you're working on or crash Sigil, you may want to save your ePub in Sigil before running this plugin.

System requirements

Before installing the plugin, please make sure that the following system requirements are met:

1. Python 2.7.x (or Python 3.4)*
2. Java 1.8 or higher

The plugin won't work without Java!!!
If Java isn't installed download it from the Oracle website.


* Not required for Sigil 0.9.0 and higher, which comes with Python 3.

To find out whether these programs are installed, enter the following commands in a terminal/command prompt window:

python -V (should display Python 2.7.x/3.x)
java -version (should display java version "1.8.0_xx" or a higher version number)

Installation

1. Select Manage Plugins from the Plugins menu, then select Use Bundled Python, if it isn't already selected.
If you haven't updated to Sigil 0.9.0 (or higher), click one of the Auto buttons to detect the Python interpreter path or Set to manually select it.
2. Click Add Plugin and select epubcheck_v0.4.7.1.zip. This will install the epubcheck plugin, which you can select via Plugins > Validation > epubcheck.


Settings

You can control several EpubCheck plugin settings via the EpubCheck.json file, which'll be generated after the first run of the plugin. (To enable a setting change false to true.)

Code:
{
  "locale": "fr", 
  "github": true, 
  "clipboard_copy": false, 
  "update_check": true,
  "check_interval": 7,   
  "usage": false,
  "is32bit": false
}
locale if specified, EPUBCheck will display messages in the language specified by the language code. You can use this setting, for example, to display French epubcheck messages on a computer with an English OS or vice versa.

The following language codes can be used:
Code:
"en", "de", "es", "fr", "it", "ja", "nl", "pt-BR", "ko-KR", "zh_TW", "da"
Note that Japanese output will not work on non-Japanese Windows PCs.

github if enabled, the plugin will check the W3C Github site for EPUBCheck updates. (This setting is enabled by default.)

clipboard_copy if enabled, the plugin will automatically copy validation results to the system clipboard. (This setting is disabled by default and might not work with some Linux/macOS versions.)

update_check if enabled, the plugin will check MR for plugin updates. (This setting is enabled by default.)

check_interval the number of days between update checks. (The default value is 7; i.e., the plugin will check for updates once a week.)

usage if enabled, the plugin will also display best practice recommendations. (This setting is disabled by default.)

is32bit If you're getting a StackOverflow error message, change this value to true.

Troubleshooting tips for Windows users

The EPUBCheck Java files are missing

If the epubcheck-5.x.x.zip download fails, download epubcheck-5.x.x.zip and extract the files to the \sigil-ebook\sigil\plugins\EpubCheck plugin folder.

Java isn't found

If your getting a FileNotFound Python error message or an error message after entering java -version, Java is most likely not installed and/or the path to the Java binaries wasn't added to the Windows PATH environment variable.

If you're unsure whether Java is installed on your machine download and install the latest Java version. (You might have to reboot your machine after the installation.)

If you're pretty sure that Java is installed on your machine open the Windows Explorer and look for the following folders:

Code:
C:\Program Files\Java\
C:\Program Files (x86)\Java\
If one of these folders exists, search for a \jre1.x.0_yy\bin subfolder that contains java.exe (and a bunch of other programs) and copy the folder path to Notepad. For example:

Code:
C:\Program Files\Java\jre1.8.0_25\bin
Then open the Environment Variables dialog box (Control Panel > System > Advanced Settings > Environment Variables > PATH > Edit) and add a semicolon and the Java path to the PATH environment variable. (For more information see the Oracle website.)

You should now get a version number, when you enter java -version in a command prompt window.

Note: If you install Java for the first time make sure to disable the Java browser plugin(s).

Python isn't detected when you click the Auto button

If no Python path is detected when you click Auto in the Manage Plugins dialog box, install Python.
(However, it'd be much easier, if you simply checked the Use Bundled Python option, if it isn't greyed out.)

Troubleshooting tips for macOS users

Since the update check feature might not work with certain macOS/Sigil versions, you might have to manually download the latest EPUBCheck files from the W3C website. (Unzip epubcheck.jar and the lib folder to the EpubCheck plugin folder.)

License: GNU General Public License v3 (GPL-3)
Attached Files
File Type: zip EpubCheck_v0.4.7.1.zip (88.0 KB, 777 views)

Last edited by Doitsu; 05-27-2024 at 03:37 PM. Reason: added support for encrypted fonts
Doitsu is offline   Reply With Quote