您的位置:首页 > 其它

epubcheck用法(转)

2015-10-16 11:17 447 查看

Running

Tobias Fischer edited this page on 2 Sep ·
8 revisions

EpubCheck is a command line tool, all detected errors are simply printed to
stderr
output stream.

There's no native GUI – however, there are some thirdparty apps offering a GUI. See theGUI wiki page for further details.

System prerequisites

To run the tool you need Java (1.6 or above, 1.7+ recommended). Any Operating System should do.

Note on Java:

You need at least JRE or JDK 1.6 to run EpubCheck on the commandline. However, starting with EpubCheck 4.0 werecommend Java 1.7 or 1.8 to be able to run advanced image checks (Java 1.6 doesn't support those).

Note on Java on Mac OS X:

Due to the change in ownership of the Apple Java version from Apple to Oracle, Java 1.6 (Apple) and Java 1.7+ (Oracle) are kind of incompatible to each other. To run EpubCheck with advanced image checks in a Mac OS X Terminal, theOracle
JDK 1.7+ is required!

Running from the command line

Validating a packaged EPUB

java -jar epubcheck.jar file.epub

Specifying a validation profile

It is possible to specify a validation profile to validate an EPUB (or single file thereof) against a specific IDPF specification.

java -jar epubcheck.jar file.epub -profile PROFILE

Current profiles include:

default
: the default validation profile
dict
: validates against the
EPUB Dictionaries and Glossaries specification
edupub
: validates against the
EDUPUB Profile
idx
: validates against the
EPUB Indexes specification
preview
: validates against the
EPUB Previews specification
Note: In most cases, it is not required to specify the validation profile explicitly, as it will automatically be set according to
dc:type
metadata in the Publication. Setting the profile explicitly can be useful to detect when such
dc:type

metadata is missing, or to validate single files (see next section).

Validating a single file

java -jar epubcheck.jar singleFile -mode MODE -v VERSION -profile PROFILE


MODE must be one of the following:

opf
for package document validation;
nav
for navigation document validation (available only for version 3.0);
mo
for media overlay validation (available only for version 3.0);
xhtml
;
svg
;
exp
for Expanded EPUB validation (see the next section)

VERSION must be one of

2.0

3.0


PROFILE is optional (see the previous section).

Note that when validating a single file, only a subset of the available tests is run. Also, when validating a full EPUB, both mode and version are ignored.

Validating an "expanded" (i.e. unzipped) EPUB

java -jar epubcheck.jar folder/ -mode exp [-save]

When using expanded mode, there's an optional flag
-save
to save the created archive upon validation.

Additional flags

-out file.xml
outputs an assessment XML document
-quiet
or
-q
outputs only if there is any warning or error
-help
,
--help
or
-?
displays a help message
转自:https://github.com/IDPF/epubcheck/wiki/Running

epubcheck项目地址:https://github.com/IDPF/epubcheck
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  epubcheck 用法