Closed bbest closed 3 years ago
OK @bbest - I have figured out why pkgdown is generating documentation for functions that aren't exported.
It has to do with the documentation within the R files in nms4r/R . You will note, by the way, that I have split spatial.R into several files. This guidance on R packages suggests that all functions in a package shouldn't sit within one file. So, I split the functions into four files:
spatial.r (mapping functions),
calcofi.r (calcofi-related functions),
calculate_data.r (functions used for calculating data)
render_rmd.R (functions for rendering rmd files)
Anyway, let's look at one of those unexported functions from render_rmd.r - glossarize_md
The trouble here is the use of #' in the documentation above glossarize_md. Even though the function is unexported, the use of #' causes roxygen2 to generate a rd file for the function in the man folder. And that rd file causes the function to be included within the pkgdown-generated html. So, there you go. By editing the documentation, this problem is easily fixed.
I actually think it makes sense to leave the documentation for internal-only functions. Whoever is developing this in the future will surely need to know what these functions are about. Because a few of them still aren't documented, I am still not 100% on what a few of them do.
Idea is to go from:
to something like this:
To do this, create
inst/_pkgdown.yml
a la pkgdown documentation. For example whalesafe4r:inst/_pkgdown.yml.Am thinking we can group functions by broad functionality:
OR by dataset: