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-07-17 11:15:43 UTC
Source: https://github.com/rOpenGov/rogtemplate

Help Index


Create a GitHub Action that deploys a pkgdown site

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 package.

overwrite

Overwrite the workflow if it already exists.

Value

The function is called for its side effects and returns invisible(NULL).

See Also

rog_build().

site setup helpers: rog_add_template_pkgdown(), rog_build()


Configure rogtemplate for your pkgdown site

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

The function also adds these package URLs to ⁠_pkgdown.yml⁠ and DESCRIPTION if they are not already present:

  • https://ropengov.github.io/pkgname/

  • https://github.com/ropengov/pkgname

Value

The function is called for its side effects and returns invisible(NULL).

See Also

pkgdown vignettes: vignette("pkgdown", package = "pkgdown") and vignette("linking", package = "pkgdown"), 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

TRUE or FALSE. If TRUE, the badge is installed on your README.md or README.Rmd. If FALSE, a message with the R Markdown code is displayed.

Details


options: alt='rOpenGov'

Value

The function is called for its side effects and 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 package.

...

Arguments passed to rog_logo() and pkgdown's pkgdown::build_site(). Common arguments for rog_logo() include overwrite, favicons, p_x, p_y and p_size.

Details

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

Value

The function is called for its side effects and returns invisible(NULL).

See Also

pkgdown's pkgdown::build_site() and rog_add_template_pkgdown().

site setup helpers: rog_actions_pkgdown_branch(), rog_add_template_pkgdown()


Load rogtemplate fonts

Description

Load the current rOpenGov font, B612 Mono.

Usage

rog_load_font()

Value

The font family name, "B612 Mono".

See Also

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

the number of colors (1\ge 1) to be in the palette.

alpha

an alpha-transparency level in the range [0,1] (0 means transparent and 1 means opaque), see argument alpha in hsv and hcl, respectively.
A missing, i.e., not explicitly specified alpha is equivalent to alpha = NULL, which does not add opacity codes ("FF") to the individual color hex codes.

rev

logical indicating whether the ordering of the colors should be reversed.

Value

Color palettes.

See Also

grDevices' grDevices::hcl.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))