Skip to contents

Render a Quarto multilingual project

Usage

render_book(
  project_path = ".",
  site_url = NULL,
  profile = NULL,
  preview = rlang::is_interactive()
)

render_website(
  project_path = ".",
  site_url = NULL,
  profile = NULL,
  preview = rlang::is_interactive()
)

Arguments

project_path

Path where the book/website source is located

site_url

Override the base URL of the book/website. If NULL, in interactive sessions it will be set to "" to allow previewing the whole project with servr::httw().

profile

Quarto profile(s) to use.

preview

Logical indicating whether to preview the project using servr::httw().

Value

Nothing, called for its side-effect of rendering a project.

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/RtmpQhqu0y/file61e3452fc4/blop/_quarto.yml': No such file or directory
#> Error in file(file, "rt", encoding = fileEncoding): cannot open the connection