From b95c5d870f08180b0d731b34f3c6fe081a0817d6 Mon Sep 17 00:00:00 2001 From: riccardoporreca Date: Fri, 27 Mar 2020 01:38:34 +0100 Subject: [PATCH] Minor documentation fixes and review. --- R/config.R | 2 ++ R/gallery_site_generator.R | 7 ++++++- R/templates.R | 5 ++--- man/gallery_content.Rd | 4 ++-- man/gallery_site.Rd | 7 +++++-- man/gallery_site_config.Rd | 2 +- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/R/config.R b/R/config.R index c1f8df9..21296e5 100644 --- a/R/config.R +++ b/R/config.R @@ -1,3 +1,5 @@ +#' Gallery site configuration +#' #' Site configuration for the [gallery_site()] generator. #' #' @inheritParams rmarkdown::site_config diff --git a/R/gallery_site_generator.R b/R/gallery_site_generator.R index 8f5782b..ee365d4 100644 --- a/R/gallery_site_generator.R +++ b/R/gallery_site_generator.R @@ -1,7 +1,12 @@ # rmarkdown/R/render_site.R ---- # https://github.com/rstudio/rmarkdown/blob/947b87259333b43f47b5f59e91dc9a1ea10d1c4d/R/render_site.R -#' Gallery website generator. +#' Gallery website generator +#' +#' Define a custom website generator to be used with [rmarkdown::render_site()]. +#' This generates a simple R Markdown website including a gallery of pages with +#' embedded content, based on metadata in JSON format and custom site +#' configuration options. #' #' @inheritParams rmarkdown::default_site_generator #' diff --git a/R/templates.R b/R/templates.R index f87ce8b..bf78107 100644 --- a/R/templates.R +++ b/R/templates.R @@ -17,7 +17,6 @@ gallery_div <- function(class, content) { #' Create the content of a gallery page based on arbitrary page content and #' gallery configuration. #' -#' #' @param ... Unnamed items defining the main content of the page. #' @param gallery_config The gallery site configuration. Elements #' `$include_before` and `$include_after` (if present) are included before and @@ -43,12 +42,12 @@ gallery_div <- function(class, content) { #' @examples #' gallery_content( #' htmltools::h2("Hello world"), -#' "Welcome to the callery content world", +#' "Welcome to the gallery content world", #' gallery_config = list( #' include_before = "before
", #' include_after = htmltools::tagList(htmltools::hr(), "after") #' ), -#' class = "hello-gallery-content" +#' class = "hello-gallery" #' ) #' #' @export diff --git a/man/gallery_content.Rd b/man/gallery_content.Rd index 503e18f..9af6359 100644 --- a/man/gallery_content.Rd +++ b/man/gallery_content.Rd @@ -39,12 +39,12 @@ gallery configuration. \examples{ gallery_content( htmltools::h2("Hello world"), - "Welcome to the callery content world", + "Welcome to the gallery content world", gallery_config = list( include_before = "before
", include_after = htmltools::tagList(htmltools::hr(), "after") ), - class = "hello-gallery-content" + class = "hello-gallery" ) } diff --git a/man/gallery_site.Rd b/man/gallery_site.Rd index 24543ee..f78e8b0 100644 --- a/man/gallery_site.Rd +++ b/man/gallery_site.Rd @@ -3,7 +3,7 @@ \name{gallery_site} \alias{gallery_site} \alias{gallery_site_generator} -\title{Gallery website generator.} +\title{Gallery website generator} \usage{ gallery_site(input, ...) @@ -15,7 +15,10 @@ gallery_site_generator(input, ...) \item{...}{Currently unused.} } \description{ -Gallery website generator. +Define a custom website generator to be used with \code{\link[rmarkdown:render_site]{rmarkdown::render_site()}}. +This generates a simple R Markdown website including a gallery of pages with +embedded content, based on metadata in JSON format and custom site +configuration options. } \details{ See \code{\link[rmarkdown:default_site_generator]{rmarkdown::default_site_generator()}}, from which the diff --git a/man/gallery_site_config.Rd b/man/gallery_site_config.Rd index 449a162..b611422 100644 --- a/man/gallery_site_config.Rd +++ b/man/gallery_site_config.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/config.R \name{gallery_site_config} \alias{gallery_site_config} -\title{Site configuration for the \code{\link[=gallery_site]{gallery_site()}} generator.} +\title{Gallery site configuration} \usage{ gallery_site_config(input = ".") }