diff --git a/DESCRIPTION b/DESCRIPTION index 14f53a2..6ef66f4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,13 +1,13 @@ Package: cfaDocs Type: Package Title: Content Creation and Development Via R -Version: 0.0-1.15 -Date: 2024-11-20 +Version: 0.0-1.16 +Date: 2025-9-13 Description: A package for the development, creation and formatting of the Center for Assessments intellectual content. Authors@R: c(person(given=c("Adam", "R."), family="Van Iwaarden", email="avaniwaarden@nciea.org", role=c("aut", "cre")), person(given=c("Damian", "W."), family="Betebenner", email="dbetebenner@nciea.org", role="aut")) Maintainer: Adam R. Van Iwaarden -Depends: R (>= 3.6), rmarkdown, pagedown +Depends: R (>= 4.2), rmarkdown, pagedown Suggests: toOrdinal, xaringanExtra, data.table Imports: crayon, @@ -22,8 +22,6 @@ Imports: Remotes: gadenbuie/xaringanExtra SystemRequirements: pandoc (>= 2.14) - http://johnmacfarlane.net/pandoc -LazyData: Yes -LazyDataCompression: xz License: MIT + file LICENSE URL: https://github.com/CenterForAssessment/cfaDocs BugReports: https://github.com/CenterForAssessment/cfaDocs/issues diff --git a/LICENSE b/LICENSE index 086e2ae..e952739 100644 --- a/LICENSE +++ b/LICENSE @@ -1,2 +1,2 @@ -YEAR: 2024 +YEAR: 2025 COPYRIGHT HOLDER: Center For Assessment diff --git a/LICENSE.md b/LICENSE.md index a9b56c4..3b13eba 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,7 +1,7 @@ MIT License =========== -Copyright (c) 2024 Center for Assessment +Copyright (c) 2025 Center for Assessment Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/NAMESPACE b/NAMESPACE index e96632b..823e54a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,6 +8,7 @@ export(eqnNumIncrement) export(figNum) export(figNumIncrement) export(getCounter) +export(html_to_pdf) export(numbers2words) export(resolvePath) export(setCounters) diff --git a/R/html_to_pdf.R b/R/html_to_pdf.R new file mode 100644 index 0000000..2381435 --- /dev/null +++ b/R/html_to_pdf.R @@ -0,0 +1,28 @@ + +html_to_pdf <- + function( + urls, delay = 1, ... + ) { + CS <- chromote::ChromoteSession$new() + + for (u in urls) { + CS$go_to(u, delay = delay) + p <- + CS$Page$printToPDF( + printBackground = TRUE, + preferCSSPageSize = TRUE, + ..., wait_ = TRUE + )$data + + filename <- basename(u) |> + gsub(".html", ".pdf", x = _) |> + gsub("/$", "", x = _) |> + fs::path_sanitize(replacement = "_") + + outfile <- file(filename, "wb") # wb = write binary + base64enc::base64decode(p, output = outfile) + close(outfile) + } + + invisible(CS$close()) + } \ No newline at end of file diff --git a/R/zzz.R b/R/zzz.R index a64a80f..b666769 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -7,6 +7,6 @@ packageStartupMessage(crayon::magenta$bold("cfaDocs", paste(paste0(unlist(strsplit(as.character(utils::packageVersion("cfaDocs")), "[.]")), c(".", "-", ".", "")), collapse = ""), - " (11-20-2024). For help visit https://centerforassessment.github.io/cfaDocs")) + " (9-13-2025). For help visit https://centerforassessment.github.io/cfaDocs")) } } diff --git a/inst/CITATION b/inst/CITATION index b9a0198..c1c369f 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -3,11 +3,11 @@ citHeader("To cite package 'cfaDocs' in publications use:") citEntry(entry = "Manual", title = "{cfaDocs}: Content Creation and Development Via R.", author = personList(as.person("Adam R. Van Iwaarden"), as.person("Damian W. Betebenner")), - year = "2022", - note = "R package version 0.0-1.11", + year = "2025", + note = "R package version 0.0-1.16", url = "https://centerforassessment.github.io/cfaDocs/", - textVersion = paste("Adam R. Van Iwaarden and Damian W. Betebenner (2022).", + textVersion = paste("Adam R. Van Iwaarden and Damian W. Betebenner (2025).", "Literasee: Content Creation and Development Via R.", - "(R package version 0.0-1.11)", + "(R package version 0.0-1.16)", "URL: https://centerforassessment.github.io/cfaDocs/")) diff --git a/inst/rmarkdown/shared_resources/bib/cfa.bib b/inst/rmarkdown/shared_resources/bib/cfa.bib index 066fbc8..7b80531 100755 --- a/inst/rmarkdown/shared_resources/bib/cfa.bib +++ b/inst/rmarkdown/shared_resources/bib/cfa.bib @@ -61,8 +61,8 @@ @Manual{sgp2020 @Manual{sgp, title = {{SGP}: Student Growth Percentiles \& Percentile Growth Trajectories.}, author = {Damian W. Betebenner and Adam {VanIwaarden} and Ben Domingue and Yi Shang}, - year = {2024}, - note = {R package version 2.1-0.0}, + year = {2025}, + note = {R package version 2.2-0.0}, url = {sgp.io}, } @@ -72,8 +72,9 @@ @manual{Rsoftware Organization = {R Foundation for Statistical Computing}, Title = {{\textup{\textsf{R}}}: A language and environment for statistical computing}, Url = {http://www.R-project.org}, - Year = {2024}, - Bdsk-Url-1 = {http://www.R-project.org}} + Year = {2025}, + Bdsk-Url-1 = {http://www.R-project.org} +} @Manual{lme4, title = {{lme4}: Linear mixed-effects models using Eigen and S4}, diff --git a/inst/rmarkdown/templates/pagedown/cfa/css/cfa-default.css b/inst/rmarkdown/templates/pagedown/cfa/css/cfa-default.css index 416605e..6a75618 100644 --- a/inst/rmarkdown/templates/pagedown/cfa/css/cfa-default.css +++ b/inst/rmarkdown/templates/pagedown/cfa/css/cfa-default.css @@ -103,7 +103,7 @@ .toc a.front-matter-ref::after, .lot a.front-matter-ref::after, .lof a.front-matter-ref::after { /* content: leader(dotted) target-counter(attr(href), page, lower-roman); */ /* content: target-counter(attr(href), page, lower-roman); /* Gets messed up? Counts (non-displayed blank pages...) */ - content: "iii"; + content: "ii"; } .toc .leaders::before, .lot .leaders::before, .lof .leaders::before { float: left; diff --git a/inst/rmarkdown/templates/pagedown/cfa/css/cfa-page.css b/inst/rmarkdown/templates/pagedown/cfa/css/cfa-page.css index 403cb95..18e5a82 100644 --- a/inst/rmarkdown/templates/pagedown/cfa/css/cfa-page.css +++ b/inst/rmarkdown/templates/pagedown/cfa/css/cfa-page.css @@ -75,13 +75,18 @@ html { /* Front page or title page */ .front-page { - counter-reset: page -1; + /* counter-reset: page -1; */ + counter-set: page; /* change for Chrome post version 125 */ } /* page breaks; aka CSS fragmentation */ .level1 { break-before: page; } +/* reset page numbering for main content */ +.main .level1:first-child h1 { + counter-reset: page 1; +} .section > h1, .section > h2, .section > h3, .section > h4, .section > h5, .section > h6 { break-after: avoid; @@ -94,10 +99,6 @@ html { break-inside: avoid; } -/* reset page numbering for main content */ -.main .level1:first-child h1 { - counter-reset: page 1; -} /* do not break captions */ caption { @@ -209,9 +210,18 @@ h3.abstract { font-weight: bold; } } - +@page frontmatter:first { + counter-set: page; +} +@page frontmatter:first { + @bottom-center { + content: none; + } +} .pagedjs_frontmatter_first_page { - display:none; + /* display:none; */ + position: absolute; + left: -9999px; } /* ---------------------- Main Content ----------------- */ @@ -231,10 +241,24 @@ h3.abstract { } } +@page maincontent:first { + counter-set: page 1; +} + + +@page maincontent:first { + @bottom-center { + content: none; + } +} + .pagedjs_maincontent_first_page { - display:none; +/* display: none; */ + position: absolute; + left: -9999px; } + /* ---------------------- Last page ----------------- */ /* last page or back cover */ /* @@ -337,6 +361,17 @@ h3.abstract { break-after: avoid; } +.breakbefore { + page-break-before: always; +} +.breakafter { + page-break-after: always; +} +.breakboth { + page-break-before: always; + page-break-after: always; +} + /* --------------------- Columns ------------------- */ .left-column { float: left; diff --git a/inst/rmarkdown/templates/pagedown/cfa/css/cfa-style.css b/inst/rmarkdown/templates/pagedown/cfa/css/cfa-style.css index 44a7f7c..d44ad96 100644 --- a/inst/rmarkdown/templates/pagedown/cfa/css/cfa-style.css +++ b/inst/rmarkdown/templates/pagedown/cfa/css/cfa-style.css @@ -254,6 +254,7 @@ table { /* ----------------- List style ------------------- */ ul, ol { list-style-type: disc; + font-size: 11pt; font-weight: 300; text-align: justify; } @@ -292,6 +293,12 @@ span.footnote { } /* --------------------- Misc --------------- */ + +sup { + font-style: italic; + font-size: x-small; +} + abbr { text-decoration: none; } diff --git a/inst/rmarkdown/templates/pagedown/cfa/css/cfa_appendix-page.css b/inst/rmarkdown/templates/pagedown/cfa/css/cfa_appendix-page.css index d2f3e47..6df3226 100644 --- a/inst/rmarkdown/templates/pagedown/cfa/css/cfa_appendix-page.css +++ b/inst/rmarkdown/templates/pagedown/cfa/css/cfa_appendix-page.css @@ -75,7 +75,7 @@ html { /* Front page or title page */ .front-page { - counter-reset: page 0; + counter-set: page 0; } /* page breaks; aka CSS fragmentation */ diff --git a/inst/rmarkdown/templates/pagedown/cfa/img/cfa-front-cover.svg b/inst/rmarkdown/templates/pagedown/cfa/img/cfa-front-cover.svg index 5e629ef..8cd3c08 100644 --- a/inst/rmarkdown/templates/pagedown/cfa/img/cfa-front-cover.svg +++ b/inst/rmarkdown/templates/pagedown/cfa/img/cfa-front-cover.svg @@ -1,14 +1,5 @@ image/svg+xml + inkscape:document-rotation="0" + inkscape:showpageshadow="2" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" /> @@ -222,37 +227,35 @@ id="path889" />National Center for the Improvement + y="645.45453" + id="tspan8">National Center for the Improvement of Educational Assessment + y="657.12122" + id="tspan10">of Educational Assessment Dover, NHDover, NH + points="17.701 12.254 26.705 31.562 45.539 22.776" />