From 8df85b79276ccc40f24284247b79a387b4dac6e9 Mon Sep 17 00:00:00 2001 From: chStaiger Date: Mon, 2 Mar 2026 11:36:18 +0100 Subject: [PATCH 1/3] Syntax Highlight Example --- book/chapters/comments-and-docstrings.qmd | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/book/chapters/comments-and-docstrings.qmd b/book/chapters/comments-and-docstrings.qmd index 257fef5..05639fc 100644 --- a/book/chapters/comments-and-docstrings.qmd +++ b/book/chapters/comments-and-docstrings.qmd @@ -92,9 +92,8 @@ There are **two main approaches**: 1. The `docstring` Package (for inline documentation) If you want a simple way to add docstrings directly inside your script (without creating an R package), you can use the [`docstring`](https://cran.r-project.org/package=docstring) package. - - #### Example - + + **Example** ```r library(docstring) @@ -117,7 +116,7 @@ There are **two main approaches**: For R packages, the most common and powerful way to use docstrings is through [roxygen2](https://roxygen2.r-lib.org/). It reads structured comments (starting with #') and automatically generates help files in the man/ directory of your package. - #### Example + **Example** ``` #' Multiply two numbers From 76f08afd228588197b45521de8d4bcf77f1536d5 Mon Sep 17 00:00:00 2001 From: chStaiger Date: Mon, 2 Mar 2026 11:46:14 +0100 Subject: [PATCH 2/3] Update reusability.qmd --- book/chapters/reusability.qmd | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/book/chapters/reusability.qmd b/book/chapters/reusability.qmd index 73d8928..4172980 100644 --- a/book/chapters/reusability.qmd +++ b/book/chapters/reusability.qmd @@ -82,19 +82,19 @@ indexAAG = indexString(myList, 'AAG') ## Think in building blocks! -
+Rather than writing long sequences of code, try to break your pipelines and workflows down into smaller reusable units. +Those "units" can be: -
-

Small, cohesive units are much better than...

- -
+- functions +- classes +- modules +- libraries/packagaes -
-

...a customized behemoth!

- -
+Small, cohesive units are much better than... +![](../images/tetris.svg){width=50%} -
+...a customized behemoth! +![](../images/tetris_help.svg){width=50%} ### Exercise From 338aea04ba7b9b9382ce792aeb122cb327576999 Mon Sep 17 00:00:00 2001 From: chstaiger Date: Mon, 2 Mar 2026 11:55:23 +0100 Subject: [PATCH 3/3] place images --- book/chapters/reusability.qmd | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/book/chapters/reusability.qmd b/book/chapters/reusability.qmd index 4172980..5946d8b 100644 --- a/book/chapters/reusability.qmd +++ b/book/chapters/reusability.qmd @@ -90,11 +90,9 @@ Those "units" can be: - modules - libraries/packagaes -Small, cohesive units are much better than... -![](../images/tetris.svg){width=50%} - -...a customized behemoth! -![](../images/tetris_help.svg){width=50%} + Small, cohesive units are much better than...|...a customized behemoth! + ---------------------------------------------|----------------------- +![](../images/tetris.svg){width=50%} | ![](../images/tetris_help.svg){width=90%} ### Exercise