Hi Stefan,

Stefan Vollmar <voll...@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


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to