Perspectives of a Writer and Musician

Issues related to writing, publishing and playing jazz music: One man's muse.
by Al Stevens

My Photo
Location: Florida, United States

Wednesday, April 10, 2013

A Gearhead's Guide to E-book Publishing - Lesson 8: Epub Validation

Lesson 7 was about the table of contents and metadata. If everything went well, you now have your e-book in a proper epub format. But you want to be sure.

This lesson explains how to validate the epub file to ensure that it complies with industry standards. Your devices and applications might properly render a non-compliant epub file, but some online distribution sites might refuse to list it in their catalogs, so validation is an important step in building an epub for publication.

Sigil has two built-in validators, one named FlightCrew that validates the epub and another that uses the W3C validator to validate the styles that you added to Stylesheet.0001.

FlightCrew Validation

Flightcrew is an open-source epub validator. You can download it here if you wish to use it outside of Sigil. To use the version that Sigil integrates:

    1.   Load your epub file into Sigil
    2.   Select Tools->Validate EPUB with FlightCrew

With luck, this is what you see next at the bottom of the Sigil application:

Be patient. The bigger your epub, the longer it takes.

If the epub contains code that flunks the validator, the Validation Results dialog lists each problem it found with the line of code identified like this:

For this example I removed a </p> tag from the cover.xhtml file to force the epub to fail and demostrate what to do.

    3. Double-click the errant line of code in the Validation Results dialog to have Sigil open the file in question and highlight the line where it found the error.

In this example, line 12 is highlighted with a dim yellow background color.

Here's where you need to exercise your html chops. The validator does not always identify the statement with the real error. It identifies the line it was parsing when it realized something was amiss. It's up to you to go looking for the real culprit, which should be somewhere above the highlighted line. In this case line 12 is highlighted, but the error is on line 11, which is missing the </p> tag that terminates an html paragraph (because I deleted it to make this point).

It won't always be that close, but I cannot possibly predict which of the many errors you might have in your epub file. I can say, however, that if you stick to the procedures in this tutorial, you shouldn't have much in the way of validation errors. But, as you get more comfortable with the html/css level of abstraction that the epub architecture provides and as you hand-code more and more of your epub, you are likely to slip up from time to time. In that case, find a deep gearhead who is willing to bail you out. They are everywhere online, and nowadays most folks have a neighbor or nephew like that.

The W3C Validator

This validator, available from Tools->Validate Stylesheets with W3C, sends your css stylesheet to a website for validation. I've used it, but too many times, Sigil fails to launch the remote validation website. At this time, I cannot recommend its use. If you want to try it, do so, follow the onscreen instructions, and see how it goes.

EPub Validator

If you plan to submit the epub to Apple's iBookstore, you should ensure that it passes the validation tests at Save your epub file first. Then follow the onscreen instructions, and, if you get errors that you do not understand or cannot fix, call someone for help. Once again, it's not possible to anticipate here all the kinds of errors that might show up, but, also again, if you took care in the use of Sigil, you should be okay.

The site includes a forum where you can get help. In one case where the validator did not provide ample information, I sent the epub file as an attachment, and the good folks there located the problem for me. Then they updated the site to properly display that kind of error message.

You should know that the epubs produced by Calibre from html exported from Word, which is the muggle's preferred way of doing all this, contain errors that do not pass the validator. These errors are usually html statements that have been deprecated by the formal specifications.

Spell Check

Sigil includes a spell checker similar to that of many word processors. Use F4 to check the spelling of words one at a time and the Tools->Spellcheck menu to proceed. I doubt that you need much in the way of additional instructions about that.

As usual, save your work. Once everything passes the validators, you have an epub document ready for publication. Next you'll convert it to the .mobi format that the Kindle requires.

Table of Contents
Lesson 1: HTML
Lesson 2: Content
Lesson 3: Frontmatter
Lesson 4: Chapters
Lesson 5: Opening Paragraphs
Lesson 6: The Cover
Lesson 7: TOC, Metadata
Lesson 8: Epub Validation
Lesson 9: The Mobi (Kindle) Format


Post a Comment

Subscribe to Post Comments [Atom]

<< Home