emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Patch: HTML body onload/onunload attribute support for new expor


From: Robert Klein
Subject: Re: [O] Patch: HTML body onload/onunload attribute support for new exporter
Date: Thu, 18 Oct 2012 11:42:11 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20120825 Thunderbird/10.0.7

Hallo,

On 10/17/2012 03:50 PM, Nicolas Goaziou wrote:
Hello,

Robert Klein<address@hidden>  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<body>  tag, if any."
   (when (and (eq backend 'e-html)
              (string-match "<body>\n" output))
     (replace-match "<body onLoad=\"anything\">\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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]