From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shelagh Manton Subject: Re: macros: escaping "," and comments Date: Sat, 14 Aug 2010 08:22:10 +0000 (UTC) Message-ID: References: <1197F101-8BBB-4FF8-8289-47CB2306842A@nf.mpg.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from [140.186.70.92] (port=36750 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OkC0T-0007YG-LW for emacs-orgmode@gnu.org; Sat, 14 Aug 2010 04:22:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OkC0S-0007IC-Bo for emacs-orgmode@gnu.org; Sat, 14 Aug 2010 04:22:21 -0400 Received: from lo.gmane.org ([80.91.229.12]:60311) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OkC0S-0007I3-1L for emacs-orgmode@gnu.org; Sat, 14 Aug 2010 04:22:20 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OkC0Q-000053-Gv for emacs-orgmode@gnu.org; Sat, 14 Aug 2010 10:22:18 +0200 Received: from 203.219.222.168 ([203.219.222.168]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 14 Aug 2010 10:22:18 +0200 Received: from shelagh.manton by 203.219.222.168 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 14 Aug 2010 10:22:18 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On Fri, 13 Aug 2010 00:02:09 +0200, Stefan Vollmar wrote: > Hello, > > we are currently changing our institute's web site so that staff members > can have a personal page: they can submit Org-mode files which are then > automatically converted to (rather nice) HTML pages. One advantage is > that this allows us to give staff members a lot of freedom to create > content while keeping a "corporate identity" look (and getting the > director's permission in the first place). > > Our template needs a macro in the org template to create a more "fancy" > summary of personal information with a table, a portrait and some icons > (aside: please note that you can create really complex HTML code this > way if necessary). > > Here is a very simple example: > > #+title: test > #+macro: mhead #+html:
email: $1 phone: > $2
> > {{{mhead( > somebody@somewhere.org, > 1-234-2134 > )}}} > > Imagine more lines (job description, fax, homepage, etc) and a more > complex table (hidden in a setup file). Having users provide information > in this way is not ideal, but has worked surprisingly well (the rest of > the template is "proper" Org-mode content). > > When creating the Org templates we ran into these problems with Org-mode > 7.01 and Emacs 23.2.1: > > (1) How can we escape "," in the macro call? Ideally, we would need > something like this: > > {{{mhead( > one entry\, still the same entry, > the second variable... > > (2) It would be nice to use something like this: > > {{{mhead( > # Email > somebody@somewhere.org, > # Phone > 1-234-2134 > )}}} > What would be really nifty would be to turn this kind of thing into microformats. http://microformats.org/ How hard would that be? > However, the "#" lines are currently not ignored (as comments) when > expanding the macro, these kind of comment lines would be helpful when > providing templates in general. > > (3) if, in the above example, we delete the #+title line before the > macro definition, that macro stops working (the macro definition is not > interpreted as such). It seems there must be at least one line with > arbitraty contents before the macro definition (bug?). > > I think, that (1) (maybe it is already possible - apologies if I > overlooked something) and (2) would be useful features in Org-mode. > > Many thanks in advance for any help with this. > > Warm regards, > Stefan Cheers Shelagh