Skip to content

Commit

Permalink
Add returns and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeLydeamore committed Aug 28, 2023
1 parent 3ea8209 commit 2df84ae
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions R/create_staff_member_page.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @param staff_folder Subfolder in which the staff qmd files are stored.
#' Default "staff". Note that each template will be `index.qmd` to facilitate
#' pretty link formatting in-browser.
#' @return NULL
#'
#' @export
create_staff_member_page <- function(staff_member, site_dir, staff_folder = "staff") {
Expand Down
3 changes: 3 additions & 0 deletions R/create_website.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#'
#' @param dir Target directory for the website.
#' @param title Title of the website.
#' @return NULL
#'
#' @examples
#' create_website(dir = tempdir(), "test_site")
Expand Down Expand Up @@ -58,4 +59,6 @@ create_website <- function(dir, title) {
),
site_dir = dir
)

return (invisible(NULL))
}
3 changes: 3 additions & 0 deletions R/generate_markdown_for_member.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#'
#' @param member An object of class `staff_member`.
#' @param extension Extension of the image file. Don't include the .
#' @return NULL
#'
#' @export
generate_markdown_for_member <- function(member, extension = "png") {
Expand Down Expand Up @@ -37,4 +38,6 @@ generate_markdown_for_member <- function(member, extension = "png") {
"",
sep = "\n"
)

return(invisible(NULL))
}
3 changes: 3 additions & 0 deletions R/generate_markdown_for_projects.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#'
#' @param project A `condensr` project object. If a link is available (i.e.
#' `!is.na(project$link)`), then a hyperlink will be inserted.
#' @return NULL
#'
#' @export
generate_markdown_for_projects <- function(project) {
Expand All @@ -22,4 +23,6 @@ generate_markdown_for_projects <- function(project) {
sep = "\n"
)
}

return (invisible(NULL))
}
3 changes: 3 additions & 0 deletions R/generate_markdown_for_publications.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#'
#' @param publication A `condensr` publication object. If a link is available (i.e.
#' `!is.na(publication$link)`), then a hyperlink will be inserted.
#' @return NULL
#'
#' @export
generate_markdown_for_publications <- function(publication) {
Expand All @@ -22,4 +23,6 @@ generate_markdown_for_publications <- function(publication) {
sep = "\n"
)
}

return(invisible(NULL))
}
3 changes: 3 additions & 0 deletions R/render_template.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' input file name.
#' @param data List of additional metadata. Must have at least element `name`
#' and `title`.
#' @return NULL
#'
render_template <- function(file, template_folder, target_path, output_name = NA, data = list()) {
if (is.na(output_name)) {
Expand All @@ -27,4 +28,6 @@ render_template <- function(file, template_folder, target_path, output_name = NA


writeLines(output, file.path(target_path, output_name), useBytes = TRUE)

return(invisible(NULL))
}
10 changes: 9 additions & 1 deletion R/staff_member.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@
#' * `name`
#' * `description`
#' * `external_link`
#' * `internal_link`
#' * `email`
#' @examples
#' # ADD_EXAMPLES_HERE
#' example_staff_member <- staff_member(
#' id = "example-id",
#' name = "Example Name",
#' description = "Example description for example staff member.",
#' external_link = "http://www.example.com/",
#' internal_link = FALSE
#' )
#' @export
staff_member <- function(id,
name,
Expand Down

0 comments on commit 2df84ae

Please sign in to comment.