Re: [O] Feature request for noweb mode that strips references on export

2012-04-01 Thread Sean O'Halpin
On Sat, Mar 31, 2012 at 4:32 PM, Eric Schulte eric.schu...@gmx.com wrote:

 Thanks for bringing this problem to light.  I've just pushed up a fix.

 Cheers,

 --
 Eric Schulte
 http://cs.unm.edu/~eschulte/

Thanks! This is really useful.

Regards,
Sean



Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Sean O'Halpin
On Fri, Mar 30, 2012 at 5:37 PM, Nick Dokos nicholas.do...@hp.com wrote:
 This may have nothing to do with anything (it may even be an artifact of
 mailer misbehavior) but is this supposed to be boilerplate? These
 are supposed to be ASCII chars, so if you are using some sort of extended
 charset, try changing them and see if that works.

 Nick

I've customized =org-babel-noweb-wrap-start= and
=org-babel-noweb-wrap-end= to use guillemets rather than angle
brackets. The noweb stuff is working. It's the lack of the results output
when using strip-export that is bugging me.



Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Sean O'Halpin
On Fri, Mar 30, 2012 at 5:39 PM, Daimrod daim...@gmail.com wrote:
 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

Thanks but that's not my problem. When I use :exports both I get the
code but not the results output in my exported HTML.
Do you get the Hello World output? If so, it looks like I'll have to
debug my configuration.



Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Daimrod
Sean O'Halpin sean.ohal...@gmail.com writes:

 On Fri, Mar 30, 2012 at 5:39 PM, Daimrod daim...@gmail.com wrote:
 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

 Thanks but that's not my problem. When I use :exports both I get the
 code but not the results output in my exported HTML.
 Do you get the Hello World output? If so, it looks like I'll have to
 debug my configuration.

No, you're right, I have to execute evaluate the code manually to
produce

#+RESULTS: example
: Hello World

and then it's exported but only if the code isn't evaluated during the
export. It looks like there is a bug with in the ruby part because the
following code works as expected.

--
* Title
#+name: boilerplate
#+begin_src emacs-lisp :exports none
  (defun hello ()
Hello World)
#+end_src

Use it

#+name: example
#+begin_src emacs-lisp :exports both :noweb strip-export
  boilerplate
  
  (hello)
#+end_src
--

It exports to

--
1 Title

Use it

(hello)

Hello World
--




Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Nick Dokos
Sean O'Halpin sean.ohal...@gmail.com wrote:

 On Fri, Mar 30, 2012 at 5:39 PM, Daimrod daim...@gmail.com wrote:
  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
 
 Thanks but that's not my problem. When I use :exports both I get the
 code but not the results output in my exported HTML.
 Do you get the Hello World output? If so, it looks like I'll have to
 debug my configuration.
 

Now that I've tried it, I can reproduce it: the final results disappear
on export.

Nick




Re: [O] Feature request for noweb mode that strips references on export

2012-03-31 Thread Eric Schulte
Nick Dokos nicholas.do...@hp.com writes:

 Sean O'Halpin sean.ohal...@gmail.com wrote:

 On Fri, Mar 30, 2012 at 5:39 PM, Daimrod daim...@gmail.com wrote:
  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
 
 Thanks but that's not my problem. When I use :exports both I get the
 code but not the results output in my exported HTML.
 Do you get the Hello World output? If so, it looks like I'll have to
 debug my configuration.
 

 Now that I've tried it, I can reproduce it: the final results disappear
 on export.

 Nick



Thanks for bringing this problem to light.  I've just pushed up a fix.

Cheers,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



Re: [O] Feature request for noweb mode that strips references on export

2012-03-30 Thread Sean O'Halpin
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



Re: [O] Feature request for noweb mode that strips references on export

2012-03-30 Thread Nick Dokos
Sean O'Halpin sean.ohal...@gmail.com wrote:

 
 #+name: example
 #+begin_src ruby :exports both :noweb strip-export
 =ABboilerplate=BB
 
 hello
 #+end_src
 

This may have nothing to do with anything (it may even be an artifact of
mailer misbehavior) but is this supposed to be boilerplate? These
are supposed to be ASCII chars, so if you are using some sort of extended
charset, try changing them and see if that works.

Nick




Re: [O] Feature request for noweb mode that strips references on export

