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 <- 1:4)
#> [1] 1 2 3 4
mean(y)
#> [1] 2.5</code></pre>
This can be pasted into the "HTML Editor" in canvas:

Which canvas renders into something like:

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?
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 usingoutput: html_fragment. So, for example the code:reprex({ (y <- 1:4) mean(y) }, venue = "html")would place the following on the clipboard:
This can be pasted into the "HTML Editor" in canvas:

Which canvas renders into something like:

I have an attempt implementing this which only involves an additional file to
make_filenames()and an additional condition inreprex(). Would you accept a PR for this?Any thoughts on any lurking gotchas with this venue?