emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Robert Klein <kleinrob@mpip-mainz.mpg.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: Patch: HTML body onload/onunload attribute support for new exporter
Date: Wed, 17 Oct 2012 15:50:19 +0200	[thread overview]
Message-ID: <87vce9mcmc.fsf@gmail.com> (raw)
In-Reply-To: <507EB0A8.4020903@mpip-mainz.mpg.de> (Robert Klein's message of "Wed, 17 Oct 2012 15:20:40 +0200")

Hello,

Robert Klein <kleinrob@mpip-mainz.mpg.de> 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.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2012-10-17 13:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 13:20 Patch: HTML body onload/onunload attribute support for new exporter Robert Klein
2012-10-17 13:50 ` Nicolas Goaziou [this message]
2012-10-18  9:42   ` Robert Klein

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=87vce9mcmc.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kleinrob@mpip-mainz.mpg.de \
    /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).