add_github_url_to_desc | R Documentation |
github
URL to File ‘DESCRIPTION’When writing packages, I often forget to add the appropriate github
URL.
add_github_url_to_desc(path = ".", default_gh_user = NULL, normalize = TRUE)
path |
Path to the package directory (see
|
default_gh_user |
See details. |
normalize |
Passed to
|
The URL is constructed by the package's name as read from it's file
‘DESCRIPTION’, and the username returned by
whoami::gh_username
.
whoami::gh_username
allows for a fallback,
this is given by default_gh_user
.
You can specify default_gh_user = NA
, to try to retrieve the username
by searching remotes on github
if the
package is a git repository. We do not use
gert::git_signature_default
since there's no way to make sure
the configured git user name, locally or globally, is a github
username.
Invisibly TRUE
if
adding a github
URL, FALSE
otherwise.
path <- file.path(tempdir(), "myPackage")
usethis::create_package(path, open = FALSE)
add_github_url_to_desc(path)
grep("^URL:", readLines(file.path(path, "DESCRIPTION")), value = TRUE)
unlink(path, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.