From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: Re: Macro question Date: Fri, 23 Oct 2015 23:33:35 +0200 Message-ID: References: <87fv11z5h3.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c25358571b3b0522cc5ede Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpjyG-0006WG-Tn for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 17:33:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpjyF-0001aX-Ly for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 17:33:56 -0400 Received: from mail-ob0-x22c.google.com ([2607:f8b0:4003:c01::22c]:32848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpjyF-0001a4-F2 for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 17:33:55 -0400 Received: by obbwb3 with SMTP id wb3so104316024obb.0 for ; Fri, 23 Oct 2015 14:33:55 -0700 (PDT) In-Reply-To: <87fv11z5h3.fsf@nicolasgoaziou.fr> 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 , "emacs-orgmode@gnu.org" --001a11c25358571b3b0522cc5ede Content-Type: text/plain; charset=UTF-8 Hello Nicolas, 2015-10-23 22:37 GMT+02:00 Nicolas Goaziou : > Hello, > > Fabrice Popineau writes: > > > I was wondering if macros could be used to output raw html code, but that > > doesn't seem to be the case. > > > > Namely: > > > > #+macro: bfoo @@html:
@@ > > #+macro: efoo @@html:
@@ > > > > The macros {{{bfoo}}} and {{{efoo}}} are expanded surrounded by

... > >

. > > Macros can output raw inline HTML code. If you want to generate any HTML > code, you can use some babel block to do that. > > I agree that raw html can be output by macros, but it can easily break too. At the moment : --------------------------------------------------------------------------------------------- #+macro: bfoo @@html:
@@ #+macro: efoo @@html:
@@ * Section {{{bfoo}}} Some text. {{{efoo}}} --------------------------------------------------------------------------------------------- is exported as : ---------------------------------------------------------------------------------------------

Section

Some text.

--------------------------------------------------------------------------------------------- But : --------------------------------------------------------------------------------------------- #+macro: bfoo @@html:
@@ #+macro: efoo @@html:
@@ * Section {{{bfoo}}} Some text. {{{efoo}}} --------------------------------------------------------------------------------------------- is exported as : ---------------------------------------------------------------------------------------------

Section

Some text.

--------------------------------------------------------------------------------------------- In the first case, the

...

are quite annoying. In the second case, the

...

is spurious, but at least it doesn't break the structure. I wonder if there is a way to guess where ox-html could avoid to emit paragraphs. Regards, Fabrice --001a11c25358571b3b0522cc5ede Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello Nicolas,

2015-10-23 22:37 GMT+02:00 Nicolas Goaziou <mail@ni= colasgoaziou.fr>:
Hello,

Fabrice Popineau <fabrice.= popineau@gmail.com> writes:

> I was wondering if macros could be used to output raw html code, but t= hat
> doesn't seem to be the case.
>
> Namely:
>
> #+macro: bfoo @@html:<div class"foo">@@
> #+macro: efoo @@html:</div>@@
>
> The macros {{{bfoo}}} and {{{efoo}}} are expanded surrounded by <p&= gt; ...
> </p>.

Macros can output raw inline HTML code. If you want to generate any = HTML
code, you can use some babel block to do that.


I agree that raw html can be output by= macros, but it can easily break too.
=C2=A0
At the mom= ent :=C2=A0

--------------------------------------= -------------------------------------------------------
#+ma= cro: bfoo @@html:<div class"foo">@@
#+macro: efoo= @@html:</div>@@

* Section

{{{bfoo}}}

Some text.

=
{{{efoo}}}
-------------------------------------------= --------------------------------------------------

=
is exported as :

----------------------------= -----------------------------------------------------------------
=
<div id=3D"outline-container-orgheadline1" class=3D&= quot;outline-2">
<h2 id=3D"orgheadline1">= Section</h2>
<div class=3D"outline-text-2" id= =3D"text-orgheadline1">
<p>

</p>

<p>
<div clas= s"foo">
</p>

<p>= ;
Some text.
</p>

<p&= gt;
</div>
</p>
</div>
</div>
----------------------------------------= -----------------------------------------------------

But :

-------------------------------= --------------------------------------------------------------
#+macro: bfoo @@html:<div class"foo">@@
#+macr= o: efoo @@html:</div>@@

* Section
=
{{{bfoo}}}
Some text.
{{{efoo}}}
=
----------------------------------------------------------= -----------------------------------

is e= xported as :

--------------------------------= -------------------------------------------------------------
<div id=3D"outline-container-orgheadline1" class=3D"outl= ine-2">
<h2 id=3D"orgheadline1">Section&l= t;/h2>
<div class=3D"outline-text-2" id=3D"t= ext-orgheadline1">
<p>

<= ;/p>

<p>
<div class"foo= ">
Some text.
</div>
</p>=
</div>
</div>
-------= ---------------------------------------------------------------------------= -----------

In the first case, th= e <p> ... </p> are quite annoying.
In the second case= , =C2=A0the <p> ... </p> is spurious, but at least it doesn'= ;t break the structure.

I wonder if there is a way= to guess where ox-html could avoid to emit paragraphs.

Regards,

Fabrice

<= /div>
--001a11c25358571b3b0522cc5ede--