Ihor Radchenko <[email protected]> writes:
"Thomas S. Dye" <[email protected]> writes:
+ - [ ] Provide brief [[Examples of Use][Examples of Use]]
Looks like you forgot to check this checkbox.
I don't remember if I intended to check it. I view many of the
ob-doc-*.org files I've created as stubs for real programmers™
to
augment. If the unchecked box is interpreted as an invitation
to
augment the Examples of Use, then that would be a good thing
IMHO
:)
I think it is mostly a checkbox to make sure that WORG page has
minimum necessary content. Of course, anything in WORG can be
augmented.
The "minimum necessary" determination is the difficult part for
someone like me.
#+name: sed-input
This is test.
#+begin_src sed :stdin sed-input[]
s/This/That/
#+end_src
#+RESULTS:
: That is test.
And, this is a good example! I didn't know =name= could be
used
this way and, unfortunately, have no sense of how =stdin= is
typically used or how it could be useful for a Babel user.
This is a relatively new feature. A more classic way is
referring to
results of evaluation:
#+name: test
#+begin_src emacs-lisp :var extra=""
(concat "This is test" extra)
#+end_src
#+begin_src sed :stdin test(extra=" continued here")
s/This/That/
#+end_src
#+RESULTS:
: That is test continued here
As for :stdin, it is simply something to be piped as standard
input. For
sed, as it is typically used from command line (cat foo | sed
...), it
is the most natural usage IMHO.
(I am not sure how to incorporate these new examples into WORG
section...)
I advertised your examples as illustrating the use of streams from
the Org buffer in the style of a Unix pipeline.
All the best,
Tom
--
Thomas S. Dye
https://tsdye.online/tsdye