Skip to content

Commit

Permalink
Attempt using Rmd for inner README
Browse files Browse the repository at this point in the history
  • Loading branch information
courtiol committed Nov 13, 2023
1 parent 1299fa5 commit d3f8bdd
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions bookdown/README.md → bookdown/README.Rmd
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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")
```

Expand All @@ -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()
```

Expand All @@ -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")
```

Expand All @@ -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 {
Expand All @@ -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
```

0 comments on commit d3f8bdd

Please sign in to comment.