Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to render a single Rmd file using blogdown

Tags:

r

blogdown

We have a set of Rmd reports that live in a "knowledge repository" that we render via blogdown.

We'd like to facilitate someone rendering a single report. Is there a best way to do this using blogdown?

If not, what about adding a files argument to render, such that the specified files are rendered (and if not specified, defaults to the current behavior)?

like image 529
Ben Cipollini Avatar asked Jan 21 '26 23:01

Ben Cipollini


1 Answers

You can use the internal (i.e. not exported) function blogdown:::build_rmds(), e.g.,

blogdown:::build_rmds('content/foo.Rmd')

This will generate content/foo.html. If you have already started blogdown::serve_site(), your site should be automatically rebuilt, otherwise you can manually run blogdown::hugo_build().

like image 139
Yihui Xie Avatar answered Jan 23 '26 14:01

Yihui Xie