Skip to content

Commit

Permalink
played around with roxygen_md documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
marton-balazs-kovacs committed Aug 24, 2021
1 parent bd38b04 commit 51533d2
Show file tree
Hide file tree
Showing 35 changed files with 141 additions and 131 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ BugReports: https://github.com/marton-balazs-kovacs/tenzing/issues
VignetteBuilder: knitr
Depends:
R (>= 2.10)
Roxygen: list(markdown = TRUE)
4 changes: 2 additions & 2 deletions R/contributors_table_template.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
#' \item{ORCID iD}{character, ORCID iD of the contributor}
#' \item{'Corresponding author?'}{logical, TRUE for contributor who is the corresponding author}
#'}
#'@source \url{https://docs.google.com/spreadsheets/d/1Gl0cwqN_nTsdFH9yhSvi9NypBfDCEhViGq4A3MnBrG8/edit?usp=sharing}
"contributors_table_template"
#'@source <https://docs.google.com/spreadsheets/d/1Gl0cwqN_nTsdFH9yhSvi9NypBfDCEhViGq4A3MnBrG8/edit?usp=sharing>
"contributors_table_template"
2 changes: 1 addition & 1 deletion R/initials.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ abbreviate <- function(string, collapse) {

#' Abbreviate middle names in a dataframe
#'
#' The function calls the \code{\link{abbreviate}} function to
#' The function calls the [abbreviate()] function to
#' abbreviate middle names in the `Middle name` variable in a
#' dataframe if they are present. The function requires a valid
#' `contributors_table` as an input to work.
Expand Down
10 changes: 5 additions & 5 deletions R/moduleServer.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#' Wrapper function around \code{shiny::callModule}
#' Wrapper function around `shiny::callModule`
#'
#' The function dodge the explicit usage of \code{callModule} on
#' the server side. This style will be the default for \code{shiny}
#' The function dodge the explicit usage of `callModule` on
#' the server side. This style will be the default for `shiny`
#' from version 1.5.0. To be deleted after update.
#'
#' @param id Unique character id of the module
#' @param module Name of the module server function
#'
#' @section Source:
#' \url{https://mastering-shiny.org/scaling-modules.html}
#' <https://mastering-shiny.org/scaling-modules.html>
moduleServer <- function(id, module) {
callModule(module, id)
}
}
4 changes: 2 additions & 2 deletions R/print_credit_roles.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#'
#' The function generates rmarkdown formatted text of the contributions according
#' to the CRediT taxonomy. The output is generated from an `contributors_table` validated with
#' the \code{\link{validate_contributors_table}} function. The `contributors_table` must be based on the
#' \code{\link{contributors_table_template}}. The function can return the output string as
#' the [validate_contributors_table()] function. The `contributors_table` must be based on the
#' [contributors_table_template()]. The function can return the output string as
#' rmarkdown or html formatted text or without any formatting.
#'
#' @section Warning:
Expand Down
4 changes: 2 additions & 2 deletions R/print_funding.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#'
#' The functions generates the funding information section of the manuscript.
#' The output is generated from an contributors_table validated with
#' the \code{\link{validate_contributors_table}} function.
#' The contributors_table must be based on the \code{\link{contributors_table_template}}.
#' the [validate_contributors_table()] function.
#' The contributors_table must be based on the [contributors_table_template()].
#'
#' @family output functions
#'
Expand Down
6 changes: 3 additions & 3 deletions R/print_title_page.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' Generate title page
#'
#' The function generates rmarkdown formatted contributors' affiliation text from
#' an contributors_table validated with the \code{\link{validate_contributors_table}} function. The
#' contributors_table must be based on the \code{\link{contributors_table_template}}. The function can
#' an contributors_table validated with the [validate_contributors_table()] function. The
#' contributors_table must be based on the [contributors_table_template()]. The function can
#' return the output string as rmarkdown or html formatted text or without any formatting.
#'
#' @section Warning:
Expand All @@ -19,7 +19,7 @@
#'
#' @return The output is string containing the contributors' name and
#' the corresponding affiliations in the the order defined by the
#' \code{Order in publication} column of the contributors_table.
#' `Order in publication` column of the contributors_table.
#' @export
#' @examples
#' example_contributors_table <- read_contributors_table(
Expand Down
4 changes: 2 additions & 2 deletions R/print_xml.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#' The function generates an XML nodeset that contains the contributors' name,
#' affiliation, and their CRediT roles with a structure outlined in the
#' JATS 1.2 DTD specifications (eLife). The output is generated from an
#' `contributors_table` validated with the \code{\link{validate_contributors_table}} function.
#' The `contributors_table` must be based on the \code{\link{contributors_table_template}}.
#' `contributors_table` validated with the [validate_contributors_table()] function.
#' The `contributors_table` must be based on the [contributors_table_template()].
#'
#' @section Warning:
#' The function is primarily developed to be the part of a shiny app. As the
Expand Down
4 changes: 2 additions & 2 deletions R/print_yaml.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#'
#' The function generates a YAML document containing the contributors information
#' and contributions according to the CRediT taxonomy. The output is generated
#' from an `contributors_table` validated with the \code{\link{validate_contributors_table}} function.
#' The `contributors_table` must be based on the \code{\link{contributors_table_template}}.
#' from an `contributors_table` validated with the [validate_contributors_table()] function.
#' The `contributors_table` must be based on the [contributors_table_template()].
#'
#' @section Warning:
#' The function is primarily developed to be the part of a shiny app. As the
Expand Down
10 changes: 5 additions & 5 deletions R/render_report.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' Wrapper around \code{rmarkdown::render}
#' Wrapper around `rmarkdown::render`
#'
#' A wrapper function around \code{rmarkdown::render} in order
#' A wrapper function around `rmarkdown::render` in order
#' to call it in a different process in the modules.
#'
#' @section Source:
#' The function is based on the suggestion of Hadley Wickham \url{https://mastering-shiny.org/action-transfer.html}.
#' The function is based on the suggestion of Hadley Wickham <https://mastering-shiny.org/action-transfer.html>.
#'
#' @seealso \code{\link[rmarkdown]{render}}
#' @seealso [rmarkdown::render()]
#'
#' @param input path of the input RMD skeleton
#' @param output path of the rendered output file
Expand All @@ -19,4 +19,4 @@ render_report <- function(input, output, format, params) {
params = params,
envir = new.env(parent = globalenv())
)
}
}
2 changes: 1 addition & 1 deletion R/utils-pipe.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Pipe operator
#'
#' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details.
#' See `magrittr::[\%>\%][magrittr::pipe]` for details.
#'
#' @name %>%
#' @rdname pipe
Expand Down
18 changes: 9 additions & 9 deletions R/validate_contributors_table.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Validating the contributors table
#'
#' This function validates the `contributors_table` provided to it by checking whether the
#' provided `contributors_table` is compatible with the \code{\link{contributors_table_template}}. The function
#' provided `contributors_table` is compatible with the [contributors_table_template()]. The function
#' early escapes only if the provided `contributors_table` is not a dataframe, the variable
#' names that are present in the `contributors_table_template` are missing, or if the
#' `contributors_table` is empty.
Expand All @@ -11,13 +11,13 @@
#' \item error, the provided contributors_table is a dataframe
#' \item error, the provided contributors_table does not have the same column names as the template
#' \item error, the provided contributors_table is empty
#' \item error, \code{Firstname} variable has missing value for one of the contributors
#' \item error, \code{Surname} variable has a missing value for one of the contributors
#' \item error, `Firstname` variable has missing value for one of the contributors
#' \item error, `Surname` variable has a missing value for one of the contributors
#' \item warning, the contributors_table has duplicate names
#' \item warning, the contributors_table has names with duplicate initials
#' \item error, the \code{'Order in publication'} variable has missing values
#' \item error, the \code{'Order in publication'} variable has duplicate values
#' \item error, both \code{'Primary affiliation'} and \code{'Secondary affiliation'} variables
#' \item error, the `'Order in publication'` variable has missing values
#' \item error, the `'Order in publication'` variable has duplicate values
#' \item error, both `'Primary affiliation'` and `'Secondary affiliation'` variables
#' are missing for one contributor
#' \item warning, there is no corresponding author added
#' \item warning, email address is missing for the corresponding author
Expand All @@ -27,8 +27,8 @@
#' @param contributors_table dataframe, filled out contributors_table
#'
#' @return The function returns a list for each checked statement. Each list contains
#' a \code{type} vector that stores whether the statement passed the check "success"
#' or failed "warning" or "error", and a \code{message} vector that contains information
#' a `type` vector that stores whether the statement passed the check "success"
#' or failed "warning" or "error", and a `message` vector that contains information
#' about the nature of the check.
#' @export
#' @examples
Expand Down Expand Up @@ -354,4 +354,4 @@ check_duplicate_initials <- function(contributors_table) {
message = "There are no duplicate initials in the contributors_table."
)
}
}
}
4 changes: 2 additions & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ news:
one_page: true

home:
strip_header: true
strip_header: false
links:
- text: Shiny app
- text: Find the Shiny app
href: http://tenzing.club/
6 changes: 3 additions & 3 deletions man/abbreviate_middle_names_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/add_initials.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/contrib_group.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 28 additions & 28 deletions man/contributors_table_template.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/figures/lifecycle-archived.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-defunct.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-deprecated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-experimental.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-maturing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions man/figures/lifecycle-questioning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 51533d2

Please sign in to comment.