Skip to contents

Render a Quarto multilingual project

Usage

render_book(project_path = ".", site_url = NULL)

render_website(project_path = ".", site_url = NULL)

Arguments

project_path

Path where the book/website source is located

site_url

Base URL of the book/website.

Details

babelquarto expects a book/website folder with each qmd/Rmd present in as many languages as needed, with the same basename but,

  • once with only .qmd as extension for the main language,

  • once with .es.qmd (using the language code) for each other language.

You also need to register the language in the configuration file, see register_main_language() and register_further_languages():

babelquarto:
  mainlanguage: 'en'
  languages: ['es', 'fr']

Examples

directory <- withr::local_tempdir()
quarto_multilingual_book(parent_dir = directory, project_dir = "blop")
#> Error in setwd(dir = new): cannot change working directory
render_book(file.path(directory, "blop"))
#> Warning: cannot open file '/tmp/RtmpW9sgVv/file2e63ea138d5/blop/_quarto.yml': No such file or directory
#> Error in file(file, "rt", encoding = fileEncoding): cannot open the connection
if (FALSE) {
if (require("servr") && rlang::is_interactive()) {
  servr::httw(file.path(directory, "blop", "_book"))
}
}