From aba8479655ce76b31a29be30d826f0b39365a65d Mon Sep 17 00:00:00 2001
From: gfraga <gorka.fragagonzalez@uzh.ch>
Date: Tue, 25 Jun 2024 15:16:08 +0200
Subject: [PATCH] revised comments

---
 .../YYYYMMDD_Firstname_LastName/index.qmd     | 21 ++++++++++++-------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/webpage_contents/templates/templates_for_publications/YYYYMMDD_Firstname_LastName/index.qmd b/webpage_contents/templates/templates_for_publications/YYYYMMDD_Firstname_LastName/index.qmd
index 3855561..7a4a5d7 100644
--- a/webpage_contents/templates/templates_for_publications/YYYYMMDD_Firstname_LastName/index.qmd
+++ b/webpage_contents/templates/templates_for_publications/YYYYMMDD_Firstname_LastName/index.qmd
@@ -16,6 +16,7 @@ author:
 code-fold: true
 ---
 
+
 ```{r userinputs}
 #| output: false
 #| echo: false
@@ -31,28 +32,32 @@ inputs <- read.csv(file = 'input_mice.csv')
 
 # Supplemental Results
 
-Note: Supplemental Methods are supposed to go to beamtime pages
-
 ## Links to protocol pages
 
 ```{r}
 # | warning: false 
 
-folders <- unique(cbind(inputs$Data_type,inputs$Facility_name_mon_YYYY)) #unique combination of experiment type and facility
-paths <-  as.data.frame(file.path(apply(folders, 1, paste, collapse = .Platform$file.sep), 'protocols')) #put together the paths rowwise
-colnames(paths) <- 'Protocols'
 
+library(dplyr)
 
+# This code chunk gathers the rows from tables specified in the inputs
+inputs <- read.csv(file = 'input_mice.csv')
+
+# Use data type and facility information to find the path to the relevant protocols
+folders <- unique(cbind(inputs$Data_type,inputs$Facility_name_mon_YYYY)) # find table's unique variations of experiment type and facility
+paths <-  as.data.frame(file.path(apply(folders, 1, paste, collapse = .Platform$file.sep), 'protocols')) #put together the paths 
+colnames(paths) <- 'Protocols'
 
-# Add location 
+# Add HTML code so that it becomes a clickable link 
 paths$Protocols <- paste0('<a href=\'',paths$Protocols,'\' target=\'_blank\'>', paths$Protocols,'</a>')
 file.path(here::here(), apply(folders, 1, paste, collapse = .Platform$file.sep), 'protocols')
 
+# Render table
 DT::datatable(paths, options = list(dom = 't'), escape = FALSE, rownames = FALSE, )
 
 ```
 
-## Synchrotron µCT Data
+## Mice information
 
 ```{r}
 # | warning: false 
@@ -69,7 +74,7 @@ for (i in 1:nrow(inputs)){
 data_used <- do.call(rbind,data_used) 
 data_used$Subject_pubID <- inputs$Subject_pubID # Add additional input column 
 
-
+# add the subject index for publication as first variable
 data_used <- relocate(data_used, Subject_pubID, .before = 1)
 
 #Display  table 
-- 
GitLab