Skip to content

Commit

Permalink
Don't use the result from tweet_screenshot() for the fig path
Browse files Browse the repository at this point in the history
It's an absolute path, so just stick with knitr::fig_path()
  • Loading branch information
gadenbuie committed Jun 25, 2020
1 parent 0f5c1e8 commit 8228d8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/include_tweet.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ include_tweet <- function(tweet_url, ...) {

filename <- knitr::fig_path(".png")
dir.create(dirname(filename), recursive = TRUE, showWarnings = FALSE)
file_out <- tweet_screenshot(tweet_url, file = filename, ...)
knitr::include_graphics(file_out, dpi = NA)
tweet_screenshot(tweet_url, file = filename, ...)
knitr::include_graphics(filename, dpi = NA)
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ include_tweet("https://twitter.com/dsquintana/status/1275705042385940480")
```
````

<img src="/Users/garrick/Repos/tweetrmd/man/figures/README-tweet-from-dsquintana-1.png" width="400px" />
<img src="man/figures/README-tweet-from-dsquintana-1.png" width="400px" />

## Customize tweet appearance

Expand Down

0 comments on commit 8228d8c

Please sign in to comment.