Package 'rogtemplate'

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

Help Index


Deploy a pkgdown site with GitHub Actions

Description

Create a GitHub Action workflow that builds a pkgdown site from your package and deploys it to the gh-pages branch.

Usage

rog_actions_pkgdown_branch(pkg = ".", overwrite = TRUE)

Arguments

pkg

Path to the package.

overwrite

Whether to overwrite the workflow if it already exists.

Value

This function is called for its side effects and returns NULL invisibly.

See Also

usethis's usethis::use_github_action() for creating workflows from other templates.

Site setup helpers: rog_add_template_pkgdown(), rog_build()


Configure a pkgdown site with rogtemplate

Description

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.

Usage

rog_add_template_pkgdown()

Details

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.

Value

This function is called for its side effects and returns NULL invisibly.

See Also

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()

Examples

## Not run: 
rog_add_template_pkgdown()

## End(Not run)

Add an rOpenGov badge to your README

Description

Add an rOpenGov badge pointing to https://ropengov.org/ to your README:

Usage

rog_badge_ropengov(install = TRUE)

Arguments

install

Whether to install the badge in README.md or README.Rmd. If FALSE, display the Markdown code instead.

Details


options: alt='rOpenGov'

Value

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.

See Also

usethis's usethis::use_badge().

Package asset helpers: rog_load_font(), rog_logo()

Examples

rog_badge_ropengov(install = FALSE)

Build your pkgdown site locally

Description

A wrapper around pkgdown's pkgdown::build_site().

Usage

rog_build(pkg = ".", ...)

Arguments

pkg

Path to the package.

...

Arguments passed on to rog_logo, pkgdown::build_site

overwrite

Whether to overwrite the current logo. If FALSE and filename already exists, save the new logo to a temporary file instead.

favicons

Whether to create favicons with pkgdown's pkgdown::build_favicons() when filename is "man/figures/logo.png".

p_x

x position for package name

p_y

y position for package name

p_size

font size for package name

examples

Run examples?

preview

If TRUE, or is.na(preview) && interactive(), will preview freshly generated section in browser.

new_process

If TRUE, will run build_site() in a separate process. This enhances reproducibility by ensuring nothing that you have loaded in the current process affects the build process.

install

If TRUE, will install the package in a temporary library so it is available for vignettes.

Details

This function also calls rog_add_template_pkgdown() and rog_logo().

Value

This function is called for its side effects and returns NULL invisibly.

See Also

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 rogtemplate font

Description

Load the current rOpenGov font, B612 Mono.

Usage

rog_load_font()

Value

A character string containing the font family name, "B612 Mono".

See Also

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()

Examples

rog_load_font()

rOpenGov color palettes

Description

Color palettes based on the rOpenGov color scheme.

Usage

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)

Arguments

n

Number of colors to generate.

alpha

Alpha transparency for the generated colors. Use 1 for fully opaque colors.

rev

Whether to reverse the palette order.

Value

A character vector of colors.

See Also

grDevices's grDevices::hcl.colors() for other color palettes and scales's scales::show_col() to preview colors.

Examples

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))