Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/task_batch_in…
Browse files Browse the repository at this point in the history
…tegration/update_results
rcannood committed Jan 23, 2025
2 parents d9ee7ba + e2a0162 commit 6b81d51
Showing 3 changed files with 27 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/quarto_netlify.yml
Original file line number Diff line number Diff line change
@@ -66,6 +66,12 @@ jobs:
- name: Render with Quarto
shell: bash -l {0}
run: |
# touch results/*/library.bib files
for task in results/*; do
touch "$task/library.bib"
done
# render
quarto render --profile evaluate_code
## push actions
5 changes: 5 additions & 0 deletions results/_generate_task_pages.py
Original file line number Diff line number Diff line change
@@ -43,3 +43,8 @@
print(f"Write to {index_qmd}", flush=True)
with index_qmd.open("w", encoding ="utf-8") as f:
f.write(content)

library = task_info_file.parent.parent / "library.bib"
if not library.exists():
print(f"Create {library}", flush=True)
library.write_text("")
29 changes: 16 additions & 13 deletions results/_include/_dataset_descriptions.qmd
Original file line number Diff line number Diff line change
@@ -30,27 +30,30 @@ lines <- pmap_chr(dataset_info, function(dataset_id, dataset_name, dataset_summa
}
# Make file_size human readable
if (!is.null(file_size)) {
file_size_str <- format(
structure(file_size, class = "object_size"),
units = "auto",
standard = "IEC",
digits = 2
)
}
file_size_str <-
if (is.na(file_size) || is.null(file_size)) {
NULL
} else {
format(
structure(file_size, class = "object_size"),
units = "auto",
standard = "IEC",
digits = 2
)
}
dataset_meta <- tribble(
~icon, ~value,
"bi bi-link-45deg", if(!is.null(dataset_link)) paste0("[Source dataset](", dataset_link, ")") else NULL,
"bi bi-box-arrow-up-right", if(!is.null(data_url)) paste0("[Data source](", data_url, ")") else NULL,
"bi bi-calendar", if(!is.null(date_created)) paste0(date_created) else NULL,
"bi bi-file-earmark-text", if(!is.null(file_size)) file_size_str else NULL,
"bi bi-file-earmark-text", file_size_str,
) %>% filter(!sapply(value, is.null))
meta_list <- paste(
paste0("<i class=\"", dataset_meta$icon, "\"></i> ", dataset_meta$value),
collapse = " · "
)
paste0("<i class=\"", dataset_meta$icon, "\"></i> ", dataset_meta$value),
collapse = " · "
)
summ <- (dataset_summary %|% "Missing 'dataset_summary'") %>% str_replace_all("\\n", " ") %>% str_replace_all("\\. *$", "")
@@ -65,4 +68,4 @@ lines <- pmap_chr(dataset_info, function(dataset_id, dataset_name, dataset_summa
|"))
})
knitr::asis_output(paste(lines, collapse = "\n"))
```
```

0 comments on commit 6b81d51

Please sign in to comment.