Is there a way to detect the Bookdown output directory in code running within an RMarkdown document?
I'm happily using Bookdown to write tutorials using Python code. To make the tutorial interactive, I want to make copies of the .Rmd
files as Jupyter Notebooks, and put something like this at top of the relevant .Rmd
files:
`r make_link_notebook()`
where the make_link_notebook
function creates the Jupyter Notebook file, and makes a link to the notebook within the output document.
To do this, make_link_notebook
needs to know where the Bookdown output directory is. By default, of course, this is _book
, but I am customizing this in some configuration files, so I want to be able to find the output directory programmatically. Is this possible?