emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daimrod <daimrod@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Feature request for noweb mode that strips references on export
Date: Fri, 30 Mar 2012 18:39:51 +0200	[thread overview]
Message-ID: <871uoagi08.fsf@gmail.com> (raw)
In-Reply-To: CAOXM+eXFcWW0cdDozssAs6XiFR-=TcwGvngDyLQihxWOc0p9iQ@mail.gmail.com

"Sean O'Halpin" <sean.ohalpin@gmail.com> writes:

> Hi,
>
> I've tried to use the new :noweb strip-export feature but I can't work
> out the magic combination of headers (working with git head, i.e.
> commit 67694297fa0f9b32cf4bfe812ba8a5c5cf4a0859).
>
> Here is a stripped down example:
>
> START OF EXAMPLE
>
> * Example
>
> Define method
>
> #+name: boilerplate
> #+begin_src ruby
> def hello
>   "Hello World"
> end
> #+end_src
>
> Use it
>
> #+name: example
> #+begin_src ruby :exports both :noweb strip-export
> «boilerplate»
>
> hello
> #+end_src
>
> And here is the result:
>
> #+RESULTS: example
> : Hello World
>
> END OF EXAMPLE
>
> On export, I expect this to display the result string "Hello World"
> after the code "hello" but get nothing. If I change the :noweb
> strip-export to :noweb yes, I do get the output (but also the
> boilerplate of course).
>
> Is strip-export meant to work like this? If so, could someone please
> post a working example?
>
> Thanks,
> Sean

If you don't want to export boilerplate you've to use :exports none in
it.

#+name: boilerplate
#+begin_src ruby :exports none
def hello
  "Hello World"
end
#+end_src

Use it

#+name: example
#+begin_src ruby :exports both :noweb strip-export
<<boilerplate>>

hello
#+end_src

  parent reply	other threads:[~2012-03-30 16:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31  4:11 Feature request for noweb mode that strips references on export Avdi Grimm
2012-01-31  7:56 ` Sebastien Vauban
2012-01-31 17:38   ` Avdi Grimm
2012-01-31 18:48     ` Avdi Grimm
2012-02-01 14:18       ` Eric Schulte
2012-02-01 15:21 ` Eric Schulte
2012-03-15 18:24   ` Avdi Grimm
2012-03-30 16:22     ` Sean O'Halpin
2012-03-30 16:37       ` Nick Dokos
2012-03-31  8:28         ` Sean O'Halpin
2012-03-30 16:39       ` Daimrod [this message]
2012-03-31  8:33         ` Sean O'Halpin
2012-03-31  9:04           ` Daimrod
2012-03-31 16:03           ` Nick Dokos
2012-03-31 15:32             ` Eric Schulte
2012-04-01 21:28               ` Sean O'Halpin

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=871uoagi08.fsf@gmail.com \
    --to=daimrod@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).