emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-in-org


From: Berry, Charles
Subject: Re: org-in-org
Date: Sun, 7 Mar 2021 22:26:53 +0000


> On Mar 7, 2021, at 8:14 AM, Greg Minshall <minshall@umich.edu> wrote:
> 
> Charles,
> 
> thanks.  any thing you'd like to add to the R-via-ESS/org-mode
> repository, that would be great.
> 
> in general, afaik, the contents of org-in-org buffers export okay.  at
> least plain ones.  would could like to have the embedded code blocks go
> through some pretty-printer, but currently i don't see that as an issue.
> 
> as i mentioned to Jeremie, an issue is getting the org-in-org block to
> do its export.  i don't know if creating a recursive "execute" function
> for org source blocks -- which would cause them (modulo :eval, :exports,
> etc.) to evaluate their source blocks -- might be useful.
> 

Sorry, I do not know what a  `recursive "execute" function' would be/do in this 
context.

---

You said to Jeremie:
 
"during export of the *outer* org document, it could cause
the inner org block(s) to be executed and their results revealed."

AFAICS, the document below does exactly that upon export and can be exported 
using a command line idiom with proper attention to init-file issues (and let 
binding `org-confirm-babel-evaluate' to nil if you want to run in batch mode). 

As an example, html export will create a document that displays a `<pre 
class="src src-org"...> block with the R src block named `readdata-code' and 
the `#+RESULTS: readdata-code' block in it. 

--8<---------------cut here---------------start------------->8---
#+begin_src emacs-lisp :exports results :results none
  (org-babel-map-executables nil 
    (let ((org-confirm-babel-evaluate nil))
      (org-edit-src-code)
      (org-babel-execute-buffer)
      (org-edit-src-exit)))
#+end_src


#+NAME: readdata-code
#+BEGIN_SRC org
  ,#+NAME: readdata-code
  ,#+BEGIN_SRC R :results output

  read.csv(text="a,b,c\n1,2,3\n4,5,6",header=T) -> mydata1

  summary(mydata1)
  ,#+END_SRC

#+END_SRC
--8<---------------cut here---------------end--------------->8---


If that isn't what is needed, maybe you can provide the desired output when 
exporting the above sans the emacs-lisp src block.


Best,
Chuck





reply via email to

[Prev in Thread] Current Thread [Next in Thread]