emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Xebar Saram <zeltakc@gmail.com>
To: "Charles C. Berry" <ccberry@ucsd.edu>
Cc: org mode <emacs-orgmode@gnu.org>, Philip Hudson <phil.hudson@iname.com>
Subject: Re: convert rmarkdown (rmd) files to orgmode?
Date: Thu, 21 Jul 2016 09:48:55 +0300	[thread overview]
Message-ID: <CAOQHXPp4yt4rHCd1Mv-h-G=7pb_3a8Dx4PdHg6K4nM3gZ+_Vsw@mail.gmail.com> (raw)
In-Reply-To: <CAOQHXPrKxA3gewXOawg5SmTjUadmKH6BJSWx0oEtq8uMuQymrQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1685 bytes --]

Hi again

Chuck:

is there a way to modify you nice code regex code snippet to simultaneously
change all example blocks to R blocks in a converted rmd>org file?
so when executing the block all example blocks:


 #+BEGIN_EXAMPLE
     help.search("rnorm")
 #+END_EXAMPLE

will turn into R blocks

 #+BEGIN_SRC R :session Rorg  :results none
     help.search("rnorm")
#+END_SRC


thx!

Z








On Wed, Jul 20, 2016 at 9:00 PM, Xebar Saram <zeltakc@gmail.com> wrote:

> 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 <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
>>>  (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
>>
>
>

[-- Attachment #2: Type: text/html, Size: 3032 bytes --]

  reply	other threads:[~2016-07-21  6:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20  4:28 convert rmarkdown (rmd) files to orgmode? Xebar Saram
     [not found] ` <CAJ1MqVF4Cq3ogH34P6AtSf0-ZX7ic=tApuX-ad=+14pLF7p1Aw@mail.gmail.com>
2016-07-20 11:15   ` Xebar Saram
2016-07-20 17:20     ` Charles C. Berry
2016-07-20 17:29       ` Xebar Saram
2016-07-20 17:42         ` Charles C. Berry
2016-07-20 18:00           ` Xebar Saram
2016-07-21  6:48             ` Xebar Saram [this message]
2016-07-21 16:27               ` Charles C. Berry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOQHXPp4yt4rHCd1Mv-h-G=7pb_3a8Dx4PdHg6K4nM3gZ+_Vsw@mail.gmail.com' \
    --to=zeltakc@gmail.com \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=phil.hudson@iname.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).