View Full Version : ePubchecker the easy way


elibrarian
01-05-2013, 01:29 PM
There are many complaints about how difficult it is to use the epubcheck validation tools.

I have made a very small tool for Windows (actually a two line batchfile!) to make it as easy as drag-and-drop. I enclose a zipped file containing the tool.

It contains epubcheck-HOWTO.txt, containing an annotated how-to-use edition of the batchfile, and epubcheck.bat, which is the "clean" twoliner.

Of course you must have some version of java on your machine, as the epubcheck validation tools is a java programme.

I am sure this can be done in a similar way (python, shell script, whatever) on a mac or linux box - if anybody do it, or improve my little twoliner, please share! :thumbsup:

Regards

Kim

Arios
01-07-2013, 06:58 PM
Hi, elibrarian,

Thanks for sharing this little app, this is a wise idea and indeed, things are a bit easier with it!

However, it works only in one way: if the epub is correct, the message displayed is (for me):

"Epubcheck Version 3.0
Validating against EPUB version 2.0
No errors or warnings detected. "

Perfect!

But if there are errors, here is the message displayed:

"Version 3.0 Epubcheck
Validating against EPUB version 2.0"

This is to say: nothing!

The cmd window disappears too quickly for me to read the error message.

Two solutions perhaps: to prevent the cmd window from closing or copy the error message and redirect it into the text file.

DaleDe
01-07-2013, 09:03 PM
One fix is to open the epubcheck.bat file in a text editor like notepad and then change the > to 2>.

This will send the errors to the file instead of the progress messages.

Another way to fix this is to leave > going to errors.txt as it does now and add 2>&1 at the end of the line to redirect the errors to the same file. This way, both progress messages and error messages will end up in the file.

Which you do depends on what you want to happen.

Dale

Arios
01-07-2013, 10:13 PM
Thanks Dale,

Now it works perfectly.

Have a nice sunny day (here it's snowing :()

Arios

elibrarian
01-08-2013, 06:17 AM
There seems to be some differences in how the redirect > or >> works.

According to the specs, a single > redirects output and overwrite any file of the same name, whereas >> redirects and append to file.

- which is how it works here on my Windows 7.

The fille errors.txt should be in the same folder as the epubcheck.bat file (and should open in whatever texteditor is default on your system, but I have found, that it does not always work if you have a third-party editor set up as default.)

Regards,

Kim

Jellby
01-08-2013, 06:27 AM
But ">" and ">>" redirect only the "normal output". The errors, if any, usually go through a different stream and must be directed separately. DaleDe's suggestion of using "2>&1" means that the errors (2) are redirected to the same place as the output (1).

elibrarian
01-08-2013, 08:46 AM
But ">" and ">>" redirect only the "normal output". The errors, if any, usually go through a different stream and must be directed separately. DaleDe's suggestion of using "2>&1" means that the errors (2) are redirected to the same place as the output (1).

You're right - I've updated the package in original post accordingly :thanks:

Regards,

Kim