[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Feature request for noweb mode that strips references on export
From: |
Daimrod |
Subject: |
Re: [O] Feature request for noweb mode that strips references on export |
Date: |
Fri, 30 Mar 2012 18:39:51 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) |
"Sean O'Halpin" <address@hidden> 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