thx for the tips! when i try to run the source block :
#+BEGIN_SRC emacs-lisp :results silent (replace-regexp "^=[{]r \\([^}]*\\)[}]\\(.*\\)=$" "#+name: \\1 ,#+begin_src R \\2 ,#+end_src") #+END_SRC i just get a nil in the message area. what am i missing? thx Z On Wed, Jul 20, 2016 at 8:20 PM, Charles C. Berry <ccbe...@ucsd.edu> wrote: > On Wed, 20 Jul 2016, Xebar Saram wrote: > > thx phil >> >> the Rmd format is actually quite different than md so that conversion >> didnt >> go well >> >> > I tried this > > pandoc -f markdown -t org input-file.Rmd -o output-file.org > > then I opened `output-file.org' and put this src block at the very top: > > #+BEGIN_SRC emacs-lisp :results silent > (replace-regexp "^=[{]r \\([^}]*\\)[}]\\(.*\\)=$" > "#+name: \\1 > ,#+begin_src R > \\2 > ,#+end_src") > > #+END_SRC > > When I execute that code block, all the converted code chunks become src > blocks. > > This isn't perfect as chunk options are appended to the `#+NAME:...' line, > but if you want to play with the regexp's you can probably get it to pick > those out and put them on a separate line. Or just write another src block > with another `replace-regexp' to fix those lines. > > With a little effort you can write a command file for `sed' to do what the > code block above does and then pipe the pandoc output to that command like > this: > > : pandoc -f markdown -t org input-file.Rmd | \ > : sed -f convert-chunks > output-file.org > > and you have an org document ready (or almost ready) to go. > > > HTH, > > Chuck > >