From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xebar Saram Subject: Re: convert rmarkdown (rmd) files to orgmode? Date: Wed, 20 Jul 2016 21:00:39 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c035ffeb2f8f1053814fad3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPvna-0000IP-G9 for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 14:00:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPvnV-0002j6-1E for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 14:00:45 -0400 Received: from mail-yw0-x235.google.com ([2607:f8b0:4002:c05::235]:34788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPvnU-0002j2-Jt for emacs-orgmode@gnu.org; Wed, 20 Jul 2016 14:00:40 -0400 Received: by mail-yw0-x235.google.com with SMTP id z8so30585307ywa.1 for ; Wed, 20 Jul 2016 11:00:40 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "Charles C. Berry" Cc: org mode , Philip Hudson --94eb2c035ffeb2f8f1053814fad3 Content-Type: text/plain; charset=UTF-8 ahh i see what you mean. thats a cool tip yet i find i have to find/replace also for images, find/replace to change example blocks to R code blocks etc which is quite tedious since i have about 50 of these converted Rmd to org files :) ill keep investigating this and report back thx so much for the tips! :) Z On Wed, Jul 20, 2016 at 8:42 PM, Charles C. Berry wrote: > On Wed, 20 Jul 2016, Xebar Saram wrote: > > 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? >> >> > > Nothing! > > The `:results silent' should suppress any output. > > Anyway, what you should see is that the code chunks that pandoc placed > inside equal signs like > > : ={r my-name} code = > > are now in src blocks. > > I think you need to put the src block at the top or add a > > : (goto-char (point-min)) > > as its first line to be sure it converts all the code chunks. > > > Chuck > --94eb2c035ffeb2f8f1053814fad3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
ahh i see what you mean.

thats a cool t= ip yet i find i have to find/replace also for images, find/replace to chang= e example blocks to R code blocks etc which is quite tedious since i have a= bout 50 of these converted Rmd to org files :)
ill keep investiga= ting this and report back

thx so much for the tips= ! :)

Z

<= div class=3D"gmail_quote">On Wed, Jul 20, 2016 at 8:42 PM, Charles C. Berry= <ccberry@ucsd.edu> wrote:
= On Wed, 20 Jul 2016, Xebar Saram wrote:

thx for the tips!

when i try to run the source block :

#+BEGIN_SRC emacs-lisp :results silent
=C2=A0(replace-regexp "^=3D[{]r \\([^}]*\\)[}]\\(.*\\)=3D$"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"#+name:= \\1
=C2=A0,#+begin_src R
=C2=A0\\2
=C2=A0,#+end_src")

#+END_SRC

i just get a nil in the message area. what am i missing?



Nothing!

The `:results silent' should suppress any output.

Anyway, what you should see is that the code chunks that pandoc placed insi= de equal signs like

: =3D{r my-name} code =3D

are now in src blocks.

I think you need to put the src block at the top or add a

: (goto-char (point-min))

as its first line to be sure it converts all the code chunks.


Chuck

--94eb2c035ffeb2f8f1053814fad3--