From: tftorrey@tftorrey.com (T.F. Torrey)
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Macro expansion in new exporter
Date: Tue, 12 Feb 2013 03:00:54 -0700 [thread overview]
Message-ID: <8738x1x355.fsf@lapcat.tftorrey.com> (raw)
In-Reply-To: <87wquhewvz.fsf@gmail.com> (message from Nicolas Goaziou on Sat, 09 Feb 2013 09:04:16 +0100)
Hello again,
Like many others, I'm adapting my workflow to the new exporter. Like
Carsten (but apparently few others), I've been using macros extensively.
Though I've spent several days digging through the mailing list and
code, I still don't have the answers I need, but hopefully I can ask
intelligent questions.
Nicolas Goaziou <n.goaziou@gmail.com> writes:
> On that topic, the main difference with the previous exporter is that
> macros are now required to be in a context that can be parsed. Thus, for
> example, the following is not a macro:
>
> ~{{{title}}}~
What is meant by "a context that can be parsed"?
In my work, it has been very useful to use macros for snippets of
text. Then, instead of changing the text everywhere when I want a
change, I would just change the macro. So...
For instance, I used to be able to do this:
#+MACRO: status Draft
#+HTML: <p class="status">{{{status}}}</p>
And on export to HTML, I would get what you would expect:
<p class="status">Draft</p>
With the new exporter, the macro is left unexpanded in the output:
<p class="status">{{{status}}}</p>
Of course, I could also put the {{{status}}} in any ordinary text and
have it there as well.
In extensive experiments, I have not found any combination of input that
would produce the old output using macros.
The old behavior had an elegant, one-line solution. Perhaps the
functionality could be duplicated with babel, but surely not as simply
and directly as with the old macro system.
Is there a way to replicate the old behavior in the new export engine?
Also, in your response to Carsten's question about macros, you suggested
this:
#+MACRO: thumbright @@html:<img src="./Content/$2/thumb.jpg" style="float:right;width:$1;margin:0px 20px 0px 20px;" alt="./Content/$2/thumb.jpg" />@@
The "@@" syntax looks new to me. Can you tell me what the function of
the "@@" is? Is this documented somewhere?
Best regards,
Terry
--
T.F. Torrey
next prev parent reply other threads:[~2013-02-12 10:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-08 23:08 Macro expansion in new exporter T.F. Torrey
2013-02-09 8:04 ` Nicolas Goaziou
2013-02-12 10:00 ` T.F. Torrey [this message]
2013-02-12 17:56 ` Nicolas Goaziou
2013-02-12 20:30 ` T.F. Torrey
2013-02-13 16:36 ` Nicolas Goaziou
2013-02-15 10:21 ` T.F. Torrey
2013-02-15 13:05 ` Nicolas Goaziou
2013-02-15 20:42 ` T.F. Torrey
2013-02-15 21:17 ` Nicolas Goaziou
2013-02-15 22:37 ` T.F. Torrey
2013-02-15 21:26 ` Nick Dokos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8738x1x355.fsf@lapcat.tftorrey.com \
--to=tftorrey@tftorrey.com \
--cc=emacs-orgmode@gnu.org \
--cc=n.goaziou@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).