|
| 1 | +--- |
| 2 | +output: |
| 3 | + md_document: |
| 4 | + variant: gfm |
| 5 | +--- |
| 6 | + |
| 7 | +<!-- README.md is generated from README.Rmd. Please edit that file --> |
| 8 | + |
| 9 | +# pkgdown template <img src="man/figures/logo.png" align="right" style="padding: 10px"/> |
| 10 | + |
| 11 | +This is a template for a NMFS branded GitHub repository, R package, and pkgdown website. It will have a NMFS palette, appropriate license and disclaimer, and a NMFS footer with logo. |
| 12 | + |
| 13 | +The instructions will use the **usethis** and **pkgdown** packages. So install those. |
| 14 | + |
| 15 | +## Step 1 Make sure the package builds |
| 16 | + |
| 17 | +1. Clone this GitHub repository and then open the new repository (on your computer). |
| 18 | +2. Set-up your RStudio project to use Roxygen for documentation and NAMESPACE |
| 19 | + * Tools > Project Options... > Build Tools Click the checkbox that says "Build documentation with Roxygen". |
| 20 | + * The Configure popup box for Roxygen will probably appear, if not click the Configure button. Check all the checkboxes. |
| 21 | +3. On the Build tab, click Install and Restart to make sure it builds. |
| 22 | +4. On the Build tab, click Check to make sure it passes all the checks. |
| 23 | +5. Type the code `pkgdown::build_site()` and make sure the **pkgdown** building works. |
| 24 | + |
| 25 | +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 editted the package yet, it will build and pass check. |
| 26 | + |
| 27 | +## Step 2 Customize your package |
| 28 | + |
| 29 | +1. Edit the DESCRIPTION file (change Title, Description, urls for repo, Authors) |
| 30 | +2. Add any required packages to Depends (or Imports* or Suggests*). |
| 31 | +3. Edit the Readme.Rmd file. |
| 32 | +4. Add your functions to the R folder. There are some template functions there already. |
| 33 | +5. Don't touch the man folder. Roxygen2 will make your Rd files. |
| 34 | + |
| 35 | +## Step 3 Make some vignettes (optional) |
| 36 | + |
| 37 | +Vignettes are longform examples and are Rmd files in the `vignettes` folder. Easiest way to start a new vignette is `usethis::use_vignette("vignettename")`. |
| 38 | + |
| 39 | +## Step 4 Customize your **pkgdown** site and build |
| 40 | + |
| 41 | +pkgdown::build_favicon |
| 42 | + |
| 43 | +<!-- Do not edit below. This adds the Disclaimer and NMFS footer. --> |
| 44 | + |
| 45 | +**** |
| 46 | + |
| 47 | +```{r add-disclaimer, echo=FALSE, results='asis'} |
| 48 | +url <- "https://raw.githubusercontent.com/nmfs-fish-tools/Resources/master/Disclaimer.md" |
| 49 | +childtext <- readLines(url) |
| 50 | +cat(childtext, sep="\n") |
| 51 | +``` |
| 52 | + |
| 53 | +**** |
| 54 | + |
| 55 | +```{r footer, echo=FALSE, results='asis'} |
| 56 | +url <- "https://raw.githubusercontent.com/nmfs-fish-tools/Resources/master/footer.md" |
| 57 | +childtext <- readLines(url) |
| 58 | +cat(childtext, sep="\n") |
| 59 | +``` |
| 60 | + |
| 61 | + |
0 commit comments