From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Inline references in noweb? Date: Sun, 5 Jan 2020 12:46:06 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b6276a059b681e78" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37523) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1io9yn-0007Mq-I9 for emacs-orgmode@gnu.org; Sun, 05 Jan 2020 12:46:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1io9ym-0002DF-1D for emacs-orgmode@gnu.org; Sun, 05 Jan 2020 12:46:21 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:44828) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1io9yl-0002CC-KD for emacs-orgmode@gnu.org; Sun, 05 Jan 2020 12:46:19 -0500 Received: by mail-wr1-x430.google.com with SMTP id q10so8228670wrm.11 for ; Sun, 05 Jan 2020 09:46:19 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Norman Walsh Cc: org-mode-email --000000000000b6276a059b681e78 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I think this is what you need. I am not sure if you can expand noweb outside a src block, so I use an inline src block to get this. #+name: required_date #+BEGIN_SRC text :exports none Jan 5, 2020 #+END_SRC In order to engage the flux capacitor, you must set the chronometer dial to src_emacs-lisp[:noweb yes :exports results]{"<>"} {{{results(=3DJan 5\, 2020=3D)}}}. #+begin_src conf :noweb yes date: <> #+end_src John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Sun, Jan 5, 2020 at 4:47 AM Norman Walsh wrote: > Hello, > > I=E2=80=99ve read through most of the docs that turn up with the obvious = web > searches and I haven=E2=80=99t been able to figure this out. However, it = seems > like it should be possible=E2=80=A6 > > I=E2=80=99m quite pleased with how babel and noweb can be used to write > =E2=80=9Cliterate programs=E2=80=9D for configuration files and scripts. > > Cross references between code blocks with <> work > just fine. What I=E2=80=99d like, but can=E2=80=99t work out, is how to r= efer to, for > example, a configuration value inline. Something like this: > > In order to engage the flux capacitor, you must set the > chronometer dial to ~<>~. > > #+begin_src conf :noweb yes > date: <> > #+end_src > > I don=E2=80=99t care how or where =E2=80=9Crequired_date=E2=80=9D is defi= ned, I just want the > ability to refer to it in the documentation and in code blocks. > > Have I overlooked something obvious? > > Be seeing you, > norm > > -- > Norman Walsh | The stone fell on the pitcher? Woe to > http://nwalsh.com/ | the pitcher. The pitcher fell on the > | stone? Woe to the pitcher.--Rabbinic > | Saying > --000000000000b6276a059b681e78 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think this is what you need. I am not sure if you can ex= pand noweb outside a src block, so I use an inline src block to get this.

#+name: required_date
#+BEGIN_SRC text :exports no= ne
Jan 5, 2020
#+END_SRC

In order to engage the flux capacitor= , you must set the
=C2=A0 chronometer dial to src_emacs-lisp[:noweb yes = :exports results]{"<<required_date>>"} {{{results(=3D= Jan 5\, 2020=3D)}}}.

#+begin_src conf :noweb yes
date: <<re= quired_date>>
#+end_src


John

= -----------------------------------
Professor John Kitchin=C2=A0
Dohe= rty Hall A207F
Department of Chemical Engineering
Carnegie Mellon Uni= versity
Pittsburgh, PA 15213
412-268-7803
=

On Sun, Jan 5, 2020 at 4:47 AM Norman Walsh <ndw@nwalsh.com> wrote:
Hello,

I=E2=80=99ve read through most of the docs that turn up with the obvious we= b
searches and I haven=E2=80=99t been able to figure this out. However, it se= ems
like it should be possible=E2=80=A6

I=E2=80=99m quite pleased with how babel and noweb can be used to write
=E2=80=9Cliterate programs=E2=80=9D for configuration files and scripts.
Cross references between code blocks with <<noweb-references>> = work
just fine. What I=E2=80=99d like, but can=E2=80=99t work out, is how to ref= er to, for
example, a configuration value inline. Something like this:

=C2=A0 In order to engage the flux capacitor, you must set the
=C2=A0 chronometer dial to ~<<required_date>>~.

=C2=A0 #+begin_src conf :noweb yes
=C2=A0 date: <<required_date>>
=C2=A0 #+end_src

I don=E2=80=99t care how or where =E2=80=9Crequired_date=E2=80=9D is define= d, I just want the
ability to refer to it in the documentation and in code blocks.

Have I overlooked something obvious?

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Be seein= g you,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 n= orm

--
Norman Walsh <ndw@nw= alsh.com> | The stone fell on the pitcher? Woe to
http://= nwalsh.com/=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | the pitcher. The= pitcher fell on the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | stone? Woe to the pitcher.--Rabbinic
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | Saying
--000000000000b6276a059b681e78--