emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matthew Lundin <mdl@imapmail.org>
To: Stefan Vollmar <vollmar@nf.mpg.de>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: my-mini-table(something)
Date: Thu, 18 Jun 2009 07:25:02 -0500	[thread overview]
Message-ID: <m2d491sp9d.fsf@fastmail.fm> (raw)
In-Reply-To: <28CF207F-50F8-4F14-8787-F99E5BC2369C@nf.mpg.de> (Stefan Vollmar's message of "Thu\, 18 Jun 2009 11\:56\:57 +0200")

Hi Stefan,

Stefan Vollmar <vollmar@nf.mpg.de> writes:

> we have used org-mode for creating HTML content for software
> documentation and it beats everything we have tried over the last
> couple of years hands down, excellent work!
>
> For one project, I used several statements like this (simplified):
>
> #+HTML: <table><tr><td><img src="./images/icon.png"/></
> td><td<code>something</code></td></tr></table>
>
> #+HTML: <table><tr><td><img src="./images/icon.png"/></
> td><td<code>other</code></td></tr></table>
>
> The result looks exactly the way we have planned it, however, ideally
> one would want to write:
>
> \my-mini-table(something)
> \my-mini-table(other)
>
> (with a suitable syntax) in the org source, and this should only be
> expanded when exporting the document, so I never need to look at the
> HTML code (if I do not want to).

Perhaps the easiest way to do this would be to define a macro at the top
of your org file:

--8<---------------cut here---------------start------------->8---
#+MACRO: special-table #+HTML: <table><tr><td><img src="./images/icon.png"/></td><td<code>something</code></td></tr></table>
--8<---------------cut here---------------end--------------->8---

Then, any time you wanted the html snippet to appear in the export, you
could place the following in your org file:

{{{special-table}}}

During export this will be replaced by the definition above. (At first I
wasn't sure this would work because of the extra comment notation in the
macro definition, but I tested it and it seemed to work fine.)

For more information on macros, see

http://orgmode.org/org.html#Macro-replacement

Regards,
Matt

  reply	other threads:[~2009-06-18 12:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-18  9:56 my-mini-table(something) Stefan Vollmar
2009-06-18 12:25 ` Matthew Lundin [this message]
2009-06-19  0:19   ` my-mini-table(something) Bastien
2009-06-19  6:06     ` Carsten Dominik
2009-06-19  9:44       ` Bastien
  -- strict thread matches above, loose matches on Subject: below --
2009-06-18 10:14 my-mini-table(something) Giovanni Ridolfi
2009-06-18 11:40 ` my-mini-table(something) Stefan Vollmar
2009-06-18 14:00   ` my-mini-table(something) Sebastian Rose
2009-06-18 13:11 my-mini-table(something) giovanni.ridolfi
2009-06-19  5:42 ` my-mini-table(something) Carsten Dominik

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=m2d491sp9d.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=vollmar@nf.mpg.de \
    /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).