all messages for Emacs-related lists mirrored at yhetil.org
 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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.