Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: venue = "html" #236

Closed
cwickham opened this issue Jan 22, 2019 · 2 comments

Comments

@cwickham
Copy link
Contributor

commented Jan 22, 2019

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?

@jennybc

This comment has been minimized.

Copy link
Member

commented Jan 25, 2019

I think this is a good idea. I've considered it before! We are generally making html anyway for preview purposes.

@cwickham cwickham referenced this issue Jan 29, 2019

Merged

Add html venue #240

@jennybc

This comment has been minimized.

Copy link
Member

commented Feb 5, 2019

Closed via d03e0ef

@jennybc jennybc closed this Feb 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.