From: Tom Gillespie <tgbugs@gmail.com>
To: gmauer@gmail.com
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Can you automatically noweb include?
Date: Fri, 7 Aug 2020 21:18:30 -0700 [thread overview]
Message-ID: <CA+G3_PNLS1tWorFihEr9=b52dHZk1rDUH_91L7x-VfAXEpkvzg@mail.gmail.com> (raw)
In-Reply-To: <CA+pajWKpjD86f+4qrkAcsfnYR92RC1FEi48ioG2gmPqZL9zQDw@mail.gmail.com>
I don't see a direct answer to the original question in the thread, so
here is an example of how I do it taken from
https://raw.githubusercontent.com/SciCrunch/sparc-curation/master/docs/developer-guide.org.
You can ctrl-f for racket-graph-helper to see the relevant blocks. A
reduced version is below. Recall that I use
https://github.com/wallyqs/ob-racket. I use this pattern all over the
place in my org blocks. Best,
Tom
* Use the code
:cache yes"
#+begin_src racket :lang racket/base :noweb yes
<<racket-helper>>
(helper-function "this should work")
#+end_src
#+RESULTS:
: this should work hello world
* Define the helpers
#+name: racket-helper
#+header: :prologue "#lang racket/base"
#+begin_src racket :lang racket/base
(define (helper-function arg)
(string-append arg " hello world"))
#+end_src
next prev parent reply other threads:[~2020-08-08 4:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-05 21:21 Can you automatically noweb include? George Mauer
2020-08-05 22:03 ` Ken Mankoff
2020-08-06 18:12 ` Ken Mankoff
2020-08-07 15:39 ` William McCoy
2020-08-07 16:51 ` Berry, Charles via General discussions about Org-mode.
2020-08-07 18:24 ` William McCoy
2020-08-07 21:18 ` Thomas S. Dye
2020-08-07 21:25 ` Berry, Charles via General discussions about Org-mode.
2020-08-07 22:01 ` William McCoy
2020-08-08 4:15 ` George Mauer
2020-08-08 4:18 ` Tom Gillespie [this message]
2020-08-08 4:20 ` Tom Gillespie
2020-08-08 4:47 ` Tom Gillespie
2020-08-08 19:42 ` George Mauer
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='CA+G3_PNLS1tWorFihEr9=b52dHZk1rDUH_91L7x-VfAXEpkvzg@mail.gmail.com' \
--to=tgbugs@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=gmauer@gmail.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).