
Render a Journal-Ready Reproducibility Verification Certificate
Source:R/certificate.R
render_certificate.RdProduces a publication-ready Markdown and/or standalone self-contained HTML5
reproducibility verification certificate from an rcapsule_verification
audit result. Suitable for journal peer-review supplements, Zenodo/OSF
archival packages, and CI reproducibility gates.
Usage
render_certificate(
verification,
output = NULL,
format = c("both", "markdown", "html"),
title = NULL
)Arguments
- verification
An
rcapsule_verificationobject returned byverify_capsule().- output
Optional base output path (or exact file path when rendering a single format). When
format = "both", writes<base>.mdand<base>.html. IfNULL, returns rendered strings in memory without writing files.- format
Output format:
"both"(default),"markdown", or"html".- title
Optional report title. Defaults to
"Reproducibility Verification Certificate: <project_name>".
Value
An S3 object of class rcapsule_certificate with fields markdown,
html, files (named character vector of written paths), and
verification.
Examples
tmp <- tempfile("rcapsule_cert_")
dir.create(tmp)
writeLines("write.csv(data.frame(a = 1:2), 'out.csv', row.names = FALSE)",
file.path(tmp, "run.R"))
write.csv(data.frame(a = 1:2), file.path(tmp, "out.csv"), row.names = FALSE)
m <- create_capsule_manifest(tmp, outputs = "out.csv", seed = 1L)
v <- verify_capsule(m, path = tmp)
cert <- render_certificate(v, output = file.path(tmp, "certificate"))
cert$files
#> markdown
#> "/tmp/RtmpwLqYir/rcapsule_cert_1a6310659795/certificate.md"
#> html
#> "/tmp/RtmpwLqYir/rcapsule_cert_1a6310659795/certificate.html"
unlink(tmp, recursive = TRUE)