emacs-orgmode
[Top][All Lists]
Advanced

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

[O] [ox-publish] handling of white space in arguments of macros, named a


From: Stefan Vollmar
Subject: [O] [ox-publish] handling of white space in arguments of macros, named arguments?
Date: Tue, 26 Mar 2013 21:08:56 +0100

Hallo,

I have just upgraded to release_8.0-pre-193-gaa7b1 and found that I needed to 
change a few things to get the desired results when exporting some of our org 
files to HTML. Our last changes were also targeted at the new exporter and 
everything worked fine about a month ago.

I found that I had to change HTML_STYLE to HTML_HEAD - not a problem. However, 
the second change is caused by our use of MACROs: we find them very helpful for 
generating HTML content using raw HTML templates with placeholders.

This used to work (for generating http://microformats.org/wiki/hcard 
information) a month ago:

{{{mhead-hcard(
Dr. Stefan Vollmar,
Stefan,
,
Vollmar,
Dr.,
stefan-vollmar.jpg,
stefan-vollmar.html,
...)}}}

with this type of macro definition:

#+macro: mhead-hcard #+html: <div id="contact" class="vcard"><p><table 
style="margin-left:0;margin-right:auto"><tr style="text-align: 
left;margin-left: 2em"><td style="padding: 5px"><img width="200px" 
class="photo" src="images/$6" alt="$1" /></td><td><a style="color:blue;" 
class="url" href="http://www.nf.mpg.de/cv/$7";><div class="fn n"><span 
class="honorific-prefix">$5</span> <span class="given-name">$2</span>[...]

but now the white space around the arguments is no longer stripped and/or other 
effects cause "<" and ">" in the macro to be exported as "&lt;" etc.

This version seems to work fine:

{{{mhead-hcard(Dr. Stefan 
Vollmar,Stefan,,Vollmar,Dr.,stefan-vollmar.jpg,stefan-vollmar.html,Head of IT 
Group\,<br/>Physicist\, Software Developer,address@hidden,it,+49 221 
4726-213,+49 221 4726-298)}}}

Yes, I could use it as a workaround, but I would prefer something similar to 
the above version for improved readability - maybe by adding "line continuation 
markers" like "\"? Obviously, more complex macros (the one above has 12 
individual arguments) are less than ideal anyway and the best solution (by far) 
would be "named arguments". Maybe there already is a better way of using (HTML) 
templates?

Many thanks in advance.
Warm regards,
 Stefan
-- 
Dr. Stefan Vollmar, Dipl.-Phys.
Head of IT group
Max-Planck-Institut für neurologische Forschung
Gleueler Str. 50, 50931 Köln, Germany
Tel.: +49-221-4726-213  FAX +49-221-4726-298
Tel.: +49-221-478-5713  Mobile: 0160-93874279
E-Mail: address@hidden   http://www.nf.mpg.de








Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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