Package 'rogtemplate'

Title: 'pkgdown' Template for 'rOpenGov' Packages
Description: This is a private template for use by core rOpenGov packages. Please don’t use for your own code.
Authors: Diego Hernangómez [aut, cre, cph] , Steph Buongiorno [ctb]
Maintainer: Diego Hernangómez <[email protected]>
License: MIT + file LICENSE
Version: 0.0.2.9100
Built: 2024-11-20 15:23:32 UTC
Source: https://github.com/rOpenGov/rogtemplate

Help Index


Creates a GitHub action that deploys on gh-pages branch

Description

The GitHub action created would build a pkgdown of your package in the gh-pages branch of your repo.

Usage

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

Arguments

pkg

Path to package.

overwrite

Overwrite the action if it was already present.

See Also

rog_build()


Configure rogtemplate for your pkgdown site

Description

Add the corresponding configuration to your ⁠_pkgdown.yml⁠. If it is not present, it would create a file on ⁠pkgdown/_pkgdown.yml⁠. It would also add the corresponding lines to your .Rbuildignore.

Usage

rog_add_template_pkgdown()

Details

It also adds the corresponding urls to the ⁠_pkgdown.yml⁠ file and the DESCRIPTION file if not present:

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

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

See Also

vignette("pkgdown", package = "pkgdown"), vignette("linking", package = "pkgdown"), usethis::use_tidy_description().

Other extras: rog_badge_ropengov(), rog_load_font(), rog_logo(), rog_pals

Examples

## Not run: 
rog_add_template_pkgdown()

## End(Not run)

Add a rOpenGov badge to your README file

Description

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

rOpenGov

Usage

rog_badge_ropengov(install = TRUE)

Arguments

install

TRUE/FALSE. On TRUE the badge would be installed on your README.md/.Rmd. On FALSE a message with the Rmarkdown code would be displayed.

Value

A markdown badge or a message with the markdown code to be pasted.

See Also

usethis::use_badge()

Other extras: rog_add_template_pkgdown(), rog_load_font(), rog_logo(), rog_pals

Examples

rog_badge_ropengov(install = FALSE)

Build your pkgdown website locally

Description

A wrapper of pkgdown::build_site()

Usage

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

Arguments

pkg

Path to package.

...

Arguments passed on to rog_logo, pkgdown::build_site

overwrite

Should the current logo be overwritten? When TRUE it would run usethis::use_logo().

favicons

Logical, do you want to create favicons with pkgdown::build_favicons()?

p_x

x position for package name

p_y

y position for package name

p_size

font size for package name

examples

Run examples?

run_dont_run

Run examples that are surrounded in \dontrun?

seed

Seed used to initialize random number generation in order to make article output reproducible. An integer scalar or NULL for no seed.

lazy

If TRUE, will only rebuild articles and reference pages if the source is newer than the destination.

preview

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

devel

Use development or deployment process?

If TRUE, uses lighter-weight process suitable for rapid iteration; it will run examples and vignettes in the current process, and will load code with pkgload::load_all().

If FALSE, will first install the package to a temporary library, and will run all examples and vignettes in a new process.

build_site() defaults to devel = FALSE so that you get high fidelity outputs when you building the complete site; build_reference(), build_home() and friends default to devel = TRUE so that you can rapidly iterate during development.

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 would call also rog_add_template_pkgdown() and rog_logo().

See Also

pkgdown::build_site(), rog_add_template_pkgdown().


Load rogtemplate fonts

Description

Load the current font in use for rOpenGov, B612 Mono

Usage

rog_load_font()

See Also

Other extras: rog_add_template_pkgdown(), rog_badge_ropengov(), rog_logo(), rog_pals

Examples

rog_load_font()

rOpenGov color palettes

Description

Color palettes based on the color scheme of rOpenGov

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::hcl.colors()

Other extras: rog_add_template_pkgdown(), rog_badge_ropengov(), rog_load_font(), rog_logo()

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