Title: | Collection of templates for R |
---|---|
Description: | Apply variouse R related templates. |
Authors: | Jimmy Briggs [aut, cre] |
Maintainer: | Jimmy Briggs <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2025-03-04 05:03:08 UTC |
Source: | https://github.com/jimbrig/templateeR |
A set of helper functions for providing verbose feedback to the developer using this packages functions.
msg_field(x) msg_value(x) msg_done(x) msg_bullet(x, bullet = cli::symbol$bullet) msg_err(x) msg_path(x) msg_info(x) msg_code(x) msg_feedback(x)
msg_field(x) msg_value(x) msg_done(x) msg_bullet(x, bullet = cli::symbol$bullet) msg_err(x) msg_path(x) msg_info(x) msg_code(x) msg_feedback(x)
x |
The string passed to various |
bullet |
What to use for the message's |
Other Feedback Utilities:
indent()
,
inform()
This data.frame
houses my default repository issue labels applied to R projects
via usethis::use_github_labels()
.
gh_labels
gh_labels
A data frame with 9 rows and 3 variables:
label
character. Label names.
description
character. Label descriptions.
colour
character. Label colors represented in hexadecimal format.
use_gh_labels()
, usethis::use_github_labels()
.
Indentation around various msg_
feedback functions.
indent(x, first = " ", indent = first)
indent(x, first = " ", indent = first)
x |
The string passed to various |
first |
what to indent with - defaults to |
indent |
indentation of next line - defaults to |
string
Other Feedback Utilities:
feedback
,
inform()
A wrapper around rlang::inform()
for providing feedback to developers using
this packages functions.
inform(...)
inform(...)
... |
Passed to |
feedback in console
Other Feedback Utilities:
feedback
,
indent()
This function is a modification of usethis::use_template()
that applies user
supplied data fields to a given template file via whisker::whisker.render()
.
render_template(template_path, out_path, data = list(), open = TRUE)
render_template(template_path, out_path, data = list(), open = TRUE)
template_path |
Path to the template file |
out_path |
Path to desired output location |
data |
list of fields to pass to the template file |
open |
logical - should the file be opened? |
Invisible
## Not run: render_template(system.file("templates/pkgdevt-script", package = "templateeR"), ".", data = list(package_name = "testPackage"), open = TRUE) ## End(Not run)
## Not run: render_template(system.file("templates/pkgdevt-script", package = "templateeR"), ".", data = list(package_name = "testPackage"), open = TRUE) ## End(Not run)
use_gh_labels()
leverages usethis::use_github_labels()
to allow users to
create, edit, delete, and manage your repository's GitHub issue labels. It can
update colors and descriptions of current labels and optionally
delete GitHub's default labels.
The main difference between this function and usethis::use_github_labels()
is its usage of a labels.yml
configuration file. By default this file should
be places under .github/labels.yml
of your repository.
use_gh_labels( path = NULL, labels = NULL, descriptions = NULL, colors = NULL, ... )
use_gh_labels( path = NULL, labels = NULL, descriptions = NULL, colors = NULL, ... )
path |
(Optional) Path to a |
labels , descriptions , colors
|
|
... |
Passed to |
invisibly returns list of labels.
Default labels will be removed if argument remove_default
is kept as TRUE
.
It will not delete any issue labels currently assigned to an issue, however.
usethis::use_github_labels()
, gh::gh()
.
## Not run: # if no input, will apply default templateeR::gh_labels labels: use_gh_labels() # or can provide path to a `labels.yml` config file: yml_path <- system.file("config/labels.yml", package = "templateeR") use_gh_labels(path = yml_path) # or can use `usethis::use_github_labels()` arguments: use_gh_labels( labels = c("foofy", "foofier", "foofiest"), colours = NULL, descriptions = NULL ) ## End(Not run)
## Not run: # if no input, will apply default templateeR::gh_labels labels: use_gh_labels() # or can provide path to a `labels.yml` config file: yml_path <- system.file("config/labels.yml", package = "templateeR") use_gh_labels(path = yml_path) # or can use `usethis::use_github_labels()` arguments: use_gh_labels( labels = c("foofy", "foofier", "foofiest"), colours = NULL, descriptions = NULL ) ## End(Not run)
git-cliff
git-cliff
is a useful tool for automating the generation of repository
CHANGELOGs and following good practices with git by using the
conventional commits methodology.
This function implements git-cliff
into your repo by adding a cliff.toml
default configuration file and then running git-cliff
to output a CHANGELOG.md
file based off the repo's git history.
use_git_cliff(path = "CHANGELOG.md", config = "cliff.toml")
use_git_cliff(path = "CHANGELOG.md", config = "cliff.toml")
path |
Path to output generated CHANGELOG.md file. |
config |
Path to |
Nothing; used for its side-effects.
## Not run: use_git_cliff() ## End(Not run)
## Not run: use_git_cliff() ## End(Not run)
git-cliff
GitHub Action WorkflowAdds a github action to auto-generate a CHANGELOG.md
using GitHub actions and
git-cliff
.
use_git_cliff_action(save_as = "git-cliff.yml", open = FALSE)
use_git_cliff_action(save_as = "git-cliff.yml", open = FALSE)
save_as |
File name to save as; defaults to |
open |
Logical - should the file be opened? |
Invisible
## Not run: use_git_cliff_action() ## End(Not run)
## Not run: use_git_cliff_action() ## End(Not run)
pkgdevt.R
scriptThis function adds a script to inst/scripts/pkgdevt.R
to keep track of the
various steps applied setting up your R package.
use_pkgdevt_script( package_name = basename(getwd()), package_author = Sys.getenv("FULLNAME", ""), package_description = "My awesome description.", package_title = "My awesome title", github_private_repo = FALSE, ... )
use_pkgdevt_script( package_name = basename(getwd()), package_author = Sys.getenv("FULLNAME", ""), package_description = "My awesome description.", package_title = "My awesome title", github_private_repo = FALSE, ... )
package_name |
Name of your package |
package_author |
Author |
package_description |
Description |
package_title |
Title |
github_private_repo |
Logical |
... |
if necessary |
For details see this package's pkgdevt.R
script by running:
file.edit(fs::path_package("templateeR", "scripts/pkgdevt.R"))
.
Invisible
https://github.com/jimbrig/templateeR/blob/main/inst/scripts/pkgdevt.R
## Not run: use_pkgdevt_script("testPackage", package_description = "My awesome description.", package_title = "package title", github_private_repo = FALSE) ## End(Not run)
## Not run: use_pkgdevt_script("testPackage", package_description = "My awesome description.", package_title = "package title", github_private_repo = FALSE) ## End(Not run)