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:39:14 UTC |
Source: | https://github.com/rOpenGov/rogtemplate |
gh-pages
branchThe GitHub action created would build a pkgdown
of
your package in the gh-pages
branch of your repo.
rog_actions_pkgdown_branch(pkg = ".", overwrite = TRUE)
rog_actions_pkgdown_branch(pkg = ".", overwrite = TRUE)
pkg |
Path to package. |
overwrite |
Overwrite the action if it was already present. |
rogtemplate
for your pkgdown siteAdd 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.
rog_add_template_pkgdown()
rog_add_template_pkgdown()
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
vignette("pkgdown", package = "pkgdown")
,
vignette("linking", package = "pkgdown")
,
usethis::use_tidy_description()
.
Other extras:
rog_badge_ropengov()
,
rog_load_font()
,
rog_logo()
,
rog_pals
## Not run: rog_add_template_pkgdown() ## End(Not run)
## Not run: rog_add_template_pkgdown() ## End(Not run)
README
fileAdd an rOpenGov badge pointing to https://ropengov.org/ on your README
file:
rog_badge_ropengov(install = TRUE)
rog_badge_ropengov(install = TRUE)
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. |
A markdown badge or a message with the markdown code to be pasted.
Other extras:
rog_add_template_pkgdown()
,
rog_load_font()
,
rog_logo()
,
rog_pals
rog_badge_ropengov(install = FALSE)
rog_badge_ropengov(install = FALSE)
A wrapper of pkgdown::build_site()
rog_build(pkg = ".", ...)
rog_build(pkg = ".", ...)
pkg |
Path to package. |
... |
Arguments passed on to
|
This function would call also rog_add_template_pkgdown()
and
rog_logo()
.
pkgdown::build_site()
, rog_add_template_pkgdown()
.
Load the current font in use for rOpenGov, B612 Mono
rog_load_font()
rog_load_font()
Other extras:
rog_add_template_pkgdown()
,
rog_badge_ropengov()
,
rog_logo()
,
rog_pals
rog_load_font()
rog_load_font()
Creates a logo automatically with hexSticker::sticker()
.
Optionally, create also favicons with 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 present it would be autodetected by the function. |
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 |
Should the current logo be overwritten? When |
favicons |
Logical, do you want to create favicons with
|
hexSticker::sticker()
, usethis::use_logo()
,
pkgdown::build_favicons()
.
Other extras:
rog_add_template_pkgdown()
,
rog_badge_ropengov()
,
rog_load_font()
,
rog_pals
tmp <- tempfile(fileext = ".png") rog_logo("test a package", tmp, overwrite = FALSE, favicons = FALSE) # Display logo <- magick::image_read(tmp) logo plot(logo)
tmp <- tempfile(fileext = ".png") rog_logo("test a package", tmp, overwrite = FALSE, favicons = FALSE) # Display logo <- magick::image_read(tmp) logo plot(logo)
Color palettes based on the color scheme of rOpenGov
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 |
the number of colors ( |
alpha |
an alpha-transparency level in the range [0,1]
(0 means transparent and 1 means opaque), see argument
|
rev |
logical indicating whether the ordering of the colors should be reversed. |
Color palettes
Other extras:
rog_add_template_pkgdown()
,
rog_badge_ropengov()
,
rog_load_font()
,
rog_logo()
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))