Closed truecluster closed 5 months ago
@truecluster books have to be rendered using babelquarto::render_book()
.
You're the second person to ask so the culprit is the documentation, I'll update the README :grin:
Thank you Maelle,
That is important to know. Once I babelquarto::render_book()
I got the multilanguage setup, opening in a browser (local filesystem) gave me 404 on changing the language, because the site-url: "https://example.com"
was of course wrong. I can fix this by putting the "file:///pathto/project/_book/"
which creates conflicts with git synching with a production version. I tried the relative path "."
instead, but that fails because the default language is not in a subdirectory like the other two languages. Furthermore the search function does not work because babelquarto::render_book()
does not serve the content like the RenderBook Button in Rstudio. How can I preview my multilingual Book?
Kind regards
right, that's not straightforward.
servr::httw("docs")
(where "docs" should be replaced by the folder with the rendered book)babelquarto::render_book(site_url = <url-shown-by-servr>)
I opened #46
Thank you Maelle,
That works like a charm. Even more convenient when storing the return value of httw
:
ret <- servr::httw("_book") # start http server with path to index.html
babelquarto::render_book(site_url = ret$url) # render overwriting the url of the yaml file
servr::daemon_stop(1) # finally stop server
Kind regards
I have worked with bookdown, but am new to quarto. I try to setup a multilingual book (3 languages) that renders as a switchable html (and alternatively as 3 pdfs). I installed the latest version of RStudio, and babelquarto with
install.packages('babelquarto', repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))
I set up an example withThen I create a new RStudio project in mybookdir and html render the project: it gives just an english website with no language selector!?? What am I doing wrong?