ePubcheck on Linux

All you need to know to install and use ePubcheck on a GNU/Linux environment !

epubcheck on linux

#!/bin/sh
java -jar /opt/epubcheck/epubcheck.jar $1

In order to add ePubcheck to your PATH :

  • Edit your .bashrc file and add the following (here with the epubcheck bin file being in the User directory) :
PATH=$PATH:/home/user/
export PATH
  • Export the new $PATH variable to the environment :
$ source ~/.bashrc
  • Test your settings :
$ epubcheck -help

When running this tool, the first argument should be the name (with the path) of the file to check.
 If checking a non-epub file, the epub version of the file must be specified using -v and the type of the file using -mode.
 The default version is: 3.0.

Modes and versions supported:
 -mode opf -v 2.0    // For single OPF file validation (EPUB 2)
 -mode opf -v 3.0    // For single OPF file validation (EPUB 3)
 -mode xhtml -v 2.0  // For single XHTML file validation (EPUB 2)
 -mode xhtml -v 3.0  // For single XHTML file validation (EPUB 3)

etc.
  • Well done ! You can now use the epubcheck command on a single file :
$ epubcheck myfile.epub
 Epubcheck Version 3.0.1
 Validating against EPUB version 2.0
 ERROR: 9782092542422.epub/OEBPS/content.ncx(19,44): assertion failed: playOrder sequence has gaps
 ...
  • Or on several files in any directory, and even copy the output to a text file :
$ for z in path/*.epub; do epubcheck $z; done &> log.txt
Advertisements

Comments are closed.

Blog at WordPress.com.

Up ↑