0

is it possible to get org-babel to output the interpreter prompts and sessions, as if each expression in the src block had been entered into the repl... e.g. something like:

#+begin_src ruby :output repl
10 + 10
puts "hello world"
[1,2,3,4,5,6,7,8,9,10].map do |i|
  i * i
end
#+end_src

Yielding:

#+results
: irb(main):001:0> 10 + 10
: => 20
: irb(main):002:0> puts "Hello World"
: Hello World
: => nil
: irb(main):003:0> [1,2,3,4,5,6,7,8,9,10].map do |i|
: irb(main):004:1*   i * i
: irb(main):005:1> end
: => [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
: irb(main):006:0>

The rational for this is that it lets you provide examples of being at the prompt and write better documentation. In this mode, you wouldn't want the original src block to be rendered, rather just the output as if it had been run interactively.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.