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

Create an article showing off features #177

Open
jennybc opened this issue Feb 6, 2018 · 1 comment
Open

Create an article showing off features #177

jennybc opened this issue Feb 6, 2018 · 1 comment
Labels
documentation help wanted ❤️ we'd love your help! tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@jennybc
Copy link
Member

jennybc commented Feb 6, 2018

I removed the content below from the vignette, in the name of having no executed code in the vignette. Would like to add it back in an article.

Advanced features

Embedded prose

Sometimes you want to mingle rendered code and prose. Put the embedded prose in as roxygen comments, i.e. comment lines that start with #'. This reprex code:

tmpfile <- tempfile()
demo_code <- c(
  "## a regular comment",
  "x <- 1:100",
  "#' Here is some embedded prose, as a roxygen comment.",
  "mean(x)"
)
md_content <- reprex(
  input = demo_code,
  outfile = tmpfile,
  show = FALSE,
  advertise = FALSE
)
tmpfile <- paste0(tmpfile, "_reprex.md")
cat(demo_code, sep = "\n")

renders to this this result:

leftovers <- list.files(pattern = "README-tmp", ignore.case = TRUE)
if (length(leftovers)) file.remove(leftovers)
@jennybc jennybc changed the title Reinstate "Advanced features" of vignette ... or not Create an article showing off features May 17, 2019
@jennybc jennybc added documentation help wanted ❤️ we'd love your help! tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day labels May 17, 2019
@jennybc
Copy link
Member Author

jennybc commented May 17, 2019

This is about creating a pkgdown article (see usethis::use_article() for more) that shows use of reprex beyond the very basics.

The content above was removed in a draconian 2018 effort to remove/disable all sorts of code from running on CRAN.

An article remains safely off of CRAN and can present actual usage of reprex in a natural way, i.e. showing usage with the clipboard.

The examples of reprex() are also a great source of ideas.

Also this talk: https://speakerdeck.com/jennybc/reprex-reproducible-examples-with-r.
All the code snippets are already here: https://github.com/tidyverse/reprex/tree/master/slides/2018-09_reprex-rstudio-webinar

The goal would be an article with a well-named heading for each example, so they are easy to link to from elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation help wanted ❤️ we'd love your help! tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

No branches or pull requests

1 participant