| Title: | Minimalist Theme and Vignette Kit for 'pkgdown' and R Markdown |
|---|---|
| Description: | Provides a minimalist 'ggplot2' theme, colour scales, and 'pkgdown' template built around a curated colour palette system inspired by Josef Albers' colour theory (Albers (1963, ISBN:978-0-300-17935-4) "Interaction of Color"). Includes helpers to apply consistent theming to 'ggplot2' plots, 'gt' tables, and 'bslib' Bootstrap 5 sites, along with one-command setup functions for adopting the style across an R package. |
| Authors: | Bradley R. Buchsbaum [aut, cre] |
| Maintainer: | Bradley R. Buchsbaum <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.1.0.9000 |
| Built: | 2026-10-04 00:51:47 UTC |
| Source: | https://github.com/bbuchsbaum/albersdown |
Convenience wrapper exposing core variables; most consumers won't need this
directly if they use template: { package: albersdown }.
albers_bs_theme( family = "red", preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"), accent = NULL, bg = NULL, fg = NULL )albers_bs_theme( family = "red", preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"), accent = NULL, bg = NULL, fg = NULL )
family |
Palette family name (default |
preset |
Visual preset (default |
accent |
Primary accent color (default A700 of the chosen family). |
bg |
Background color (default derived from preset). |
fg |
Foreground/text color (default derived from preset). |
A bslib::bs_theme object.
if (requireNamespace("bslib", quietly = TRUE)) { albers_bs_theme() }if (requireNamespace("bslib", quietly = TRUE)) { albers_bs_theme() }
The "contrast" set leads with the family's own tone and its
interaction complement – the two colours of the title plate (red and gold
for the red family) – then the complementary family (blue), the family at
another lightness, the complementary family at another lightness, and a
warm neutral. With mode = "dark" each slot keeps its hue (only its
lightness changes), so a category keeps its colour when the page switches
theme.
Adjacent levels differ in hue, so a two-group comparison is always legible. The "family" set is the single-hue A900-A300 ramp.
albers_discrete( family = getOption("albersdown.family", "red"), type = c("contrast", "family"), mode = c("light", "dark") )albers_discrete( family = getOption("albersdown.family", "red"), type = c("contrast", "family"), mode = c("light", "dark") )
family |
Palette family. |
type |
|
mode |
|
Character vector of hex colours.
albers_discrete("red") albers_discrete("teal", type = "family")albers_discrete("red") albers_discrete("teal", type = "family")
Return four-tone Homage family by name
albers_palette(family = c("red", "lapis", "ochre", "teal", "green", "violet"))albers_palette(family = c("red", "lapis", "ochre", "teal", "green", "violet"))
family |
One of "red", "lapis", "ochre", "teal". |
Named character vector of four hex colors (A900, A700, A500, A300).
albers_palette("red") albers_palette("lapis")albers_palette("red") albers_palette("lapis")
Four-tone families distilled from the uploaded grid; order is darkest to lightest (A900, A700, A500, A300).
albers_palette_img(family = c("red", "lapis", "ochre", "teal", "green"))albers_palette_img(family = c("red", "lapis", "ochre", "teal", "green"))
family |
One of "red","lapis","ochre","teal","green" |
Named character vector of four hex colors (A900, A700, A500, A300).
albers_palette_img("red")albers_palette_img("red")
Returns the two 2.0 directions: "homage" (warm cream ground, serif
body, light code) and "interaction" (cool grey ground, grotesk, dark
code). The legacy presets "study", "structural",
"adobe", and "midnight" are still accepted by
theme_albers() for backward compatibility but are no longer
featured.
albers_presets()albers_presets()
Character vector of direction names.
albers_presets()albers_presets()
Uses colorRampPalette to interpolate between the
four tones of a family (A900 → A300), producing an arbitrary
number of evenly spaced colors.
albers_ramp(family = "red", n = 9, reverse = FALSE)albers_ramp(family = "red", n = 9, reverse = FALSE)
family |
Palette family name. |
n |
Number of colors to return. |
reverse |
If |
Character vector of n hex colors.
albers_ramp("lapis", n = 5)albers_ramp("lapis", n = 5)
albersdown ships static TTF builds of Familjen Grotesk (the Homage display
face) and Space Grotesk (the Interaction display face) so that ggplot2 plots
can use the same typefaces as the rendered HTML pages. Call this once per
session – for example in a vignette setup chunk – before theme_albers().
Once the fonts are registered, theme_albers() picks the direction's display
font automatically (Homage -> Familjen Grotesk, Interaction -> Space Grotesk).
albers_register_fonts()albers_register_fonts()
Requires the systemfonts package and a font-aware graphics device such
as ragg (e.g. knitr::opts_chunk$set(dev = "ragg_png")). Without those,
plots fall back to the system "sans" family, so package examples and CRAN
checks never depend on the bundled fonts.
Invisibly, a character vector of the font families that were registered (empty if systemfonts is unavailable or the files are missing).
# Registers the bundled display fonts for the current session. Plot with a # font-aware device (e.g. ragg); the default pdf/postscript device cannot # render registered fonts. Wrapped in \dontrun because it mutates the # session-wide font registry. ## Not run: albers_register_fonts() ## End(Not run)# Registers the bundled display fonts for the current session. Plot with a # font-aware device (e.g. ragg); the default pdf/postscript device cannot # render registered fonts. Wrapped in \dontrun because it mutates the # session-wide font registry. ## Not run: albers_register_fonts() ## End(Not run)
Draws a tile plot showing the four tones of each palette family, optionally faceted by preset ground colors. Useful for quickly previewing the design system in a notebook or presentation.
albers_swatch( families = c("red", "lapis", "ochre", "teal", "green", "violet"), show_presets = FALSE )albers_swatch( families = c("red", "lapis", "ochre", "teal", "green", "violet"), show_presets = FALSE )
families |
Character vector of families to show. Defaults to all six. |
show_presets |
If |
A ggplot object.
if (requireNamespace("ggplot2", quietly = TRUE)) { albers_swatch() }if (requireNamespace("ggplot2", quietly = TRUE)) { albers_swatch() }
A drop-in replacement for rmarkdown::html_vignette() that applies the
albersdown theme with no files to copy into vignettes/. The stylesheet,
the fonts for the chosen direction, and the page script are taken from the
installed package and embedded in the self-contained HTML, so the result is
CRAN-safe (no network requests).
albers_vignette( family = "red", preset = "homage", style = c("minimal", "balanced", "assertive"), toc = TRUE, toc_depth = 3, fig_width = 6.6, fig_height = 4.1, plot_theme = TRUE, dark_figures = TRUE, phone_figures = TRUE, math_method = "mathml", fonts = c("direction", "both"), css = NULL, includes = NULL, ... )albers_vignette( family = "red", preset = "homage", style = c("minimal", "balanced", "assertive"), toc = TRUE, toc_depth = 3, fig_width = 6.6, fig_height = 4.1, plot_theme = TRUE, dark_figures = TRUE, phone_figures = TRUE, math_method = "mathml", fonts = c("direction", "both"), css = NULL, includes = NULL, ... )
family |
Accent family: one of |
preset |
Direction: |
style |
Weight of the structural marks: |
toc, toc_depth
|
Table of contents, passed to |
fig_width, fig_height
|
Default figure size in inches. |
plot_theme |
If |
dark_figures |
If |
phone_figures |
If |
math_method |
How equations are rendered. The default |
fonts |
Which bundled typefaces to embed: |
css |
Additional stylesheets, applied after the theme. |
includes |
Additional |
... |
Further arguments passed to |
Use it in a vignette's YAML header:
output:
albersdown::albers_vignette:
family: teal
preset: interaction
The format sets the page's family and direction before any content is
drawn (no restyle on load), sets knitr defaults suited to the theme
(collapse = TRUE, comment = "#>", retina figures at full column width,
the ragg device when available), and, when plot_theme = TRUE and
ggplot2 is installed, sets theme_albers() as the ggplot2 theme for the
duration of the render.
albers_vignette() is new in albersdown 2.1.0. A package whose vignettes
use it should declare albersdown (>= 2.1.0) in Suggests (as
use_albersdown() writes). If building a vignette fails with
'albers_vignette' is not an exported object from 'namespace:albersdown',
the albersdown installed is 2.0.0 or older: update it.
An R Markdown output format.
## Not run: rmarkdown::render("my-vignette.Rmd", output_format = albersdown::albers_vignette(family = "teal")) ## End(Not run)## Not run: rmarkdown::render("my-vignette.Rmd", output_format = albersdown::albers_vignette(family = "teal")) ## End(Not run)
Quiet, legible gt style with subtle stripe from A300
gt_albers( x, family = "red", preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"), base_size = 14, width = 720, bg = NULL, fg = NULL )gt_albers( x, family = "red", preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"), base_size = 14, width = 720, bg = NULL, fg = NULL )
x |
A |
family |
Palette family for subtle accents |
preset |
Visual preset (default |
base_size |
Base font size in pixels (default 14). |
width |
Table width in pixels (default 720). Use |
bg |
Override background color (default derived from preset). |
fg |
Override text color (default derived from preset). |
A styled gt table object.
if (requireNamespace("gt", quietly = TRUE)) { tbl <- gt::gt(head(mtcars)) gt_albers(tbl) }if (requireNamespace("gt", quietly = TRUE)) { tbl <- gt::gt(head(mtcars)) gt_albers(tbl) }
Convenience helper for existing packages that already use the vendored
albersdown setup (copied albers.css/albers.js in vignettes/) and need
to refresh it with the latest assets while choosing an Albers accent family
and preset. To move to the output format instead, use
use_albersdown(path, method = "format").
migrate_albersdown( path, family = "red", preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"), dry_run = FALSE )migrate_albersdown( path, family = "red", preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"), dry_run = FALSE )
path |
Path to the package directory. Must be supplied explicitly; there is no default so that the function never writes to an unexpected location. |
family, preset
|
As in |
dry_run |
if TRUE, report changes without writing files. |
TRUE invisibly.
if (interactive()) { migrate_albersdown(path = ".", family = "teal", preset = "midnight", dry_run = TRUE) }if (interactive()) { migrate_albersdown(path = ".", family = "teal", preset = "midnight", dry_run = TRUE) }
Discrete scales use albers_discrete(): by default the
family's tone is paired with its Albers complement and ochre so adjacent
groups stay distinguishable. Use type = "family" for the single-hue
ramp. Continuous scales run from a light tint to the family's A900.
scale_color_albers( family = getOption("albersdown.family", "red"), discrete = TRUE, type = c("contrast", "family"), ... ) scale_fill_albers( family = getOption("albersdown.family", "red"), discrete = TRUE, type = c("contrast", "family"), ... )scale_color_albers( family = getOption("albersdown.family", "red"), discrete = TRUE, type = c("contrast", "family"), ... ) scale_fill_albers( family = getOption("albersdown.family", "red"), discrete = TRUE, type = c("contrast", "family"), ... )
family |
Palette family. Defaults to the |
discrete |
Whether to use a discrete palette; if FALSE, uses a gradient. |
type |
Discrete colour set, |
... |
Passed to underlying |
A ggplot2 scale object.
if (requireNamespace("ggplot2", quietly = TRUE)) { ggplot2::ggplot(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species)) + ggplot2::geom_point() + scale_color_albers() }if (requireNamespace("ggplot2", quietly = TRUE)) { ggplot2::ggplot(iris, ggplot2::aes(Sepal.Length, Sepal.Width, color = Species)) + ggplot2::geom_point() + scale_color_albers() }
Uses one high-contrast tone (default A700) from different families to maximize separation between lines. This departs from the single-family aesthetic but improves readability for multi-series lines.
scale_color_albers_distinct(n = NULL, tone = c("A700", "A900", "A500"), ...)scale_color_albers_distinct(n = NULL, tone = c("A700", "A900", "A500"), ...)
n |
Number of colors needed; defaults to length of available families (6). |
tone |
One of "A700", "A900", or "A500". |
... |
Passed to |
A ggplot2 scale object.
if (requireNamespace("ggplot2", quietly = TRUE)) { df <- data.frame(x = 1:6, y = 1:6, g = paste0("G", 1:6)) ggplot2::ggplot(df, ggplot2::aes(x, y, color = g)) + ggplot2::geom_point() + scale_color_albers_distinct() }if (requireNamespace("ggplot2", quietly = TRUE)) { df <- data.frame(x = 1:6, y = 1:6, g = paste0("G", 1:6)) ggplot2::ggplot(df, ggplot2::aes(x, y, color = g)) + ggplot2::geom_point() + scale_color_albers_distinct() }
Diverging color scale (continuous)
scale_color_albers_diverging( low_family = "red", high_family = albers_complement(low_family), midpoint = 0, neutral = "#e5e7eb", ... )scale_color_albers_diverging( low_family = "red", high_family = albers_complement(low_family), midpoint = 0, neutral = "#e5e7eb", ... )
low_family, high_family
|
Homage families for the two sides |
midpoint |
numeric midpoint for the diverging scale (default 0) |
neutral |
hex color for the midpoint (default matches CSS border) |
... |
passed to ggplot2::scale_color_gradient2() |
A ggplot2 scale object.
Uses a 5-stop palette (low2, low1, neutral, high1, high2) for smoother transitions around the midpoint.
scale_color_albers_diverging_n( low_family = "red", high_family = albers_complement(low_family), neutral = "#e5e7eb", ... )scale_color_albers_diverging_n( low_family = "red", high_family = albers_complement(low_family), neutral = "#e5e7eb", ... )
low_family, high_family
|
Homage families for the two sides |
neutral |
hex color for the midpoint (default matches CSS border) |
... |
passed to ggplot2::scale_color_gradient2() |
A ggplot2 scale object.
Returns a manual color scale mapping a single highlighted group to a family tone (default A700) and all other points to a neutral gray.
scale_color_albers_highlight( family = "red", tone = c("A700", "A900", "A500", "A300"), other = "#9aa0a6", highlight = "highlight", other_name = "other", ... )scale_color_albers_highlight( family = "red", tone = c("A700", "A900", "A500", "A300"), other = "#9aa0a6", highlight = "highlight", other_name = "other", ... )
family |
Palette family name. |
tone |
One of A900, A700, A500, A300 used for the highlight color. |
other |
Hex color used for non-highlight values. |
highlight |
Name of the value that should receive the highlight color. |
other_name |
Name of the value that should receive the neutral color. |
... |
Passed to |
A ggplot2 scale object.
Image-derived sequential color scale
scale_color_albers_img(family = "red", discrete = TRUE, ...) scale_fill_albers_img(family = "red", discrete = TRUE, ...)scale_color_albers_img(family = "red", discrete = TRUE, ...) scale_fill_albers_img(family = "red", discrete = TRUE, ...)
family |
One of "red","lapis","ochre","teal","green" |
discrete |
Whether to use discrete palette; if FALSE uses a gradient. |
... |
Passed to underlying ggplot2 scale. |
A ggplot2 scale object.
Image-derived diverging color scale (gradientn)
scale_color_albers_img_diverging( low_family, high_family, neutral = "#E4E0D9", ... )scale_color_albers_img_diverging( low_family, high_family, neutral = "#E4E0D9", ... )
low_family |
Family for the low side (left) |
high_family |
Family for the high side (right) |
neutral |
Hex color for the midpoint (default derived from image) |
... |
Passed to ggplot2::scale_color_gradientn |
A ggplot2 scale object.
Pre-canned image-derived diverging pairs
scale_color_albers_img_red_teal(neutral = "#E4E0D9", ...) scale_color_albers_img_lapis_ochre(neutral = "#E4E0D9", ...) scale_color_albers_img_green_red(neutral = "#E4E0D9", ...) scale_fill_albers_img_red_teal(neutral = "#E4E0D9", ...) scale_fill_albers_img_lapis_ochre(neutral = "#E4E0D9", ...) scale_fill_albers_img_green_red(neutral = "#E4E0D9", ...)scale_color_albers_img_red_teal(neutral = "#E4E0D9", ...) scale_color_albers_img_lapis_ochre(neutral = "#E4E0D9", ...) scale_color_albers_img_green_red(neutral = "#E4E0D9", ...) scale_fill_albers_img_red_teal(neutral = "#E4E0D9", ...) scale_fill_albers_img_lapis_ochre(neutral = "#E4E0D9", ...) scale_fill_albers_img_green_red(neutral = "#E4E0D9", ...)
neutral |
Midpoint color (default from image); use "#e5e7eb" to match site CSS |
... |
Passed to the underlying gradientn scale |
A ggplot2 scale object.
Uses one high-contrast tone (default A700) from different families
to maximize separation between filled regions. Fill counterpart of
scale_color_albers_distinct.
scale_fill_albers_distinct(n = NULL, tone = c("A700", "A900", "A500"), ...)scale_fill_albers_distinct(n = NULL, tone = c("A700", "A900", "A500"), ...)
n |
Number of colors needed; defaults to length of available families (6). |
tone |
One of "A700", "A900", or "A500". |
... |
Passed to |
A ggplot2 scale object.
Diverging fill scale (continuous)
scale_fill_albers_diverging( low_family = "red", high_family = albers_complement(low_family), midpoint = 0, neutral = "#e5e7eb", ... )scale_fill_albers_diverging( low_family = "red", high_family = albers_complement(low_family), midpoint = 0, neutral = "#e5e7eb", ... )
low_family, high_family
|
Homage families for the two sides |
midpoint |
numeric midpoint for the diverging scale (default 0) |
neutral |
hex color for the midpoint (default matches CSS border) |
... |
passed to ggplot2::scale_color_gradient2() |
A ggplot2 scale object.
Useful for binned choropleths or sliced residuals. The middle class uses the neutral color.
scale_fill_albers_diverging_5( low_family = "red", high_family = albers_complement(low_family), neutral = "#e5e7eb", labels = ggplot2::waiver(), ... ) scale_color_albers_diverging_5( low_family = "red", high_family = albers_complement(low_family), neutral = "#e5e7eb", labels = ggplot2::waiver(), ... )scale_fill_albers_diverging_5( low_family = "red", high_family = albers_complement(low_family), neutral = "#e5e7eb", labels = ggplot2::waiver(), ... ) scale_color_albers_diverging_5( low_family = "red", high_family = albers_complement(low_family), neutral = "#e5e7eb", labels = ggplot2::waiver(), ... )
low_family, high_family
|
Homage families for the two sides |
neutral |
hex color for the midpoint (default matches CSS border) |
labels |
Optional labels for the five classes (low2, low1, mid, high1, high2) |
... |
Passed to |
A ggplot2 scale object.
Diverging fill scale with multiple stops (continuous)
scale_fill_albers_diverging_n( low_family = "red", high_family = albers_complement(low_family), neutral = "#e5e7eb", ... )scale_fill_albers_diverging_n( low_family = "red", high_family = albers_complement(low_family), neutral = "#e5e7eb", ... )
low_family, high_family
|
Homage families for the two sides |
neutral |
hex color for the midpoint (default matches CSS border) |
... |
passed to ggplot2::scale_color_gradient2() |
A ggplot2 scale object.
Convenience scale: highlight vs other (fill)
scale_fill_albers_highlight( family = "red", tone = c("A700", "A900", "A500", "A300"), other = "#9aa0a6", highlight = "highlight", other_name = "other", ... )scale_fill_albers_highlight( family = "red", tone = c("A700", "A900", "A500", "A300"), other = "#9aa0a6", highlight = "highlight", other_name = "other", ... )
family |
Palette family name. |
tone |
One of A900, A700, A500, A300 used for the highlight color. |
other |
Hex color used for non-highlight values. |
highlight |
Name of the value that should receive the highlight color. |
other_name |
Name of the value that should receive the neutral color. |
... |
Passed to |
A ggplot2 scale object.
Image-derived diverging fill scale (gradientn)
scale_fill_albers_img_diverging( low_family, high_family, neutral = "#E4E0D9", ... )scale_fill_albers_img_diverging( low_family, high_family, neutral = "#E4E0D9", ... )
low_family |
Family for the low side (left) |
high_family |
Family for the high side (right) |
neutral |
Hex color for the midpoint (default derived from image) |
... |
Passed to ggplot2::scale_fill_gradientn |
A ggplot2 scale object.
Provides a sensible set of linetypes for multi-series line charts.
scale_linetype_albers(...)scale_linetype_albers(...)
... |
Passed to |
A ggplot2 scale object.
Minimal, legible plot theme inspired by Josef Albers
theme_albers( family = getOption("albersdown.family", "red"), preset = getOption("albersdown.preset", c("homage", "interaction", "study", "structural", "adobe", "midnight")), base_size = 13, base_family = NULL, bg = NULL, fg = NULL, grid_color = NULL, mode = c("light", "dark") )theme_albers( family = getOption("albersdown.family", "red"), preset = getOption("albersdown.preset", c("homage", "interaction", "study", "structural", "adobe", "midnight")), base_size = 13, base_family = NULL, bg = NULL, fg = NULL, grid_color = NULL, mode = c("light", "dark") )
family |
Palette family used by companion scales. |
preset |
Visual direction: |
base_size |
Base font size. |
base_family |
Base font family. Plots fall back to the system "sans"
stack; install the matching typefaces (Familjen Grotesk / Space Grotesk,
etc.) and pass e.g. |
bg |
Override background color. Defaults to the preset's surface (the vignette sheet), so figures sit on the page rather than in a box. |
fg |
Override foreground/text color (default derived from preset). |
grid_color |
Override grid line color (default derived from preset). |
mode |
|
A ggplot2 theme object.
if (requireNamespace("ggplot2", quietly = TRUE)) { ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) + ggplot2::geom_point() + theme_albers() }if (requireNamespace("ggplot2", quietly = TRUE)) { ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) + ggplot2::geom_point() + theme_albers() }
Extends theme_albers by removing axes, grid lines, ticks,
and panel border – leaving only the plot background, titles, and legend.
Useful for spatial visualizations where coordinate axes are meaningless.
theme_albers_void( family = "red", preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"), base_size = 13, base_family = NULL, bg = NULL, fg = NULL )theme_albers_void( family = "red", preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"), base_size = 13, base_family = NULL, bg = NULL, fg = NULL )
family |
Palette family used by companion scales. |
preset |
Visual direction: |
base_size |
Base font size. |
base_family |
Base font family. Plots fall back to the system "sans"
stack; install the matching typefaces (Familjen Grotesk / Space Grotesk,
etc.) and pass e.g. |
bg |
Override background color. Defaults to the preset's surface (the vignette sheet), so figures sit on the page rather than in a box. |
fg |
Override foreground/text color (default derived from preset). |
A ggplot2 theme object.
This wrapper preserves the old name and forwards to use_albersdown().
use_albers_vignettes(path = ".", ...)use_albers_vignettes(path = ".", ...)
path |
Path to the package directory. Defaults to the current working directory to preserve the original wrapper behavior. |
... |
Additional arguments passed to |
TRUE invisibly.
if (interactive()) { use_albers_vignettes() }if (interactive()) { use_albers_vignettes() }
Adopt the albersdown theme in an existing package.
use_albersdown( path, family = "red", preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"), apply_to = c("all", "new"), dry_run = FALSE, fallback_extra = c("auto", "always", "never"), force_replace = TRUE, method = c("format", "vendor"), readme = FALSE )use_albersdown( path, family = "red", preset = c("homage", "interaction", "study", "structural", "adobe", "midnight"), apply_to = c("all", "new"), dry_run = FALSE, fallback_extra = c("auto", "always", "never"), force_replace = TRUE, method = c("format", "vendor"), readme = FALSE )
path |
Path to the package directory. Must be supplied explicitly; there is no default so that the function never writes to an unexpected location. |
family |
One of |
preset |
Direction, |
apply_to |
|
dry_run |
if TRUE, report the changes (including |
fallback_extra |
With |
force_replace |
|
method |
|
readme |
If |
With method = "format" (the default) each vignettes/*.Rmd whose first
output format is html_vignette is switched to albers_vignette(), and
_pkgdown.yml is pointed at the albersdown template (it is created, and
added to .Rbuildignore with docs/, if missing). DESCRIPTION gains
bbuchsbaum/albersdown in Config/Needs/website. When at least one
vignette is on the format, it also gains albersdown (>= <installed version>) in Suggests (or that bound where albersdown is already in
Imports/Depends), knitr and rmarkdown, and VignetteBuilder: knitr;
and, when the installed albersdown is a development version (not on CRAN),
Remotes: bbuchsbaum/albersdown, so that R CMD check and CI install the
version with albers_vignette() (R CMD check --as-cran notes that
field). Otherwise (no vignettes, none convertible, or apply_to = "new"
with none already on the format) the adoption is site-only and no field that
R CMD check reads is changed. Nothing is copied into
vignettes/. Edits are textual (other output formats, comments, key order
and line endings are kept) and each changed file is backed up to
.albersdown.bak/, which is added to .Rbuildignore and .gitignore.
A package set up by albersdown 2.0 (the vendor setup) is migrated: the
setup-chunk lines and params (family, preset) that 2.0 added are
removed, as are its generated pkgdown/extra.css (an @import of the
theme) and pkgdown/extra.js, and its README note is rewritten. The copied
albers.css, albers.js, albers-header.html and fonts in vignettes/ are
moved to .albersdown.bak/ once no remaining vignette uses them.
Quarto vignettes, flow-style output: {...} headers and pkgdown-only
articles in vignettes/articles/ are listed but not changed: articles take the site default family unless you
set output: albersdown::albers_vignette in their YAML by hand.
With method = "vendor" the stylesheet, script and fonts are copied into
vignettes/ and each vignette keeps rmarkdown::html_vignette with the
theme's css and header include (the albersdown 2.0 setup).
TRUE invisibly.
if (interactive()) { use_albersdown(path = ".", dry_run = TRUE) }if (interactive()) { use_albersdown(path = ".", dry_run = TRUE) }