From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Macros and HTML new exporter Date: Sun, 13 Jan 2013 14:15:29 +0100 Message-ID: <877gnh6x72.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuNTO-0006JZ-CX for emacs-orgmode@gnu.org; Sun, 13 Jan 2013 08:19:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuNTH-0006Dq-Ui for emacs-orgmode@gnu.org; Sun, 13 Jan 2013 08:19:38 -0500 Received: from mail-wg0-f49.google.com ([74.125.82.49]:50751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuNTH-0006Dk-O7 for emacs-orgmode@gnu.org; Sun, 13 Jan 2013 08:19:31 -0500 Received: by mail-wg0-f49.google.com with SMTP id 15so1631972wgd.16 for ; Sun, 13 Jan 2013 05:19:30 -0800 (PST) In-Reply-To: (Fabrice Popineau's message of "Sun, 13 Jan 2013 13:37:20 +0100") 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: Fabrice Popineau Cc: "emacs-orgmode@gnu.org" Hello, Fabrice Popineau writes: > I need some clarficiation here. > > I tried the following : > > ... > #+MACRO: internal #+BEGIN_HTML\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. That's because macros are single line objects. Your first example, when expanded, will generate: #+BEGIN_HTML\n\n#+END_HTML with literal "\n". > 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 ?) Macros are a simple answer to simple problems. If you want to construct something more elaborate, I highly suggest to use Babel. Regards, -- Nicolas Goaziou