From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: Macros and HTML new exporter Date: Sun, 13 Jan 2013 13:37:20 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b6222d054282804d32acb63 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuMow-0008F9-LH for emacs-orgmode@gnu.org; Sun, 13 Jan 2013 07:37:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuMoq-0004MX-7g for emacs-orgmode@gnu.org; Sun, 13 Jan 2013 07:37:50 -0500 Received: from mail-ea0-f169.google.com ([209.85.215.169]:43139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuMop-0004MN-VJ for emacs-orgmode@gnu.org; Sun, 13 Jan 2013 07:37:44 -0500 Received: by mail-ea0-f169.google.com with SMTP id d13so122249eaa.14 for ; Sun, 13 Jan 2013 04:37:40 -0800 (PST) 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: "emacs-orgmode@gnu.org" --047d7b6222d054282804d32acb63 Content-Type: text/plain; charset=ISO-8859-1 Hi all, I need some clarficiation here. I tried the following : ... #+MACRO: internal #+BEGIN_HTML\n
\n $2 \n
\n#+END_HTML ... * Some title [2013-01-13 dim. 09:31] {{{internal(2, 'foo')}}} ... The I call org-e-publish and the html file produced has the macro inlined in the html output :

#+BEGIN_HTML\n<div class="move">\n<a href="#" onclick="toggleContainer('Home', '2');"> 'foo' </a>\n</div>\n#+END_HTML

However with this : #+MACRO: internal @@e-html:@@ the result obtained is as expected. Why is it this way ? I would have expected the first version to also work. Incidentally, there is a potential difficulty with macro arguments and quoting. Arguments to macros are not quoted and seems to be split wlong with commas. Maybe a quoting mechanism would be needed (how to pass an argument with a comma ?) Thanks in advance, Fabrice --047d7b6222d054282804d32acb63 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi all,

I need some clarficiation here.=

I tried the following :

= ...
#+MACRO: internal #+BEGIN_HTML\n<div class=3D"mo= ve">\n<a href=3D"#" onclick=3D"toggleContainer(&#= 39;Home', '$1');"> $2 </a>\n</div>\n#+END_H= TML
...
* Some title
[2013-01-13 dim. 09:31]

{{{internal(2, 'foo')}}}
...

The I call org-e-publish and the html file pr= oduced has the macro inlined in the html output :

<p>
#+BEGIN_HTML\n&= ;lt;div class=3D"move"&gt;\n&lt;a href=3D"#" on= click=3D"toggleContainer('Home', '2');"&gt; &= #39;foo' &lt;/a&gt;\n&lt;/div&gt;\n#+END_HTML
</p>


However with = this :

#+MACRO: internal @@e-html= :<div class=3D"move"><a href=3D"#" =A0onclick= =3D"toggleContainer('Home', $1);"> $2 </a></d= iv>@@

the result obtained is as expected.
Why is it this way ? I would have expected the first version to also wor= k.

Incidentally, there is a potential = difficulty with macro arguments and quoting.=A0
Arguments to macros are not quoted and seems to be split wlong w= ith commas.
Maybe a quoting mechanism would be needed (how = to pass an argument with a comma ?)

Thanks in advance,

Fabrice
--047d7b6222d054282804d32acb63--