emacs-orgmode
[Top][All Lists]
Advanced

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

Re: substitutions in html export?


From: kevinbanjo
Subject: Re: substitutions in html export?
Date: Sun, 17 Jul 2022 12:19:26 -0700



On Sun, Jul 17, 2022 at 11:54 AM Berry, Charles <ccberry@health.ucsd.edu> wrote:
Kevin,

> On Jul 17, 2022, at 10:18 AM, kevinbanjo <kevinbanjo@gmail.com> wrote:
>
>
>
> On Sun, Jul 17, 2022 at 7:24 AM Ihor Radchenko <yantar92@gmail.com> wrote:
> See inline calls in https://orgmode.org/manual/Evaluating-Code-Blocks.html#Evaluating-Code-Blocks
>
> I did this and it didn't work (but the one outside the export block did):
>
> #+title:test
>
> #+name: numbers
> #+begin_src emacs-lisp :exports none
> 40
> #+end_src
>
> #+begin_export html
>
> the result is call_numbers()
>
> #+end_export


The export block provides text that is to be used "as is" by the html backend. So, "call_numbers()" is treated as html.

You need to construct the export block programmatically. Maybe something like

#+begin_src emacs-lisp :results html :exports results :var num=numbers()
   (format "the result is %d" num )
#+end_src


HTH,

Chuck



Thanks for that Chuck.   It would seem a lot cleaner if there was a hook or something one could run that would just expand macros in export blocks before exporting them.  

-Kevin
 

reply via email to

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