From d3f8bddb0fbcae2e02e0ab249d4bdaded662d104 Mon Sep 17 00:00:00 2001 From: Alexandre Courtiol Date: Mon, 13 Nov 2023 11:03:10 +0100 Subject: [PATCH] Attempt using Rmd for inner README --- bookdown/{README.md => README.Rmd} | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) rename bookdown/{README.md => README.Rmd} (86%) diff --git a/bookdown/README.md b/bookdown/README.Rmd similarity index 86% rename from bookdown/README.md rename to bookdown/README.Rmd index aad5ab4..b478615 100644 --- a/bookdown/README.md +++ b/bookdown/README.Rmd @@ -1,3 +1,9 @@ +--- +output: html_document +editor_options: + chunk_output_type: console +--- + # Sources for the bookdown about IsoriX This is the development folder for the documentation about IsoriX. @@ -16,12 +22,19 @@ Do make sure however that the folder "output" exists, otherwise objects won't be ### Workflow for preparing an update -Make sure that you have the following packages installed (but no need to load them): **rsconnect**, **servr**. +Make sure that you have the following packages installed (but no need to load them): + +```{r, eval = FALSE} +if (!"rsconnect" %in% installed.packages()[, 1]) install.packages("rsconnect") +if (!"servr" %in% installed.packages()[, 1]) install.packages("servr") +if (!"gifski" %in% installed.packages()[, 1]) install.packages("gifski") +``` Then, render the full book once, so as to create all the content stored in the folder "output". For this, use: -```r + +```{r, eval = FALSE} bookdown::render_book("index.Rmd", "bookdown::gitbook") ``` @@ -30,7 +43,8 @@ Importantly, this job should not break even if you work on a remote computer and Once this is done, you can check the output by opening "IsoriX_project/Documentation/docs/index.html" (if it did not open automatically). Then, you should serve the book: -```r + +```{r, eval = FALSE} bookdown::serve_book() ``` @@ -41,7 +55,7 @@ Once you are satisfied with the results, you may want to delete once again the c Pull, commit and push the changes and then publish the content to update the website using: -```r +```{r, eval = FALSE} bookdown::publish_book(name = "IsoriX") ``` @@ -52,7 +66,7 @@ Check the bookdown online. If some steps are particularly slow, instead of relying on knitr cashing, it is best to store the created objects in the folder "output" and to use code similar to this: -```r +```{r, eval = FALSE} if (file.exists("output/some_object_slow_to_create.rds")) { some_object_slow_to_create <- readRDS("output/some_object_slow_to_create.rds") } else { @@ -66,7 +80,7 @@ if (file.exists("output/some_object_slow_to_create.rds")) { If a pandoc error shows up, make sure that pandoc is installed and that RStudio can find it. For RStudio to find pandoc, I had to create links by hand on one computer (but usually it works automatically): -```bash +```{bash, eval = FALSE} sudo ln -s -f /usr/bin/pandoc /usr/lib/rstudio/bin/pandoc/pandoc sudo ln -s -f /usr/bin/pandoc-citeproc /usr/lib/rstudio/bin/pandoc/pandoc-citeproc ```