emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan L Tyree <alantyree@gmail.com>
To: Jambunathan K <kjambunathan@gmail.com>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: Making ePub books: further report
Date: Mon, 12 Dec 2011 06:29:16 +1100	[thread overview]
Message-ID: <1323631756.20628.18@windy> (raw)
In-Reply-To: <81pqfvmnn8.fsf@gmail.com> (from kjambunathan@gmail.com on Sun Dec 11 21:02:51 2011)

On 11/12/11 21:02:51, Jambunathan K wrote:
> Alan L Tyree <alantyree@gmail.com> 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 <alantyree@gmail.com> 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.
> >> <SNIP>
> >> 
> >> 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 '("<a%s>" . "</a>") 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 '("<a%s>" . "</a>") 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.

Thanks for this, Jambunathan. I'll give this a try.

Cheers,
Alan



> 
> > Cheers,
> > Alan
> >
> >> 
> >> Thanks,
> >> Alan
> >> 
> >> -- 
> >> Alan L Tyree                    http://www2.austlii.edu.au/~alan
> >> Tel:  04 2748 6206		sip:172385@iptel.org
> >> 
> >> 
> >> 
> 
> -- 
> 



-- 
Alan L Tyree                    http://www2.austlii.edu.au/~alan
Tel:  04 2748 6206		sip:172385@iptel.org

  reply	other threads:[~2011-12-11 19:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-11  6:59 Making ePub books Alan L Tyree
2011-12-11  7:07 ` Nick Dokos
2011-12-11  7:25   ` Alan L Tyree
2011-12-11  7:42     ` Nick Dokos
2011-12-11  8:28       ` Alan L Tyree
2011-12-11  9:41       ` Making ePub books: further report Alan L Tyree
2011-12-11  9:52         ` Alan L Tyree
2011-12-11 10:02           ` Jambunathan K
2011-12-11 19:29             ` Alan L Tyree [this message]
2011-12-11 15:52           ` Bastien
2011-12-11 15:51         ` Bastien
2011-12-11 20:47           ` Alan L Tyree
2011-12-11  7:50     ` Making ePub books Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323631756.20628.18@windy \
    --to=alantyree@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kjambunathan@gmail.com \
    --cc=nicholas.dokos@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).