From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan L Tyree Subject: Re: Making ePub books: further report Date: Mon, 12 Dec 2011 06:29:16 +1100 Message-ID: <1323631756.20628.18@windy> References: <1323586770.20628.12@windy> <6723.1323587268@alphaville.dokosmarshall.org> <1323588345.20628.13@windy> <7397.1323589330@alphaville.dokosmarshall.org> <1323596478.20628.16@windy> <1323597171.20628.17@windy> <81pqfvmnn8.fsf@gmail.com> 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]:54360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZp53-0004Gb-BC for emacs-orgmode@gnu.org; Sun, 11 Dec 2011 14:29:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZp51-0001qq-6p for emacs-orgmode@gnu.org; Sun, 11 Dec 2011 14:29:01 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:41643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZp50-0001qe-Rl for emacs-orgmode@gnu.org; Sun, 11 Dec 2011 14:28:59 -0500 Received: by iahk25 with SMTP id k25so8877675iah.0 for ; Sun, 11 Dec 2011 11:28:58 -0800 (PST) In-Reply-To: <81pqfvmnn8.fsf@gmail.com> (from kjambunathan@gmail.com on Sun Dec 11 21:02:51 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: Jambunathan K Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org On 11/12/11 21:02:51, Jambunathan K wrote: > Alan L Tyree writes: >=20 > > On 11/12/11 20:41:18, Alan L Tyree wrote: > >> On 11/12/11 18:42:10, Nick Dokos wrote: > >> > Alan L Tyree wrote: > >> >=20 > >> > > > http://thread.gmane.org/gmane.emacs.orgmode/41826/ > focus=3D41849 > >> > >=20 > >> > > Yes, Calibre does a nice job of converting XHTML to ePub; it > can > >> be > >> > > read in all the readers that I use, but it won't pass the=20 > >> > validation > >> > > tests. OK unless you want to publish on sites that require > >> > validation. > >> > >>=20 > >> I was being unfair to Calibre. If I clean up the XHTML file > produced > >> by=20 > >> org (in the way indicated by my original post plus a couple of > things=20 > >> that I didn't mention), then Calibre produces an ePub book that=20 > >> passes > >>=20 > >> validation. > >>=20 > >> So -- back to my original question: is there some variable > somewhere=20 > >> that puts in both name=3D"xxx" and id=3D"xxx" or do I need to write a=20 > >> post > >>=20 > >> export clean up function? > > > > Bad form to answer my own question: these seem to be hard coded in > org- > > html.el along with the other items that give ePub validation a > nervous=20 > > breakdown. I'll post a full list of the offending items later. >=20 >=20 > If you use org-xhtml.el (in contrib/lisp/org-xhtml.el) then you can > re-define some aspects of html export selectively. >=20 > For example, you can redefine this to >=20 > ,---- original > | (defun org-xhtml-format-anchor (text name &optional class) > | (let* ((id name) > | (extra (concat > | (when name (format " name=3D\"%s\"" name)) > | (when id (format " id=3D\"%s\"" id)) > | (when class (format " class=3D\"%s\"" class))))) > | (org-xhtml-format-tags '("" . "") text extra))) > `---- >=20 > this >=20 > ,---- modified > | (defun org-xhtml-format-anchor (text name &optional class) > | (let* ((id name) > | (extra (concat > | (when id (format " id=3D\"%s\"" id)) > | (when class (format " class=3D\"%s\"" class))))) > | (org-xhtml-format-tags '("" . "") text extra))) > `---- >=20 > to strip name from anchor. >=20 > I am not sure whether org-xhtml.el will minimize your efforts. Just a > suggestion. >=20 > ps: Add contrib/lisp to load-path and do org-export-as-xhtml. Thanks for this, Jambunathan. I'll give this a try. Cheers, Alan >=20 > > Cheers, > > Alan > > > >>=20 > >> Thanks, > >> Alan > >>=20 > >> --=20 > >> Alan L Tyree http://www2.austlii.edu.au/~alan > >> Tel: 04 2748 6206 sip:172385@iptel.org > >>=20 > >>=20 > >>=20 >=20 > --=20 >=20 --=20 Alan L Tyree http://www2.austlii.edu.au/~alan Tel: 04 2748 6206 sip:172385@iptel.org