emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Inject value of macro into code using a variable
@ 2019-10-15 16:37 wlharvey4 via Emacs-orgmode
  2019-10-15 19:42 ` Nicolas Goaziou
  2019-10-16  6:23 ` Fraga, Eric
  0 siblings, 2 replies; 3+ messages in thread
From: wlharvey4 via Emacs-orgmode @ 2019-10-15 16:37 UTC (permalink / raw)
  To: emacs-orgmode

Is it possible to inject the value of a macro into code using a variable?

I set a macro called ‘version’ with a version number at the top of my .org file.  I would like to do something like this:

#+macro:version Version 0.2.5

#+name:code-name
#+begin_src js :tangle some-file.js :var ver={{{version}}} :exports both :results output
const version = ver;
#+end_src

When this code is evaluated during export, there is an error:

org-babel-ref-resolve: Reference ‘{{{version}}}’ not found in this buffer

Regards,
Wesley

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-16  6:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15 16:37 Inject value of macro into code using a variable wlharvey4 via Emacs-orgmode
2019-10-15 19:42 ` Nicolas Goaziou
2019-10-16  6:23 ` Fraga, Eric

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).