-
Notifications
You must be signed in to change notification settings - Fork 19
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
gist_create(file, knit = TRUE, source = TRUE) should work for an R script #29
Comments
@jennybc Thanks for this. I'll take a look... |
working on this, but also noticed issues with binary files (images) created during knit process - trying to get that solved too |
@jennybc would you normally generate the md from that file with |
Honestly I would click the button in RStudio, in this context. So I think that means |
@jennybc okay, reinstall from master, then try it again, e.g., file <- system.file("examples", "example1.R", package = "gistr")
cat(readLines(file), sep = "\n") # peek at file
gist_create(file, knit = TRUE) |
Yes it works! But … I like this example even more because I always want the gist to have source and pretty thing. gist_create(file, description = "my description", knit = TRUE, include_source = TRUE) Thanks. |
I just realized how garbled up my original example was. Good work figuring out what I meant to post. So it seems the YAML front matter is quite important. Omit it and the knitted output you get in the gist is the html. How often would anyone want that? IDK but food for thought ….. Control via an argument like |
@jennybc just to clarify, are you saying that sometimes users may not have the front matter, so we should default to markdown output, but allow user to control via a parameter? |
Yes exactly. But maybe I am atypical? I basically always want markdown. In addition to or instead of HTML. Even more so for a gist than in other contexts. |
Right, okay. I'll play around with that, #34 |
Riffing on this example from
gist_create()
:I define an R script like so:
and I would expect something like this to work:
But instead I get this:
Same result if I remove the YAML front matter, so that's not the problem.
The text was updated successfully, but these errors were encountered: