knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Create a pkgdown site inside your package

Create the pkgdown

Use build_pkgdown with default option to build the {pkgdown} site and copy it in "inst" so that it is available in your package.

papillon::build_pkgdown(
  move = TRUE, clean_before = TRUE
)

Help user find the site

Function open_pkgdown_function() adds function open_pkgdown() inside your package that will open the userguide on demand.

papillon::open_pkgdown_function()

Users of your package (pkg) can now have access to the site using:

pkg::open_pkgdown()

Add these in your documentation and/or add a message when loading the package with this function inside your package:

#' @title .onAttach
#' @noRd
.onAttach <- function(libname, pkgname) {
  message("Open the HTML documentation with deeptools::open_pkgdown()")
}


ThinkR-open/chameleon documentation built on Feb. 1, 2023, 5:21 p.m.