Search:
Go to Lulu Help pages
Reply
Proofreader
BryceCampbellsbooks
Posts: 138
Registered: ‎02-11-2010

Re: How to create an e-pub

[ Edited ]

Ken Anderson wrote:

Bryce you say that InDesign produces an EPUB without the user needing to know HTML.

That's true to a point.

But when one does understand the coding of the various components they can be tweaked to complete the job.  This is particularly true of the CSS.



Yes, I agree that it is only true to a certain point, which is why I recommend people make it manually. The statement you provided is true for any software that makes EPUBs.

 

 


paullima wrote:

A freind sent me her ePub book and I can open it no problem in the Calibre ePub viewer and in Adobe Digital Editions. I converted the Word Doc file of one of my books, "How to Write a Non-fiction Book in 60 Days," into an unfiltered HTM file in Word and then imported it into Calibre and created an ePub book that I can open in the Calibre ePub viewer and in Adobe Digital Editions. I am please with how it looks. But, as mentioned, when I upload it to Lulu I get "Oops! You uploaded an invalid EPUB file." When I look in the folder where Calibre has saved the book, I see four files:

- cover.jpg (my book cover displays nicely in the calibre viewer and in Adobe)

- How to write a non-fiction book in 60 da - paul lima.epub (opens fine in Adobe)

