First why are we talking about getting an ePub to validate? Simply because it is one way to assure that your ebook files can be viewed properly by readers. This doesn’t mean there won’t be any errors or weirdness, but it does help. Also, there are a few places that will reject epub files if they don’t validate. And, of course, being a professional, you want to put out the best product possible. So let’s go through the few simple steps to getting an epub to validate.
To get started, download Sigil. It’s a free program from Google. Second make sure you have an epub file to validate. Don’t know how to build one? Check out my article on building epub ebook files using Calibre.
1.) Open ePub in Sigil: File/Open select file
2.) Click on any htm or html file in left pane and <> symbol/code view in toolbar.
3.) Control H will bring up Find and Replace window. In Find what: type: clear=“all” Make sure Look in: is set to All HTML Files. Leave Replace with blank. Select Replace All.
4.) Check TOC by viewing it in right sidebar. (If it isn’t visible, make it visible by going to View/Table of Contents.) Hit “Generate TOC from headings, ” a bar which runs below the Table of Contents window. Unselect anything you don’t want included in TOC. Hit OK.
5.) Check Meta by going to Tools/Meta Editor. Check Meta data. Make adjustments by changing value or Adding (Basic or Adv.). Select OK
6.) Add Semantics. Double click on any htm file (to open it so you can see what it is). Right click on same file. Then go to “Add Semantics” and pick appropriate label. Most important one is “text.” Select this for where you want your book to open. This doesn’t work in all readers, but will in many.
7.) This should be all you have to do here, but you can edit your html at this time if you have changes. You can also add “semantics” which tell eReaders which parts of the file contain different common elements. To do this right click on any htm file. Go to “Add Semantics” and choose what type of element the file is. Only choose each type ONCE. “Text” should be the first chapter. Do not feel you need to use all of the choices available.)
8.) File/Save should save to your Calibre folder or wherever the original ePub file it opened was.
9.) Go to http://validator.idpf.org/
10.) Browse to your ePub file and select validate
Hopefully, you will get a green check mark telling you that your epub file is valid and you have mastered the steps of getting an epub to validate. If the epub file doesn’t validate, IDPF will list your errors. You can then go back into Sigil and edit the html. (Don’t be intimidated if the list looks long. It is probably just one or two errors repeated a number of times and one easy search in Sigil will find them.)
Try again…. There? Great.
~~~
Lori Devoti is the multi-published author of romantic comedy, paranormal romance and urban fantasy. She also writes the Dusty Deals Mystery series under the pen name Rae Davies. Look for her workshops at Write by the Lake (DCS University of Wisconsin), at various conferences, and here at the How To Write Shop. For more information, visit her web site.