RMarkdown integration

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Fri May 11 19:21:46 UTC 2018


Hi!

On Thu, 19 Apr 2018 15:36:38 +0200
meik michalke <meik.michalke at uni-duesseldorf.de> wrote:
> for a start, a plain and simple "render Rmd"-button would be awesome.

Ok, I've finally made a start on this (branch work/render_rmd). But as
usual, what looks simple from a distance has a lot of details attached
to it.

What I have done so far is a toolbar button / checkable action
"Run->Render Preview". This will show a live preview (updated as you
type) side by side with the .Rmd, inside the same window. I went for
that instead of a split window, as it would seem to accomplish roughly
the same, with less potential for confusion (by keeping source, and
rendered view next to each other).

0) This uses knit2html, for now, i.e. v1, only. This will be easy
enough to change, but I really have no idea on what to settle on.
Should be an option that users will be somewhat likely to have
installed, already, and that "just works" for most real-world usecases.
So which option is that?

1) Now, the first thing missing would seem to be a "final" rendering
option in addition to the preview. Probably with choice of output
format, and relevant options. Sounds like something to be handled in a
plugin?

2) Render Preview really only makes sense for .Rmd files, but for the
moment it's shown for all scripts. I could hide the action based on
file-name extension, of course. But what is the relation to the other
"Run" actions? I suppose "Run selection" and "Run line" still make
sense in an .Rmd context. But probably not "Run all". So "Run all" and
"Render Preview" would actually be "swapped" depending on the type of
script file?

3) But actually, why limit "Render Preview" to .Rmd, when knitr also
"does" LaTeX, HTML and others? Would it seem "safe" to assume that
"Render Preview" is relevant for any file that is not a plain R script?
The most versatile option in this direction would indeed seems to be
pandoc, but then, is there a acceptable fool-proof way of installing
pandoc from R?

4) But further: The new preview shares a lot of code with our existing
plugin previews. This also means that - in principle - it would not be
too hard at all to provide various types of previews (data, plots,
HTML) for regular R scripts (and at least for HTML aka "RKWard Output"
it would seem relatively straight-forward). So instead of limiting
"Render Preview" to .Rmd files, perhaps we really want to generalize it,
instead? But how exactly (UI-wise)?

(Of course not all of these questions would need to be solved all at
once, but trying to understand the problem space).

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20180511/a9b4eef7/attachment.sig>


More information about the rkward-devel mailing list