Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix codechecker hyperlink when no orcid id is there #77

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: codecheck
Title: Helper Functions for CODECHECK Project
Version: 0.11.1
Version: 0.11.2
Authors@R:
c(person(given = "Stephen",
family = "Eglen",
Expand Down
9 changes: 0 additions & 9 deletions R/utils_render_cert_htmls.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
#' @param register_table A data frame containing details of each certificate, including repository links and report links.
#' @param force_download Logical; if TRUE, forces the download of certificate PDFs even if they already exist locally. Defaults to FALSE.
render_cert_htmls <- function(register_table, force_download = FALSE){
# Keeping a list of failed cert pages. No hyperlinks will be added for these certs
CONFIG$LIST_FAILED_CERT_PAGES <- list()
CONFIG$LIST_FAILED_ABSTRACT <- list()

# Read template
html_template <- readLines(CONFIG$CERTS_DIR[["cert_page_template"]])

Expand All @@ -34,11 +30,6 @@ render_cert_htmls <- function(register_table, force_download = FALSE){
convert_cert_pdf_to_jpeg(cert_id)
}

# Failed in downloading cert
else{
CONFIG$LIST_FAILED_CERT_PAGES <- append(CONFIG$LIST_FAILED_CERT_PAGES, cert_id)
Sys.sleep(CONFIG$CERT_REQUEST_DELAY)
}
# Delaying reqwuests to adhere to request limits
Sys.sleep(CONFIG$CERT_REQUEST_DELAY)
}
Expand Down
19 changes: 15 additions & 4 deletions R/utils_render_cert_md.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,21 @@ add_codecheck_details_md <- function(md_content, repo_link){
config_yml <- get_codecheck_yml(repo_link)

# Adding the Codechecker name
codechecker_names <- paste(lapply(config_yml$codechecker, function(checker) {
paste0("[", checker$name, "](",
CONFIG$HYPERLINKS["orcid"], checker$ORCID, ")")
}), collapse = ", ")
codechecker_names <- c()

for (checker in config_yml$codechecker){
# Creating a hyperlink if the ORCID ID is available
if ("ORCID" %in% names(checker)){
codechecker <- paste0("[", checker$name, "](", CONFIG$HYPERLINKS["orcid"], checker$ORCID, ")")
}

else{
codechecker <- checker$name
}
codechecker_names <- append(codechecker_names, codechecker)
}
# Concatenate all entries into a single string separated by commas
codechecker_names <- paste(codechecker_names, collapse = ", ")

# Adjusting the codechecker name heading
# Multiple codecheckers
Expand Down
Loading