From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Klein Subject: Re: Patch: HTML body onload/onunload attribute support for new exporter Date: Thu, 18 Oct 2012 11:42:11 +0200 Message-ID: <507FCEF3.4010609@mpip-mainz.mpg.de> References: <507EB0A8.4020903@mpip-mainz.mpg.de> <87vce9mcmc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOmfE-0004PJ-Lq for emacs-orgmode@gnu.org; Thu, 18 Oct 2012 05:45:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOmfA-0007pw-HC for emacs-orgmode@gnu.org; Thu, 18 Oct 2012 05:45:16 -0400 Received: from gate1.mpip-mainz.mpg.de ([194.95.63.248]:27391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOmfA-0007pS-Av for emacs-orgmode@gnu.org; Thu, 18 Oct 2012 05:45:12 -0400 In-Reply-To: <87vce9mcmc.fsf@gmail.com> 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Hallo, On 10/17/2012 03:50 PM, Nicolas Goaziou wrote: > Hello, > > Robert Klein writes: > >> I created a patch for the new exporter, so I can adding onload and >> onunload attributes to the body tag in HTML export. >> >> >> I'm rather new to emacs lisp, please check if this is to be included >> in org-mode. > > Before reviewing the patch, I'd like to know if the onload and onunload > attributes are common enough to justify the creation of a variable. > Indeed, it's already quite easy to achieve the same using personal > filters. I.e.: > > #+begin_src emacs-lisp > (defun my-html-body-onload-filter (output backend info) > "Add my onload attribute to tag, if any." > (when (and (eq backend 'e-html) > (string-match "\n" output)) > (replace-match "\n" nil nil output))) > > (add-to-list 'org-export-filter-final-output-functions > 'my-html-body-onload-filter) > #+end_src > > If you think it's still worth adding variables in order to make it a tad > bit easier, I'll review the patch. > > Thanks for your work. > The onload/onunload attributes probably aren't that much used. If you're doing a lot of javascript on a web page they are useful. Better not to include this in org-mode. I'll investigate the use of a filter for myself. Thanks and best regards Robert