emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Norman Walsh <ndw@nwalsh.com>
Cc: org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: Inline references in noweb?
Date: Sun, 5 Jan 2020 12:46:06 -0500	[thread overview]
Message-ID: <CAJ51ETrFXws6YM_LLFsvYBjRka1qV8bVG0arL4TPVqmBvTgZEQ@mail.gmail.com> (raw)
In-Reply-To: <m25zhq44mj.fsf@nwalsh.com>

[-- Attachment #1: Type: text/plain, Size: 2092 bytes --]

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]{"<<required_date>>"} {{{results(=Jan 5\, 2020=)}}}.

#+begin_src conf :noweb yes
date: <<required_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 <ndw@nwalsh.com> wrote:

> Hello,
>
> I’ve read through most of the docs that turn up with the obvious web
> searches and I haven’t been able to figure this out. However, it seems
> like it should be possible…
>
> I’m quite pleased with how babel and noweb can be used to write
> “literate programs” for configuration files and scripts.
>
> Cross references between code blocks with <<noweb-references>> work
> just fine. What I’d like, but can’t work out, is how to refer to, for
> example, a configuration value inline. Something like this:
>
>   In order to engage the flux capacitor, you must set the
>   chronometer dial to ~<<required_date>>~.
>
>   #+begin_src conf :noweb yes
>   date: <<required_date>>
>   #+end_src
>
> I don’t care how or where “required_date” is defined, 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 <ndw@nwalsh.com> | 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
>

[-- Attachment #2: Type: text/html, Size: 3055 bytes --]

  reply	other threads:[~2020-01-05 17:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-05  9:47 Inline references in noweb? Norman Walsh
2020-01-05 17:46 ` John Kitchin [this message]
2020-01-05 18:40   ` Norman Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ51ETrFXws6YM_LLFsvYBjRka1qV8bVG0arL4TPVqmBvTgZEQ@mail.gmail.com \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=ndw@nwalsh.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).