Title: | Utilities for Creating and Standardising Hubverse Packages |
---|---|
Description: | What the package does (one paragraph). |
Authors: | Anna Krystalli [aut, cre] , Zhian N. Kamvar [aut] |
Maintainer: | Anna Krystalli <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2025-01-10 18:30:57 UTC |
Source: | https://github.com/hubverse-org/hubDevs |
Adds the hubverve hubStyle package as a website need to the DESCRIPTION file.
add_website_needs()
add_website_needs()
Create hubverse package skeleton
create_hubdev_pkg( path, fields = list(), copyright_holder = "Consortium of Infectious Disease Modeling Hubs", organisation = "hubverse-org", hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html" )
create_hubdev_pkg( path, fields = list(), copyright_holder = "Consortium of Infectious Disease Modeling Hubs", organisation = "hubverse-org", hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html" )
path |
A path. If it exists, it is used. If it does not exist, it is created, provided that the parent path exists. |
fields |
A named list of fields to add to |
copyright_holder |
Name of the copyright holder or holders. This
defaults to |
organisation |
Character string. The hubverse GitHub organisation name. The user's role and the token's scopes must be such that you have permission to create repositories in the hubverse organisation. |
hubdocs_contribute_url |
Character string. URL of the general contributing information page on hubDocs. |
Path to the newly created project or package, invisibly.
These functions create community facing documents detailing how contributors
and the wider community can interact with hubverse packages.
Each function creates the relevant file in the .github
directory from templates
and is set up with appropriate hubverse default values.
use_hubdev_community( organisation = "hubverse-org", hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html" ) use_hubdev_coc() use_hubdev_contributing( organisation = "hubverse-org", hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html" )
use_hubdev_community( organisation = "hubverse-org", hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html" ) use_hubdev_coc() use_hubdev_contributing( organisation = "hubverse-org", hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html" )
organisation |
Character string. The hubverse GitHub organisation name. The user's role and the token's scopes must be such that you have permission to create repositories in the hubverse organisation. |
hubdocs_contribute_url |
Character string. URL of the general contributing information page on hubDocs. |
use_hubdev_community()
: Create hubverse CODE_OF_CONDUCT.md
and CONTRIBUTING.md
files.
use_hubdev_coc()
: Create hubverse CODE_OF_CONDUCT.md
file.
use_hubdev_contributing()
: Create hubverse CONTRIBUTING.md
file.
The function runs a number of internal utilities for setting up a hubverse package on GitHub:
Creates a repo in the hubverse GitHub organisation
Adds details of the repository to the DESCRIPTION file
Initailises pkgdown documentation
Creates GitHub Action workflows for:
standard R CMD CHECK
test coverage
linting with lintr
building pkgdown documentation and deploying production docs to GitHub Pages and PR previews to a Netlify site
use_hubdev_github(organisation = "hubverse-org")
use_hubdev_github(organisation = "hubverse-org")
organisation |
Character string. The hubverse GitHub organisation name. The user's role and the token's scopes must be such that you have permission to create repositories in the hubverse organisation. |
Sets up common hubverse developer continuous integration (CI) workflows for hubverse packages hosted on GitHub using GitHub Actions. Available actions are hosted in repository hubverse-org/hubverse-developer-actions
use_hubdev_github_action(name)
use_hubdev_github_action(name)
name |
Name of workflow, i.e. the name of one of the
hubverse developer action repository
directories containing a GitHub Action workflow |
Create a basic hubverse .lintr file from template
use_hubdev_lintr()
use_hubdev_lintr()
Downloads standard r-lib GitHub Action workflows and writes them to the
.github/workflows
directory for:
standard R CMD CHECK (check-standard
)
test coverage (test-coverage
)
linting with lintr
(lint
)
use_hubdev_pkg_actions()
use_hubdev_pkg_actions()
The function performs a number of actions to configure a hubverse package's
pkgdown site to use the hubStyle
template for docs styling.
Runs use_pkgdown()
to initialise pkgdown documentation.
Runs use_github_pages()
to initialise GitHub Pages for the package.
Adds a GitHub Action workflow for building pkgdown documentation and deploying
to GitHub Pages (productions) and Netlify (PR previews) using
use_hubdev_pkgdown_action()
.
Adds the hubStyle
repository to the DESCRIPTION
's
Config/Needs/website
property using add_website_needs()
.
Creates a favicon for the package using the hubStyle
logo.
Overwrites standard _pkgdown.yml
file with customised configuration to
use the hubverse hubStyle
package for docs styling.
use_hubdev_pkgdown(add_logo = FALSE)
use_hubdev_pkgdown(add_logo = FALSE)
add_logo |
Logical. Whether to add the logo to the package. |
The functions creates a pkgdown-netlify-preview.yaml
action in the .github/workflows
directory. The action follows the standard pkgdown publishing to gh-pages
in the
event of a merge into main
branch but can also be set up to publish internal
PR previews to Netlify.
use_hubdev_pkgdown_action(remove_std = TRUE)
use_hubdev_pkgdown_action(remove_std = TRUE)
remove_std |
Logical. Whether to remove the standard pkgdown action if it exists. |
To activate Netlify Previews, you must:
Create a new site on Netlify. See https://docs.netlify.com/welcome/add-new-site/ for more details.
"Add the netlify API site ID to the GitHub repository Action secrets as
NETLIFY_SITE_ID
. See https://docs.netlify.com/api/get-started/#get-site for more details.
Get developer token from Netlify developer account settings and add it to
GitHub repository Action secrets as NETLIFY_AUTH_TOKEN
. See
https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui
for more details.
See pkgdown docs section on PR previews for more details.
Create a basic hubverse README.Rmd from template
use_hubdev_readme( organisation = "hubverse-org", hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html" )
use_hubdev_readme( organisation = "hubverse-org", hubdocs_contribute_url = "https://hubverse.io/en/latest/overview/contribute.html" )
organisation |
Character string. The hubverse GitHub organisation name. The user's role and the token's scopes must be such that you have permission to create repositories in the hubverse organisation. |
hubdocs_contribute_url |
Character string. URL of the general contributing information page on hubDocs. |