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
Closed

Feature request: venue = "html" #236

cwickham opened this issue Jan 22, 2019 · 2 comments

Comments

@cwickham
Copy link
Contributor

@cwickham cwickham 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
Copy link
Member

@jennybc jennybc 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.

Loading

@jennybc
Copy link
Member

@jennybc jennybc commented Feb 5, 2019

Closed via d03e0ef

Loading

@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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants