Skip to contents

Render a Quarto multilingual project

Usage

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

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

Arguments

project_path

Path where the book/website source is located

site_url

Base URL of the book/website.

profile

Quarto profile(s) to use.

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/RtmpQPpAnA/file176663d28444/blop/_quarto.yml': No such file or directory
#> Error in file(file, "rt", encoding = fileEncoding): cannot open the connection
if (FALSE) { # \dontrun{
if (require("servr") && rlang::is_interactive()) {
  servr::httw(file.path(directory, "blop", "_book"))
}
} # }