From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Making ePub books: further report Date: Sun, 11 Dec 2011 15:32:51 +0530 Message-ID: <81pqfvmnn8.fsf@gmail.com> 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> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZgFP-0000Ch-QG for emacs-orgmode@gnu.org; Sun, 11 Dec 2011 05:03:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZgFO-0004KZ-Di for emacs-orgmode@gnu.org; Sun, 11 Dec 2011 05:03:07 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:59563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZgFO-0004KV-8o for emacs-orgmode@gnu.org; Sun, 11 Dec 2011 05:03:06 -0500 Received: by iahk25 with SMTP id k25so8210980iah.0 for ; Sun, 11 Dec 2011 02:03:05 -0800 (PST) In-Reply-To: <1323597171.20628.17@windy> (Alan L. Tyree's message of "Sun, 11 Dec 2011 20:52:51 +1100") 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: Alan L Tyree Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Alan L Tyree writes: > 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: >> > >> > > > http://thread.gmane.org/gmane.emacs.orgmode/41826/focus=41849 >> > > >> > > 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 >> > validation >> > > tests. OK unless you want to publish on sites that require >> > validation. >> >> >> I was being unfair to Calibre. If I clean up the XHTML file produced >> by >> org (in the way indicated by my original post plus a couple of things >> that I didn't mention), then Calibre produces an ePub book that >> passes >> >> validation. >> >> So -- back to my original question: is there some variable somewhere >> that puts in both name="xxx" and id="xxx" or do I need to write a >> post >> >> 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 > breakdown. I'll post a full list of the offending items later. If you use org-xhtml.el (in contrib/lisp/org-xhtml.el) then you can re-define some aspects of html export selectively. For example, you can redefine this to ,---- original | (defun org-xhtml-format-anchor (text name &optional class) | (let* ((id name) | (extra (concat | (when name (format " name=\"%s\"" name)) | (when id (format " id=\"%s\"" id)) | (when class (format " class=\"%s\"" class))))) | (org-xhtml-format-tags '("" . "") text extra))) `---- this ,---- modified | (defun org-xhtml-format-anchor (text name &optional class) | (let* ((id name) | (extra (concat | (when id (format " id=\"%s\"" id)) | (when class (format " class=\"%s\"" class))))) | (org-xhtml-format-tags '("" . "") text extra))) `---- to strip name from anchor. I am not sure whether org-xhtml.el will minimize your efforts. Just a suggestion. ps: Add contrib/lisp to load-path and do org-export-as-xhtml. > Cheers, > Alan > >> >> Thanks, >> Alan >> >> -- >> Alan L Tyree http://www2.austlii.edu.au/~alan >> Tel: 04 2748 6206 sip:172385@iptel.org >> >> >> --