Skip to content

Feature request: venue = "html" #236

@cwickham

Description

@cwickham

A few places I would like to post reprexes, most notably the LMS canvas, won't accept markdown, but will allow HTML input.

I propose an additional venue = "html" that would render using output: html_fragment. So, for example the code:

reprex({
  (y <- 1:4)
  mean(y)
}, venue = "html")

would place the following on the clipboard:

<pre class="r"><code>(y &lt;- 1:4)
#&gt; [1] 1 2 3 4
mean(y)
#&gt; [1] 2.5</code></pre>

This can be pasted into the "HTML Editor" in canvas:
screen shot 2019-01-21 at 7 21 42 pm

Which canvas renders into something like:
screen shot 2019-01-21 at 7 22 16 pm

I have an attempt implementing this which only involves an additional file to make_filenames() and an additional condition in reprex(). Would you accept a PR for this?

Any thoughts on any lurking gotchas with this venue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions