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

Download link/button for .Rmd file #106

Closed
stevenfazzio opened this Issue May 9, 2017 · 3 comments

Comments

Projects
None yet
4 participants
@stevenfazzio
Copy link

stevenfazzio commented May 9, 2017

It would be nice if there were a way to add a download link to each article so that the reader could download the .Rmd file associated with the article.

@cboettig

This comment has been minimized.

Copy link

cboettig commented May 21, 2017

I think this would be hard to implement robustly on the blogdown side, since the .Rmd file isn't transferred to Hugo's publishDir and so there's no obvious path to point to. If your site source is hosted publicly (say, on GitHub) though it's easy enough to construct a URL in your Hugo template that will point to the the .Rmd there. This is what I do with my site, e.g.: http://www.carlboettiger.info/2017/04/19/migrating-to-hugo-and-blogdown/

@apreshill

This comment has been minimized.

Copy link
Member

apreshill commented Aug 25, 2017

If you are using Github, you can link to the Rmd file there as I did here:
https://apreshill.rbind.io/talk/code-your-graph/

@yihui yihui modified the milestones: v0.3, v0.4 Nov 13, 2017

@yihui yihui modified the milestones: v0.4, v0.5 Dec 25, 2017

@yihui yihui modified the milestones: v0.5, v0.6 Jan 31, 2018

@yihui yihui modified the milestones: v0.6, v0.7 Jun 18, 2018

@yihui

This comment has been minimized.

Copy link
Member

yihui commented Jul 7, 2018

If the website source repo is publicly available on Github, it is possible to automatically point to the Rmd source file on Github. I have documented how to include an "Edit this page" link on your website that takes readers to Github to edit an Rmd source file in the book: https://bookdown.org/yihui/blogdown/templates.html (search for "Github Edit" on this page).

If the website source repo is private, you may use xfun::embed_file(); see rstudio/rmarkdown#708 (comment) for more info.

clrpackages pushed a commit to clearlinux-pkgs/R-xfun that referenced this issue Oct 26, 2018

[update to 0.4] fix rstudio/blogdown#327: try all methods on all plat…
…forms (not only Windows), since Microsoft's R could also fail with the 'auto' method in download.file()

Daijiang Li (1):
      add test_string for n2w() (#6)

Xianying Tan (2):
      is_ascii() returns NA for NA_character_ (#9)
      invalid_utf8() should ignore NA input (#10)

Yihui Xie (16):
      replace random tempdir/tempfile paths in check logs to avoid diffs when comparing check logs
      support the class JS_EVAL in tojson()
      mention jsonlite
      move the argument rw_error from gsub_dir() to gsub_file()
      canonical CRAN URL
      close rstudio/rmarkdown#708 and close rstudio/blogdown#106: provide a simple yet general approach to embedding files/dir in HTML output
      roxygenize and bump version
      enable code coverage
      add some sample tests
      install covr earlier
      update roxygen
      close yihui/knitr#1583: add a `message` argument to pkg_attach() so that we can suppress package startup messages
      fix rstudio/blogdown#327: try all methods on all platforms (not only Windows), since Microsoft's R could also fail with the 'auto' method in download.file()
      stop if zip() fails
      mention that the download link doesn't work with IE
      CRAN release v0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.