Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-17-2014, 09: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,950
Karma: 11600000
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).

License: GNU General Public License v3 (GPL-3)
Attached Files
File Type: zip epubcheck.zip (5.48 MB, 1626 views)
File Type: zip EpubCheck_v0.4.0.zip (7.44 MB, 553 views)

Last edited by Doitsu; 08-15-2017 at 05:36 PM. Reason: Uploaded new version with clipboard support
Doitsu is offline   Reply With Quote
Old 10-17-2014, 09:41 AM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 50,333
Karma: 43459801
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Very nice!
JSWolf is offline   Reply With Quote
Old 10-17-2014, 01:04 PM   #3
Arios
A curiosus lector!
Arios ought to be getting tired of karma fortunes by now.Arios ought to be getting tired of karma fortunes by now.Arios ought to be getting tired of karma fortunes by now.Arios ought to be getting tired of karma fortunes by now.Arios ought to be getting tired of karma fortunes by now.Arios ought to be getting tired of karma fortunes by now.Arios ought to be getting tired of karma fortunes by now.Arios ought to be getting tired of karma fortunes by now.Arios ought to be getting tired of karma fortunes by now.Arios ought to be getting tired of karma fortunes by now.Arios ought to be getting tired of karma fortunes by now.
 
Arios's Avatar
 
Posts: 458
Karma: 2007994
Join Date: Jun 2012
Device: Sony PRS-T1, Kobo Touch
Thanks Doitsu!

This is a very nice idea and AFAIK after 3 quick tries, its work well.

Cheers.
Arios is offline   Reply With Quote
Old 10-17-2014, 04:16 PM   #4
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 2,615
Karma: 780906
Join Date: Nov 2009
Device: many
Hi,

Yes, very nicely done. And the perfect thing for a plugin.

Is there a moderator here who can add this plugin thread to the sticky list of plugins?

Thanks!

KevinH
KevinH is offline   Reply With Quote
Old 10-17-2014, 04:31 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 21,071
Karma: 20800802
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab 2(RIP)
Stuck

Last edited by theducks; 10-17-2014 at 07:58 PM. Reason: unstuck
theducks is online now   Reply With Quote
Advert
Old 10-17-2014, 06:03 PM   #6
pete6055
Enthusiast
pete6055 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Nov 2012
Device: none
Thanks for the plugin. It's the first I've tried, and when I run it I get the following error:
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

has value '1.8', but '1.7' is required.

Error: could not find java.dll

Error: Could not find Java SE Runtime Environment.

Java and SE Runtime are installed and in the system path.

Any idea why I'm getting this error.

Thanks for your help.
pete6055 is offline   Reply With Quote
Old 10-17-2014, 07:08 PM   #7
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,950
Karma: 11600000
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by pete6055 View Post
Thanks for the plugin. It's the first I've tried, and when I run it I get the following error:
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

has value '1.8', but '1.7' is required.
If you have a 64bit machine, you might have different 32bit and 64bit Java versions installed and/or your PATH environment variable doesn't point to the correct Java program folder.
Unless you have other more important Java programs installed that require a specific Java version, I'd recommend downloading and installing the latest 32bit and 64bit Java versions from Oracle. (The installer will automatically remove older versions.)

Also don't forget to add/update the PATH environment variable as described in my first post. (If you enter java -version in a command prompt window and don't get a version number, the plugin will not work.)

If you still can't get it to work, I'd recommend downloading epagina's user-friendly epubcheck version, which should work with Java 1.6. or higher.
Doitsu is offline   Reply With Quote
Old 10-18-2014, 10:30 AM   #8
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1054509
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
This was something Kevin and I talked about but never had the time to do. It looks like you're going to force us to make a new plugin type specifically for validators sooner rather than later.
user_none is offline   Reply With Quote
Old 10-18-2014, 11:22 AM   #9
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 2,615
Karma: 780906
Join Date: Nov 2009
Device: many
Hi,
Actually the output plugin works well for this as it changes nothing at all in the current ebook files inside Sigil as the only access is via a book copy but does make the entire ebook (less mimetype) file available.

Now if you wanted to do something special with the epubcheck output or wanted to make it easy to highlight text needing work in files or something along those lines, then a separate plugin type for validators with expanded capability would truly be needed.

Basically, the same approach used by Doitsu can be used to invoke kindlegen or any other separate tool. So if Doitsu or any other plugin author wants to build a Kindlegen plugin, say maybe with a search to find the kindlegen executable on the users system or a filedialog to allow users to select it and saved preferences for settings and options for kindlegen that would be a wonderful thing!!! ..... Hint Hint