2012-03-30 Thread Daimrod
Sean O'Halpin sean.ohal...@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




Re: [O] Feature request for noweb mode that strips references on export

2012-03-15 Thread Avdi Grimm
On Wed, Feb 1, 2012 at 10:21 AM, Eric Schulte eric.schu...@gmx.com wrote:
 I've just added tested and documented such a strip-export argument to
 :noweb.  Please let me know if it doesn't work as you expected.

I just wanted to let you know I finally tried this out and it works
beautifully. Thank you!

-- 
Avdi Grimm
http://avdi.org



Re: [O] Feature request for noweb mode that strips references on export

2012-02-01 Thread Eric Schulte
Avdi Grimm gro...@inbox.avdi.org writes:

 P.S. It's been a while since I've been on this ML, so if there's a
 right way to do a feature request please let me know and I'll do it
 :-)


You initial post in this thread was perfect, succinct and complete.

Cheers,


 On Tue, Jan 31, 2012 at 12:38 PM, Avdi Grimm gro...@inbox.avdi.org wrote:
 On Tue, Jan 31, 2012 at 2:56 AM, Sebastien Vauban
 wxhgmqzgw...@spammotel.com wrote:
 Just for the sake of completeness, there is already a fourth option:

 Ah! Looks like I had an older version. Thanks for prompting me to update!

 I guess what I'm looking for would be called :noweb export-strip or
 something like that.

 --
 Avdi Grimm
 http://avdi.org

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



Re: [O] Feature request for noweb mode that strips references on export

2012-02-01 Thread Eric Schulte
Avdi Grimm gro...@inbox.avdi.org writes:

 Presently there are three noweb modes: yes, no, and tangle. I would
 like a fourth, which would behave as follows:

 On tangle: normal noweb expansion is performed.
 On evaluation: normal noweb expansion is performed.
 On export: noweb references are STRIPPED. Not just ignored, but the
 lines containing the references are removed before export.

 The use case is this: I find myself writing articles where I have a
 series of code examples like this:

 #+begin_src ruby
   boilerplate
   2 + 2 # =
 #+end_src

 The boilerplate is required to make the sample work, but I don't want
 to have the boilerplate code show up in the finished article, because
 it would be repeated for every example. I also don't want the noweb
 reference to show up in the finished article, because it will confuse
 readers and syntax highlighters.

 Is this possible now, and/or a feature that could be easily added?


I've just added tested and documented such a strip-export argument to
:noweb.  Please let me know if it doesn't work as you expected.

Best,


 Thanks,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



Re: [O] Feature request for noweb mode that strips references on export

2012-01-31 Thread Avdi Grimm
On Tue, Jan 31, 2012 at 2:56 AM, Sebastien Vauban
wxhgmqzgw...@spammotel.com wrote:
 Just for the sake of completeness, there is already a fourth option:

Ah! Looks like I had an older version. Thanks for prompting me to update!

I guess what I'm looking for would be called :noweb export-strip or
something like that.

-- 
Avdi Grimm
http://avdi.org



Re: [O] Feature request for noweb mode that strips references on export

2012-01-31 Thread Avdi Grimm
P.S. It's been a while since I've been on this ML, so if there's a
right way to do a feature request please let me know and I'll do it
:-)

On Tue, Jan 31, 2012 at 12:38 PM, Avdi Grimm gro...@inbox.avdi.org wrote:
 On Tue, Jan 31, 2012 at 2:56 AM, Sebastien Vauban
 wxhgmqzgw...@spammotel.com wrote:
 Just for the sake of completeness, there is already a fourth option:

 Ah! Looks like I had an older version. Thanks for prompting me to update!

 I guess what I'm looking for would be called :noweb export-strip or
 something like that.

 --
 Avdi Grimm
 http://avdi.org



-- 
Avdi Grimm
http://avdi.org



Re: [O] Feature request for noweb mode that strips references on export

2012-01-30 Thread Sebastien Vauban
Hi Avdi,

Avdi Grimm wrote:
 Presently there are three noweb modes: yes, no, and tangle. I would
 like a fourth, which would behave as follows:

Just for the sake of completeness, there is already a fourth option:
no-export which expands noweb references during tangling and execution, but
not during weaving (export).

Best regards,
  Seb

-- 
Sebastien Vauban