| Title: | 'pkgdown' Template for 'rOpenGov' Package Sites |
|---|---|
| Description: | A private pkgdown template for core rOpenGov packages. It provides site setup helpers, package asset helpers and rOpenGov color palettes. Please do not use it for your own code. |
| Authors: | Diego Hernangómez [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-8457-4658>), Steph Buongiorno [ctb] (ORCID: <https://orcid.org/0000-0002-6965-0787>) |
| Maintainer: | Diego Hernangómez <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.2.9100 |
| Built: | 2026-10-12 23:11:51 UTC |
| Source: | https://github.com/rOpenGov/rogtemplate |
Create a GitHub Action workflow that builds a pkgdown site from
your package and deploys it to the gh-pages branch.
rog_actions_pkgdown_branch(pkg = ".", overwrite = TRUE)rog_actions_pkgdown_branch(pkg = ".", overwrite = TRUE)
pkg |
Path to the package. |
overwrite |
Whether to overwrite the workflow if it already exists. |
This function is called for its side effects and returns
NULL invisibly.
usethis's usethis::use_github_action() for creating
workflows from other templates.
Site setup helpers:
rog_add_template_pkgdown(),
rog_build()
Add the rOpenGov template configuration to your _pkgdown.yml. If no
configuration file exists, create one at pkgdown/_pkgdown.yml. Also add the
corresponding paths to .Rbuildignore.
rog_add_template_pkgdown()rog_add_template_pkgdown()
This function also adds the package website URL
(https://ropengov.github.io/pkgname/) and repository URL
(https://github.com/rOpenGov/pkgname) to _pkgdown.yml and DESCRIPTION if
they are not already present.
This function is called for its side effects and returns
NULL invisibly.
The pkgdown vignettes
vignette("pkgdown", package = "pkgdown") and
vignette("linking", package = "pkgdown"). See also
usethis's usethis::use_tidy_description().
Site setup helpers:
rog_actions_pkgdown_branch(),
rog_build()
## Not run: rog_add_template_pkgdown() ## End(Not run)## Not run: rog_add_template_pkgdown() ## End(Not run)
Add an rOpenGov badge pointing to https://ropengov.org/ to your README:
rog_badge_ropengov(install = TRUE)rog_badge_ropengov(install = TRUE)
install |
Whether to install the badge in |
This function is called for its side effects. If install = TRUE,
it invisibly returns a logical value indicating whether
the README changed. Otherwise, it returns NULL invisibly.
usethis's usethis::use_badge().
Package asset helpers:
rog_load_font(),
rog_logo()
rog_badge_ropengov(install = FALSE)rog_badge_ropengov(install = FALSE)
A wrapper around pkgdown's pkgdown::build_site().
rog_build(pkg = ".", ...)rog_build(pkg = ".", ...)
pkg |
Path to the package. |
... |
Arguments passed on to
|
This function also calls rog_add_template_pkgdown() and rog_logo().
This function is called for its side effects and returns
NULL invisibly.
rog_logo() for logo and favicon options, and
pkgdown's pkgdown::build_site() for site build options.
Site setup helpers:
rog_actions_pkgdown_branch(),
rog_add_template_pkgdown()
Load the current rOpenGov font, B612 Mono.
rog_load_font()rog_load_font()
A character string containing the font family
name, "B612 Mono".
sysfonts's sysfonts::font_add() for registering fonts
and showtext's showtext::showtext_auto() for rendering them
in plots.
Package asset helpers:
rog_badge_ropengov(),
rog_logo()
rog_load_font()rog_load_font()
Create a logo automatically with hexSticker's
hexSticker::sticker(). Optionally, create favicons with
pkgdown's pkgdown::build_favicons().
rog_logo( pkgname, filename = "man/figures/logo.png", p_x = 1, p_y = 1, p_size = 202.6 * nchar(pkgname)^-1.008, overwrite = FALSE, favicons = TRUE )rog_logo( pkgname, filename = "man/figures/logo.png", p_x = 1, p_y = 1, p_size = 202.6 * nchar(pkgname)^-1.008, overwrite = FALSE, favicons = TRUE )
pkgname |
Name of the package. If not supplied, the name is detected from DESCRIPTION. |
filename |
filename to save sticker |
p_x |
x position for package name |
p_y |
y position for package name |
p_size |
font size for package name |
overwrite |
Whether to overwrite the current logo. If |
favicons |
Whether to create favicons with pkgdown's
|
This function is called for its side effects and returns
NULL invisibly.
rog_build() to create the logo as part of a local site build.
hexSticker's hexSticker::sticker(),
usethis's usethis::use_logo() and pkgdown's
pkgdown::build_favicons().
Package asset helpers:
rog_badge_ropengov(),
rog_load_font()
tmp <- tempfile(fileext = ".png") rog_logo("test a package", tmp, overwrite = FALSE, favicons = FALSE) # Display the logo. logo <- magick::image_read(tmp) logo plot(logo)tmp <- tempfile(fileext = ".png") rog_logo("test a package", tmp, overwrite = FALSE, favicons = FALSE) # Display the logo. logo <- magick::image_read(tmp) logo plot(logo)
Color palettes based on the rOpenGov color scheme.
rog_orange_pal(n = 4, alpha = 0.9, rev = FALSE) rog_dark_pal(n = 4, alpha = 0.9, rev = FALSE) rog_gradient_pal(n = 4, alpha = 0.9, rev = FALSE) rog_qualitative_pal(n = 6, alpha = 0.9, rev = FALSE)rog_orange_pal(n = 4, alpha = 0.9, rev = FALSE) rog_dark_pal(n = 4, alpha = 0.9, rev = FALSE) rog_gradient_pal(n = 4, alpha = 0.9, rev = FALSE) rog_qualitative_pal(n = 6, alpha = 0.9, rev = FALSE)
n |
Number of colors to generate. |
alpha |
Alpha transparency for the generated colors. Use |
rev |
Whether to reverse the palette order. |
A character vector of colors.
grDevices's grDevices::hcl.colors() for other color
palettes and scales's scales::show_col() to preview colors.
scales::show_col(rog_orange_pal(9)) scales::show_col(rog_dark_pal(9)) scales::show_col(rog_gradient_pal(9)) scales::show_col(rog_qualitative_pal(9))scales::show_col(rog_orange_pal(9)) scales::show_col(rog_dark_pal(9)) scales::show_col(rog_gradient_pal(9)) scales::show_col(rog_qualitative_pal(9))