OK, helpful to get me started. So I can replicate what the button now does. But I want to also use the output_dir argument to put the rendered docs and figs in my doc directory, while the .Rmd I render from, lives in the src directory. I can do this, but it seems when you use knit_root_dir on its own, you get relative paths to figures in the rendered .md file, while when you use knit_root_dir & output_dir it switches back to absolute paths. Very frustrating... As then when, for example you put the rendered docs on Github, you can't see the figures...
I can do exactly what I want when I use the ezknitr package... it would be nice if this could be done through the more widely-used rmarkdown package... Perhaps I need to open an issue in that dev repo...