feat: add Quarto themes and templates (revealjs, HTML, PDF, Typst)
R-CMD-check / R CMD check (push) Successful in 3m52s

Integrate Civilytics Reveal.js slide extension, HTML/PDF/Typst document
themes, and _brand.yml into the package under inst/quarto/. Three new
helper functions (use_civilytics_revealjs, use_civilytics_theme,
use_civilytics_brand) copy assets into a user's Quarto project. Logos
are stored once in inst/img/ and distributed at install time.
This commit is contained in:
2026-05-20 09:39:27 -06:00
parent 41fe2b6170
commit 136c53643c
25 changed files with 3641 additions and 2 deletions
+9
View File
@@ -30,6 +30,15 @@ public-sector analysis.
}
}
\section{Quarto templates}{
\itemize{
\item [use_civilytics_revealjs()] -- install Reveal.js slide extension
\item [use_civilytics_theme()] -- install HTML/PDF/Typst document theme
\item [use_civilytics_brand()] -- install brand.yml only (Quarto 1.5+)
}
}
\seealso{
Useful links:
\itemize{
+27
View File
@@ -0,0 +1,27 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/quarto.R
\name{.copy_logos}
\alias{.copy_logos}
\title{Copy logo SVGs from inst/img/ to a target directory}
\usage{
.copy_logos(
dest_dir,
path,
force,
files = c("civilytics-mark.svg", "civilytics-mark-reverse.svg",
"civilytics-wordmark.svg", "civilytics-wordmark-reverse.svg", "civilytics-pulse.svg")
)
}
\arguments{
\item{dest_dir}{Destination directory relative to `path`.}
\item{path}{Project root.}
\item{force}{Overwrite existing files?}
\item{files}{Character vector of logo filenames to copy.}
}
\description{
Copy logo SVGs from inst/img/ to a target directory
}
\keyword{internal}
+24
View File
@@ -0,0 +1,24 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/quarto.R
\name{.copy_pkg_file}
\alias{.copy_pkg_file}
\title{Copy a package file to a project directory}
\usage{
.copy_pkg_file(src, dst, path, force)
}
\arguments{
\item{src}{Relative path within the installed package (under `inst/`).}
\item{dst}{Destination path relative to `path`.}
\item{path}{Project root.}
\item{force}{Overwrite existing files?}
}
\value{
Invisible logical indicating success.
}
\description{
Copy a package file to a project directory
}
\keyword{internal}
+11
View File
@@ -0,0 +1,11 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/quarto.R
\name{quarto-helpers}
\alias{quarto-helpers}
\title{Install Civilytics Quarto Themes and Templates}
\description{
Helper functions that copy Civilytics Quarto assets from the installed
package into your Quarto project directory. Logos are stored in a single
canonical location (`inst/img/`) and copied to the paths expected by each
template at install time.
}
+26
View File
@@ -0,0 +1,26 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/quarto.R
\name{use_civilytics_brand}
\alias{use_civilytics_brand}
\title{Install the Civilytics brand file only}
\usage{
use_civilytics_brand(path = ".", force = FALSE)
}
\arguments{
\item{path}{Character. Project directory to install into. Default `"."`.}
\item{force}{Logical. Overwrite existing files? Default `FALSE`.}
}
\value{
Invisible `NULL`.
}
\description{
Copies `_brand.yml` and the logo assets it references into your
Quarto project. This gives you Quarto 1.5+ automatic brand
styling (colors, fonts, logos) without the full theme SCSS.
}
\examples{
\dontrun{
use_civilytics_brand()
}
}
+27
View File
@@ -0,0 +1,27 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/quarto.R
\name{use_civilytics_revealjs}
\alias{use_civilytics_revealjs}
\title{Install the Civilytics Reveal.js extension}
\usage{
use_civilytics_revealjs(path = ".", force = FALSE)
}
\arguments{
\item{path}{Character. Project directory to install into. Default `"."`.}
\item{force}{Logical. Overwrite existing files? Default `FALSE`.}
}
\value{
Invisible `NULL`.
}
\description{
Copies the Civilytics Reveal.js Quarto extension into
`_extensions/civilytics-reveal/` under `path`, including brand logos
from the package. After running this function, add
`format: civilytics-reveal-revealjs` to your `.qmd` YAML front-matter.
}
\examples{
\dontrun{
use_civilytics_revealjs()
}
}
+26
View File
@@ -0,0 +1,26 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/quarto.R
\name{use_civilytics_theme}
\alias{use_civilytics_theme}
\title{Install the Civilytics document theme}
\usage{
use_civilytics_theme(path = ".", force = FALSE)
}
\arguments{
\item{path}{Character. Project directory to install into. Default `"."`.}
\item{force}{Logical. Overwrite existing files? Default `FALSE`.}
}
\value{
Invisible `NULL`.
}
\description{
Copies Civilytics HTML, PDF (LaTeX), and Typst theme files into
your Quarto project. Also installs `_brand.yml` and the logo
assets it references.
}
\examples{
\dontrun{
use_civilytics_theme()
}
}