From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan L Tyree Subject: Re: ePub construction Date: Wed, 14 Dec 2011 14:14:02 +1100 Message-ID: <1323832442.2949.1@misty> References: <10534.1323826958@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RafHj-0005QY-8E for emacs-orgmode@gnu.org; Tue, 13 Dec 2011 22:13:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RafHh-0006jF-QK for emacs-orgmode@gnu.org; Tue, 13 Dec 2011 22:13:35 -0500 Received: from mail-qy0-f169.google.com ([209.85.216.169]:35279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RafHh-0006jA-Nj for emacs-orgmode@gnu.org; Tue, 13 Dec 2011 22:13:33 -0500 Received: by qcsd17 with SMTP id d17so266869qcs.0 for ; Tue, 13 Dec 2011 19:13:33 -0800 (PST) In-Reply-To: <10534.1323826958@alphaville.americas.hpqcorp.net> (from nicholas.dokos@hp.com on Wed Dec 14 12:42:38 2011) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org On 14/12/11 12:42:38, Nick Dokos wrote: > Alan L Tyree wrote: >=20 > > G'day, > >=20 > > Here are the modifications that I needed to make to the exported > html=20 > > file (using the standard exporter) in order to get a valid ePub=20 > > document. http://threepress.org/document/epub-validate provides an=20 > > on-line validation service. > >=20 > > My document is relatively simple, but does have footnotes,=20 > citations >=20 > > and formatting commands. > >=20 > > I will be happy to add a fuller description to worg if someone will=20 > > point me to some instructions. > >=20 > >=20 > > 1. Make the html file have utf-8 encoding; there are probably > several=20 > > ways to do this, but I used the emacs23 menu MULE options on the=20 > org >=20 > > document. > >=20 > > 2 Change the language statement by removing the "lang=3D" attribute: > >=20 > > From: > xml:lang=3D"en"> > >=20 > > To: > >=20 > > 3 Change anchor descriptions associated with section headings by > > removing "name=3D" entries, for example, > >=20 > > From: > >=20 > > To: > >=20 > > NOTE: this can now be done by customising org-export-html-headline- > > anchor-format (Thanks Bastien!!) > >=20 > > 4. Change anchor class=3D"footref" by replacing "name=3D" with "id=3D". > For > > example: > >=20 > > from: > >=20 > > to: > >=20 > > 5. Change anchor class=3D"footnum" by replacing "name=3D" with "id=3D". > For > > example: > >=20 > > from: 1 > >=20 > > to: 1 > >=20 >=20 > Interesting - I downloaded the epub validator, ran Calibre on a silly > little org-produced HTML file and duplicated your "lang" problem. >=20 > AFAICT, all of the problems you mention above are legal HTML4, so > either > the epub spec (which I have not looked at: do you have a pointer?) is > made to trip people up by enforcing restrictions that they dreamed=20 > up, > or the validator is not quite as smart as it should be. Yes, the org export file validates at w3c as a valid XHTML1.0 file. The=20 ePub spec is here: http://idpf.org/epub but I admit fatigue in trying=20 to wade through it, so I don't know what XHTML1.0 constructions it=20 objects to. It seems like the kind of document that nobody has ever=20 read: sort of like EULAs and express warranties. I just made the changes in response to the validation errors. >=20 > Just for kicks, I ran it against the Calibre Quick Start Guide (the > only > "real" ebook I had access to) and it gave me an error :-) >=20 > ,---- > | Epubcheck Version 3.0b3 > |=20 > | ERROR: Calibre Quick Start Guide - John > Schember.epub/OEBPS/content.opf(5,57): attribute "file-as" not=20 > allowed > here; expected attribute "id", "opf:file-as", "opf:role" or=20 > "xml:lang" > |=20 > | Check finished with warnings or errors! > `---- >=20 > so, presuming that the ebook is "fine", I'm not sure how seriously to > take the validator. There is something to that. Calibre explicitly disclaims any intent to=20 produce an epub file that validates. In fact, the FAQ seems to suggest=20 that a Calibre produced file is *better* than one that validates: http://manual.calibre-ebook.com/faq.html#the-epub-i-produced-with-app-is-no= t-valid The problem is that some marketing sites require validation, although I=20 am not sure how much that is enforced. >=20 > Nick >=20 > PS In case it's not obvious, all I know about ebooks is what is > contained in this email. Caveat emptor. Ahhh, what about statutory warranties :-). Cheers, Alan >=20 --=20 Alan L Tyree http://www2.austlii.edu.au/~alan Tel: 04 2748 6206