Coder Social home page Coder Social logo

epub_validator's Introduction

[INACTIVE] epubValidator

Check if your EPUB eBooks are valid

Later releases of epubCheck are much more friendly to use, which means the usefulness of this GEM has diminished and so is no longer maintained. I recommend you now use the official epubCheck tool.

====

This library will check that your .epub files are valid IDPF EPUB documents (version 2.x and 3.0) and return a successful or error message. It can be called as a Ruby library, or invoked from the command line.

For more about the IDPF see http://idpf.org

For more about the epubcheck tool see http://code.google.com/p/epubcheck/

Setup

gem install epub_validator

Basic Usage

Sample usage and output:

require 'epub_validator'

epub = EpubValidator.check('/path/to/sample.epub')

puts "Invalid!" unless epub.valid?
epub.messages.each do |m|
  puts m
end
=> Invalid!
=> ERROR: OPS/toc.ncx(21): 'OPS/': referenced resource exists, but not declared in the OPF file

Now from the command line:

$ epub_validator /path/to/sample.epub

Checking....FAILED!

This is not a valid EPUB 3.0 ebook.

ERROR: OPS/toc.ncx(21): 'OPS/': referenced resource exists, but not declared in the OPF file

Requirements

Java must be installed and set in your PATH.

Future Features

  • Command line: accept directory containing many .epub files for processing.
  • Command line: have switch for writing results to log file
  • Format "ERROR" and "WARNING" output for more intuitive instructions.

epub_validator's People

Contributors

mrcook avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.