Re: Inline references in noweb?

2020-01-05 Thread Norman Walsh
John Kitchin  writes:
> In order to engage the flux capacitor, you must set the
>   chronometer dial to src_emacs-lisp[:noweb yes :exports 
> results]{"<>"}
> {{{results(=Jan 5\, 2020=)}}}.

Ah, thank you. That was one level of indirection further than I got!

Be seeing you,
  norm

-- 
Norman Walsh  | 'I have done that,' says my memory. 'I
http://nwalsh.com/| cannot have done that'—says my pride,
  | and remains adamant. At last—memory
  | yields.--Nietzsche


signature.asc
Description: PGP signature


Re: Inline references in noweb?

2020-01-05 Thread John Kitchin
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(=Jan 5\, 2020=)}}}.

#+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’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 <> 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 ~<>~.
>
>   #+begin_src conf :noweb yes
>   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  | 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
>


Inline references in noweb?

2020-01-05 Thread Norman Walsh
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 <> 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 ~<>~.

  #+begin_src conf :noweb yes
  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  | 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


signature.asc
Description: PGP signature