View Single Post
Old 10-17-2014, 08:35 AM   #1
Doitsu
Wizard
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: 3,747
Karma: 9814736
Join Date: Dec 2010
Device: Kindle PW2
epubcheck plugin for Sigil

[Plugin] EpubCheck - Simple epubcheck wrapper

Updated: June 22, 2017
Current Version: "0.4.0"

This plugin is a very simple epubcheck 4.0.2 wrapper, which allows you to check the currently loaded book with Sigil.

Note that since the epubcheck Java app is executed in the background, you'll have to wait a couple of seconds before the messages are being displayed.

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.6 or higher

* 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)
java -version (should display java version "1.8.0_xx" or a higher version number)

Installation

1. Select Manage Plugins from the Plugins menu and 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 path or Set to manually select the Python interpreter path.
2. Click Add Plugin and select epubcheck_v0.4.0.zip. This will install the epubcheck plugin, which you can select via Plugins > Validation > epubcheck.
(If you haven't updated to Sigil 0.8.7 (or higher), you'll need to install epubcheck.zip.)

You can control three EpubCheck plugin settings via the EpubCheck.json file, which'll be generated after the first run of the plugin.

Code:
{
  "java_lang": "en",
  "clipboard_copy": false,
  "update_check": true
}
The first setting, java_lang, forces Java to run epubcheck.jar with a different language setting.
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'
Note that Japanese output will not work on non-Japanese Windows PCs.

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

The third setting, update_check, can be used to disable the automatic update check.

This version should also display correct line numbers in the macOS Sigil version, but I haven't been able to test this.

Troubleshooting tips for Windows users

If no Python path is detected when you click Auto in the Manage Plugins dialog box, install ActiveState Python 2.7.8.10.

If you're getting 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 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).
Attached Files
File Type: zip epubcheck.zip (5.48 MB, 1410 views)
File Type: zip EpubCheck_v0.4.0.zip (7.44 MB, 21 views)

Last edited by Doitsu; Yesterday at 06:49 AM. Reason: Uploaded new version with clipboard support
Doitsu is offline   Reply With Quote