- How to write a non-fiction book in 60 da - paul lima.zip. (I know what a zip file is; haven't opened this one)

- metadata.opf

I guess my question is: what file am I supposed to edit and what am I supposed to edit it in? Any one of these four, or my original Word HTM file?


None of those look right, it's what is contained in one of them. The JPEG or image files usually never cause problems in EPUBs. It's always either the HTML or XML that causes the problems.

You want to change the ".epub" extension to ".zip" and these are the files you should see:

  • content.opf (this is usually what the file that specifies the ebooks contents is called)
  • toc.ncx (may have a different name, I'm not too sure you can use a different name, but since it is listed in the previous file, I don't think the name matters)
  • META-INF/container.xml (this file usually does not have problems that cause it to make an EPUB invalid, so no need to worry about this. You could see where the OPF file you would need to edit would be, since its location must be specified in this file)
  • mimetype (just a plain text file)

As for what you need to edit the stuff in, it does not matter, but I would really recommend using W3C's validator to verify your HTML validates against XHTML 1.0, at minimum (specs say that it must be XHTML 1.1, but as long as you do not use any deprecated tags and do not ignore required attributes (really depends on the tag used), it should validate against XHTML 1.1, without any problems outside of the doctype being for XHTML 1.0 instead of XHTML 1.1). If the doctype is your only problem, then this lies within the one of the XML files, most likely content.opf, but it could also be the NCX file.

try running your epub through this. Afterwards, tells us of any errors it displays, this can really help us narrow down the problem.

 

Note: valid XHTML files require a doctype be specified, so if you don't have a doctype and that is the error W3C tells you, you're HTML is not valid.

to see my works, please visit

my storefront
Please use plain text.
Author
paullima
Posts: 32
Registered: ‎02-11-2010

Re: How to create an e-pub

Hi Bryce - really appreciate your effort here; unfortunately, my head is not quite at the level you are at, so I don't get much of what you are saying.

For instance, I don't know how to create an XHTML file. I have a Word file and can save it as an HTM file, but I have no idea how to create an XHTML file.

Also, you suggested that I convert How To Write A Non-fiction Book In 60 Da - Paul Lima.epub into a zip file by changing the extension. I thought one had to actually 'zip' a file to create a zip file, but thought I'd just try to change the epub ext into a zip extension, but when I did, I couldn't create the zip file because one already exists in the folder: Calibre has created a file called How To Write A Non-fiction Book In 60 Da - Paul Lima.zip

So it seem I have a zip file, but have no idea what to do with it to create a valid ePub. Should I unzip the zip file?

And once I do that, it seems I still have to edit something (don't know what) in a program - Notepad? Nvu (an HTML editor)? Also, even if I can open the right file in the right program, I don't know what I am supposed to be editing.

I have bookmarked W3C's validator but I don't know which file (the Word DOC or HTM file, something from the zip file, an  XHTML file I create?), I am supposed to validate against XHTML 1.0. Then it sounds like I am supposed to run my epub through this validator, which I have bookmarked, but at this point I don't know what file I am supposed to convert into an ePub or if I can use Calibre to do the conversion.

I suspect I need something really, really basic first: a step by step guide on how to create an ePub from nothing! As I've said, creating the Kindle file is a piece of cake compared to this. I don't even know what ingredients I need, or where to find them, or how to mix them to create a valid ePub. But thanks for your help. I will have to find something somewhere that is really basic. Wonder if they have a Creating ePubs for Dummied book out there?

Please use plain text.
Proofreader
BryceCampbellsbooks
Posts: 138
Registered: ‎02-11-2010

Re: How to create an e-pub

[ Edited ]

paullima wrote:

Hi Bryce - really appreciate your effort here; unfortunately, my head is not quite at the level you are at, so I don't get much of what you are saying.

For instance, I don't know how to create an XHTML file. I have a Word file and can save it as an HTM file, but I have no idea how to create an XHTML file.

Also, you suggested that I convert How To Write A Non-fiction Book In 60 Da - Paul Lima.epub into a zip file by changing the extension. I thought one had to actually 'zip' a file to create a zip file, but thought I'd just try to change the epub ext into a zip extension, but when I did, I couldn't create the zip file because one already exists in the folder: Calibre has created a file called How To Write A Non-fiction Book In 60 Da - Paul Lima.zip

So it seem I have a zip file, but have no idea what to do with it to create a valid ePub. Should I unzip the zip file?

And once I do that, it seems I still have to edit something (don't know what) in a program - Notepad? Nvu (an HTML editor)? Also, even if I can open the right file in the right program, I don't know what I am supposed to be editing.

I have bookmarked W3C's validator but I don't know which file (the Word DOC or HTM file, something from the zip file, an  XHTML file I create?), I am supposed to validate against XHTML 1.0. Then it sounds like I am supposed to run my epub through this validator, which I have bookmarked, but at this point I don't know what file I am supposed to convert into an ePub or if I can use Calibre to do the conversion.

I suspect I need something really, really basic first: a step by step guide on how to create an ePub from nothing! As I've said, creating the Kindle file is a piece of cake compared to this. I don't even know what ingredients I need, or where to find them, or how to mix them to create a valid ePub. But thanks for your help. I will have to find something somewhere that is really basic. Wonder if they have a Creating ePubs for Dummied book out there?


First, I deal with the change in extension.  As I think I said before, an EPUB is XML and HTML wrapped up in a zip file. The extension is, of course, epub, but it is still a zip archive.

 

You will unzip the zip archive, which gives you access to every file that makes up that particular ebook (images, html, etc.).  You will edit the necessary files in something (i.e. Notepad) or whatever else.  I suggest you copy the EPUB to a different location, before you change its extension and unzip it, that will solve that problem.

 

An XHTML file is just an HTML file, so you would upload the HTM that you have (HTM is an extension that designates HTML). XHTML itself is just a standard of HTML, not its own file format or language (however, the EPUB specs say that the OPF must list these files with the XHTML mimetype, so telling it that is xhtml but using either ".htm" or ".html" will not matter. looking through an unarchived epub from something like Project Gutenberg (which is essentially what is going on when you change ".epub" to ".zip" and then unarchive the zip), should tell you exactly what the XHTML mimetype is (or Google can help with that)).

 

Sorry, no Creating EPUBs for Dummies exists, you'll be better off getting InDesign (or using Smashwords, but you can't distribute the ebooks they make for you yourself, it can only be distributed by their premium catalog).

 

As I said before, the error reporting from the threepress validator link will tell us where we need to look. Ken would probably also be running it through validation software, in order to find flaws, as the first step is isolating the problem, not trying to deal with the whole issue at once.  The validators serve the purpose of isolating problems down to a single place or file.

to see my works, please visit

my storefront
Please use plain text.
Author
paullima
Posts: 32
Registered: ‎02-11-2010

Re: How to create an e-pub

Wow.  I moved the epub to another folder, renamed its extension as zip and unzipped it... I know have 32 files and a Meta-Inf folder in my new folder... I will take a closer look at things tomorrow, thanks.

Please use plain text.
Author
paullima
Posts: 32
Registered: ‎02-11-2010

Re: How to create an e-pub

So now I have all these HTML documents (uzipped from the ePub document) and no idea what to do with them. I can pull them into Nvu and look at the source code, but I have no idea what to edit or revise, or why.

> which is why I recommend people make it manually. 

Is there really no place in this online universe that says "here's what your XML files for basic epubs should look like for those who want to do it manually?

> The validators will show you the basic errors that need correcting but then you really need to study what an EPUB file should contain.

Where do you learn what the ePub file should contain? I've scrolled through the the EPUB spec and I really don't see what aspect of it apply to my HTML files. Is there a particular aspect of the ePub spec that applies to what the HTML files should look like at the source code level?

Please use plain text.
Proofreader
BryceCampbellsbooks
Posts: 138
Registered: ‎02-11-2010

Re: How to create an e-pub

You can only find out what to edit, by finding out where the problem occurs.  Run each of those files through W3C's validator, telling it you want to validate it against XHTML 1.0.  For this part, I would suggest taking a screenshot of each of the files (it will tell you exactly what HTML files, if any to edit).  If none of them are invalid, then move on to the threepress validator with the epub (you'll need to change ".zip" back to ".epub"). The threepress validator will tell you about errors in HTML, but it will not tell you how to fix them, nor will it highlight your mistakes, since no option exists for that. Only W3C's validator will highlight mistakes, if you choose for it to do so.

 

There are places that do, but none of them have self-documenting code, by including comments, so it will not be easy (the code examples will look like a mess. Also, the place I would have recommended moved the code into images, which is stupid in some cases). The reason I said that I prefer people do it manually is because programs that create EPUB don't necessarily guarantee valid EPUB files, which is same weakness of Nvu and Dreamweaver with HTML.

The HTML just holds the book's contents, so outside of making it valid against XHTML 1.0 or 1.1 exactly, there's not much to be done. The major stuff is in XML.  This place should help with changing the code in HTML files over to XHTML and lists the various XHTML Doctype, if you should need it (W3C's validator will help the most). As for the XML and mimetype files, I can send you a sample.  It will take me some time to put in comments though, so it can be read easily.

to see my works, please visit

my storefront
Please use plain text.
Author
paullima
Posts: 32
Registered: ‎02-11-2010

Re: How to create an e-pub

Just want to say that my wife got a Kobo for her birthday (the ePub reader from Canada's Chapters-Indigo store). And I loaded the book that I created with Calibre on it, and it looks grand - formating, fonts, spacing, illustrations. So looks like I'll be selling my ePubs direct, not on Lulu. Lulu's been good to me, and for my books, but we're going to have to part company on this one.

Please use plain text.