Execute the script R/scriptConversionQuarto.R
in the fennica/inst/examples directory.
The script will automatically convert the .Rmd files in quarto, add a chunk code with source("init.R)
at beginning of the .qmd files and then render the directory in the _book
folder (can be changed in the _quarto.yml
file).
To see what the book looks like, use the commande (in the inst/examples) :
quarto::quarto_preview()
in a R prompt
or use :
quarto preview
in the shell prompt
In a R command prompt, use the following command :
knitr::convert_chunk_header("filename.Rmd", output = "filename.qmd")
The output is necessary to create a new file, otherwise the file converted in quarto is only printed.
With the quarto package loaded, use in a shell prompt :
quarto render filename.qmd
or in a R prompt :
quarto::quarto_render("filename.qmd")
-> The output of this command is set by default to create a html document of the same name.
In the folder you want to render, use in a shell prompt :
quarto render
-> all the qmd file in the current folder will be rendered.
In the _quarto.yml
file, you can precise what file you want to render and add treatment options.
Here are two links that can be helpfull : -> converting rmd to quarto for beginner https://laderast.github.io/qmd_rmd/#/title-slide
-> the official quarto documentation site https://quarto.org/docs/guide/