Skip to content

Commit

Permalink
update how the logo is included in the report
Browse files Browse the repository at this point in the history
  • Loading branch information
Karim-Mane committed Mar 18, 2024
1 parent 10024f5 commit ce4131e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions R/print_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ print_report <- function(data,
overwrite = TRUE
)
report[["report_title"]] <- report_title
man_path <- file.path("man", "figures")
report[["logo"]] <- system.file(man_path, "logo.svg",
package = "cleanepi")

if (format == "html") {
message("Generating html report...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ params:
misspelled_values: NULL
incorrect_date_sequence: NULL
report_title: "cleanepi report"
logo: NULL
---


Expand All @@ -40,7 +41,7 @@ p.compact {
<script>
$(document).ready(function() {
$head = $('#header');
$head.prepend('<img src="`r xfun::base64_uri("/Users/karimmane/Documents/Karim/LSHTM/TRACE_dev/Packages/On_trace_github/cleanepi/man/figures/logo.svg")`" style="float: right; width: 100px;"/>')
$head.prepend('<img src="`r params$logo`" style="float: right; width: 100px;"/>')
});
</script>

Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-print_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ test_that("print_report works", {
})

test_that("print_report fails when no report is associated to the data", {
testthat::skip_on_cran()
testthat::skip_on_covr()
expect_error(
print_report(
data = test_data,
Expand Down

0 comments on commit ce4131e

Please sign in to comment.