KevinH
KevinH is offline   Reply With Quote
Old 10-18-2014, 12:53 PM   #10
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1054509
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by KevinH View Post
Now if you wanted to do something special with the epubcheck output or wanted to make it easy to highlight text needing work in files or something along those lines, then a separate plugin type for validators with expanded capability would truly be needed.
That's what I was thinking. Some way for the plugin to return a standardized format which we can then load into an issues widget (like FlightCrew currently does), then the user could go though each one and clicking the issue would take them directly to it (as happens with FlightCrew now).
user_none is offline   Reply With Quote
Old 10-18-2014, 01:39 PM   #11
pete6055
Enthusiast
pete6055 began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Nov 2012
Device: none
Thanks for the help with my java problem. It is fixed. When I looked I found some old entries in the Program Data folder and the registry. I also uninstalled 1.7 but left 1.8...

Neat plugin!
pete6055 is offline   Reply With Quote
Old 10-19-2014, 05:17 PM   #12
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1054509
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
@Doitsu,

The next release of Sigil will include a "validation" plugin type. If you use it then you can set the validation results in the plugin and they'll be loaded into the validation pane in the main window. Just like what happens when you use FlightCrew. This means the results won't disappear when the plugin runner dialog is closed and you can click on the entry to go directly to the associated error line.

Here is a quick example of how you'd use it in a plugin:
Code:
def run(bk):
    bk.add_result('info', 'Section0001.xhtml', 1, 'info stuff')
    bk.add_result('warning', 'Section0001.xhtml', 3, 'warn stuff')
    bk.add_result('error', 'content.opf', 4, 'error stuff')
    return 0
user_none is offline   Reply With Quote
Old 10-19-2014, 05:34 PM   #13
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,950
Karma: 11600000
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by user_none View Post
@Doitsu,

The next release of Sigil will include a "validation" plugin type. If you use it then you can set the validation results in the plugin and they'll be loaded into the validation pane in the main window. Just like what happens when you use FlightCrew. This means the results won't disappear when the plugin runner dialog is closed and you can click on the entry to go directly to the associated error line.

Here is a quick example of how you'd use it in a plugin:
Code:
def run(bk):
    bk.add_result('info', 'Section0001.xhtml', 1, 'info stuff')
    bk.add_result('warning', 'Section0001.xhtml', 3, 'warn stuff')
    bk.add_result('error', 'content.opf', 4, 'error stuff')
    return 0
Thanks that's great news! I'll check it out once the next version becomes available and will update my plugin.
Doitsu is offline   Reply With Quote
Old 11-30-2014, 06:27 AM   #14
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 15944961
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
epubcheck

Thanks for the guidance.

I got everything installed and apparently running OK. The tool doesn't like any header. What is a "XML NMTOKEN"?

Code:
ERROR: tmpnm8njs.epub/OEBPS/Text/Drift from Two Shores_0001.htm(9,67): value of attribute "name" is invalid; must be an XML NMTOKEN
Code:
<head>
  <title>Drift from the Shores</title>
  <meta content="Harte, Bret" name="dcterms.creator" />
  <meta content="2014/11/29" name="dcterms.date of publication" />
  <meta content="Ebook prepared by crutledge@knology.net" name="dcterms.Description" />
  <meta content="en" name="dcterms.language" scheme="DCTERMS.RFC4646" /> 
  <meta content="Public Domain" name="dcterms.rights" />
  <meta content="Short Stories" name="dcterms.subject" />
  <meta content="Drift from the Shores" name="dcterms.title" />
  <link href="../Styles/main.css" rel="stylesheet" type="text/css" />
</head>
crutledge is offline   Reply With Quote
Old 11-30-2014, 06:55 AM   #15
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,950
Karma: 11600000
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by crutledge View Post
The tool doesn't like any header. What is a "XML NMTOKEN"?
An XML NMTOKEN ís "IDPF speak" for "valid id/name value." You used

Code:
<meta content="2014/11/29" name="dcterms.date of publication" />
which is invalid, because id/name attributes must not contain spaces. If you replace them with dots the error will go away. However, you might as well delete all <meta content=...> entries, because, AFAIK, no reading app actually uses them.

You may want to define these entries in Sigil's Metadata Editor instead.
Doitsu is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] KindleImport Sigil plugin DiapDealer Plugins 151 09-27-2017 06:05 PM
[Plugin] PunctuationSmarten Sigil plugin DiapDealer Plugins 72 09-25-2017 01:50 PM
Sigil Plugin Index Thasaidon Plugins 0 10-04-2014 08:41 AM
FC and Sigil 0.5.3 ePUBcheck failure Hitch Sigil 32 04-17-2012 03:56 AM
Web-based epubcheck upgraded to epubcheck 1.0.5 kjk ePub 4 02-09-2010 10:53 PM


All times are GMT -4. The time now is 02:01 PM.


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