Skip to content
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
8 changes: 3 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 <avaniwaarden@nciea.org>
Depends: R (>= 3.6), rmarkdown, pagedown
Depends: R (>= 4.2), rmarkdown, pagedown
Suggests: toOrdinal, xaringanExtra, data.table
Imports:
crayon,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2024
YEAR: 2025
COPYRIGHT HOLDER: Center For Assessment
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export(eqnNumIncrement)
export(figNum)
export(figNumIncrement)
export(getCounter)
export(html_to_pdf)
export(numbers2words)
export(resolvePath)
export(setCounters)
Expand Down
28 changes: 28 additions & 0 deletions R/html_to_pdf.R
Original file line number Diff line number Diff line change
@@ -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())
}
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}
8 changes: 4 additions & 4 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -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/"))
9 changes: 5 additions & 4 deletions inst/rmarkdown/shared_resources/bib/cfa.bib
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}

Expand All @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion inst/rmarkdown/templates/pagedown/cfa/css/cfa-default.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
51 changes: 43 additions & 8 deletions inst/rmarkdown/templates/pagedown/cfa/css/cfa-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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 ----------------- */
Expand All @@ -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 */
/*
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions inst/rmarkdown/templates/pagedown/cfa/css/cfa-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ table {
/* ----------------- List style ------------------- */
ul, ol {
list-style-type: disc;
font-size: 11pt;
font-weight: 300;
text-align: justify;
}
Expand Down Expand Up @@ -292,6 +293,12 @@ span.footnote {
}

/* --------------------- Misc --------------- */

sup {
font-style: italic;
font-size: x-small;
}

abbr {
text-decoration: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
87 changes: 49 additions & 38 deletions inst/rmarkdown/templates/pagedown/cfa/img/cfa-front-cover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading