noaa-onms / cinms

Channel Islands National Marine Sanctuary
https://noaa-onms.github.io/cinms
MIT License
3 stars 1 forks source link

separate functions into group headings for pkgdown References web page #60

Closed bbest closed 3 years ago

bbest commented 3 years ago

Idea is to go from:

image

to something like this:

image

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:

superjai commented 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:

Anyway, let's look at one of those unexported functions from render_rmd.r - glossarize_md Screen Shot 2020-11-12 at 11 14 10 PM

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.

superjai commented 3 years ago

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.