From edd72452af9b85d35146c99caac35cbd53ac76c3 Mon Sep 17 00:00:00 2001 From: Maria Doyle Date: Thu, 26 Sep 2024 16:37:33 +0100 Subject: [PATCH] Add resources table --- _quarto.yml | 2 + resources/resources-table.tsv | 23 ++++++++ resources/resources.qmd | 100 ++++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 resources/resources-table.tsv create mode 100644 resources/resources.qmd diff --git a/_quarto.yml b/_quarto.yml index 627a77f..d4cc83d 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -13,6 +13,8 @@ website: left: - text: "Home" href: index.qmd + - text: "Resources" + href: resources/resources.qmd - text: "Carpentries" menu: - text: "Overview" diff --git a/resources/resources-table.tsv b/resources/resources-table.tsv new file mode 100644 index 0000000..20ade5c --- /dev/null +++ b/resources/resources-table.tsv @@ -0,0 +1,23 @@ +Category Resource Acquire the Fundamentals (novice R) Acquire the Fundamentals (experienced R) Analyze Your Data Connect with the Community Train Others Develop a Package URL +Bioconductor Carpentry bioc-intro X X X https://carpentries-incubator.github.io/bioc-intro +Bioconductor Carpentry Topic specific (e.g. *bioc-rnaseq*) X X X https://carpentries-incubator.github.io/bioc-rnaseq +Bioconductor Carpentry bioc-project X X X X https://carpentries-incubator.github.io/bioc-project +Bioconductor Conferences Keynotes/Talks X X X +Bioconductor Conferences Package Demos/Workshops X X X X X X +Bioconductor Conferences Networking X +Other Workshops Longer courses (e.g. CSAMA, CSHL) X X X https://csama2024.bioconductor.eu +Other Workshops Everything else (e.g. local, GTN, Carpentries, commercial offerings) X X X X +Packages Help pages X X +Packages Vignettes X X X +Packages Workflows X X https://www.bioconductor.org/packages/release/workflows +Packages Datasets X X X +Packages GitHub Issues X X +Books R for Data Science X X https://r4ds.hadley.nz +Books Bioconductor Books X X https://bioconductor.org/help/bioconductor-books +Books R packages/Advanced R X X https://adv-r.hadley.nz/ +Books Bioconductor contributor guide X https://contributions.bioconductor.org +Community Support Site X X X X X https://support.bioconductor.org +Community Slack X X X X X X https://slack.bioconductor.org +Community Developer Mailing List X X https://stat.ethz.ch/mailman/listinfo/bioc-devel +Community Bioconductor YouTube channel X X https://www.youtube.com/user/bioconductor +Community Special Interest Groups (e.g. R-Ladies, R User Groups) X \ No newline at end of file diff --git a/resources/resources.qmd b/resources/resources.qmd new file mode 100644 index 0000000..8fb165f --- /dev/null +++ b/resources/resources.qmd @@ -0,0 +1,100 @@ +--- +title: "Resources" +format: html +editor: visual +execute: + message: false + warning: false + echo: false +--- + +The table below lists various resources for learning and teaching Bioconductor. If you're looking for more information or have updates, feel free to suggest changes via issues or contact us as described [here](index.qmd). + +```{r} +# Load necessary libraries +library(readr) +library(dplyr) +library(htmltools) + +# Function to read resources data +read_resources <- function(file_path) { + tryCatch({ + resources <- read_tsv(file_path, + col_types = cols(.default = "c"), + na = c("", "NA", "N/A")) + resources + }, error = function(e) { + stop("Error reading the TSV file: ", e$message) + }) +} + +# Load the data from the TSV file +resources_data <- read_resources("resources-table.tsv") + +# Function to replace NA with empty strings +replace_na_with_empty <- function(x) { + if (is.na(x)) "" else x +} + +# Define styles for category and resource rows with reduced padding and smaller font +category_style <- "background-color: #f0f0f0; font-weight: bold; border-bottom: 2px solid #ddd; font-size: 12px;" # Lighter grey and smaller font +resource_style <- "background-color: #ffffff !important; border-bottom: 1px solid #ddd; font-size: 12px;" # Smaller font size for rows + +# Create the HTML table with categories as headings +html_table <- paste0( + "", # Add data-quarto-disable-processing attribute + "", + "", # Reduced font size for headers + "", + "", + "", + "", + "", + "", + "", + "", + "", + + # Iterate over the categories and their corresponding resources + resources_data %>% + group_by(Category) %>% + group_split() %>% + lapply(function(category_group) { + category_name <- unique(category_group$Category) + paste0( + # Lightly shaded category row + "", + "", + + # Resource rows with white background and centered X + apply(category_group, 1, function(row) { + # Create resource link if URL is available + resource_link <- if (!is.na(row["URL"]) && row["URL"] != "") { + paste0("", row["Resource"], "") + } else { + row["Resource"] + } + + # Construct the resource row with white background and centered X + paste0("", + "", + "", + "", + "", + "", + "", + "", + "") + }) %>% paste0(collapse = "") + ) + }) %>% + paste0(collapse = ""), + + "
ResourceAcquire the Fundamentals (novice R)Acquire the Fundamentals (experienced R)Analyze Your DataConnect with the CommunityTrain OthersDevelop a Package
", + category_name, + "
", resource_link, "", replace_na_with_empty(row[3]), "", replace_na_with_empty(row[4]), "", replace_na_with_empty(row[5]), "", replace_na_with_empty(row[6]), "", replace_na_with_empty(row[7]), "", replace_na_with_empty(row[8]), "
" +) + +# Output the HTML table using htmltools::HTML() +HTML(html_table) +``` \ No newline at end of file