This is a template for a NMFS branded R package and pkgdown website. It will have a NMFS palette, appropriate license and disclaimer, and a NMFS footer with logo.
The instructions will use the usethis and pkgdown packages. So install those.
pkgdown::build_site()
and make sure the pkgdown building works. If on RStudio Cloud, you will need to use pkgdown::build_site(override = list(destination = "~/docs"))
to see the webpage.Note steps 3 and 4 are to make sure your computer is set up to build and check packages. As long as you haven’t edited the package yet, it will build and pass check.
Vignettes are longform examples and are Rmd files in the vignettes
folder. Easiest way to start a new vignette is usethis::use_vignette("vignettename")
.
_pkgdown.yml
in the pkddown
folder to change the look of the upper navbar. There are endless options. Find examples from other peoples’ pkgdown sites.man/figures
. After updating run pkgdown::build_favicon()
to remake the favicons.docs
folder as needed. See the example for the References tab in the _pkgdown.yml
.pkgdown::build_site()
.docs
. There are other ways to set up GitHub Pages but this will get you started.This template has the following branding elements.
extra.css
in the pkgdown
folder sources the nmfspalette css. This get you the colors.Readme.Rmd
file sources the NMFS Disclaimer and footer with NMFS logo from the FIT Resources.In the .github
folder is just one action, to run R CMD check on the package.
pkgdown uses Readme.md
but to pull in the Disclaimer and footer from FIT, you need a Rmd file. When you update the Readme.Rmd
file, you need to remember to knit the file to update Readme.md
.
The United States Department of Commerce (DOC) GitHub project code is provided on an ‘as is’ basis and the user assumes responsibility for its use. DOC has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any claims against the Department of Commerce stemming from the use of its GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.”
U.S. Department of Commerce | National Oceanographic and Atmospheric Administration | NOAA Fisheries