Pakillo / grateful

Facilitate citation of R packages
https://pakillo.github.io/grateful/
Other
224 stars 18 forks source link

Add an option for an output path #13

Closed sdhutchins closed 5 years ago

sdhutchins commented 6 years ago

Hi, I'm curious if you've considered adding a out.path parameter to the cite_packages() function.

I'd love to be able to do the following:

  1. Save to a particular path...like a docs folder
  2. Set the out.format to NULL in cases where I want the out.format to be the .Rmd file.

My idea is for the default out.path to be null and it'd save it in the top love of the project folder.

cite_packages(out.format = "md". out.path = "docs")

I'm more than willing to contribute this change as well as add some a pkgdown site if that's desired.

This package has saved me a TON of time @Pakillo

Pakillo commented 6 years ago

Hi @sdhutchins . Glad you found the pkg useful!

Yes, I agree it'd be nice to have an out.path parameter. Currently it saves everything in the working directory. I think the best way would be to include out.path as an argument to render_citations (i.e. to be able to choose output_dir here). And then include the argument in the cite_packages wrapper function too.

Regarding out.format, if you think being able to get the source Rmd can be useful, I'm happy to accept pull requests on that too. In this case we could get that with just a minor change to cite_packages (returning rather than rendering the Rmd)

Cheers!

sdhutchins commented 5 years ago

Thanks, @Pakillo! I just created a PR for this. https://github.com/Pakillo/grateful/pull/14 Let me know if it fits into your vision.