Skip to content

Commit

Permalink
Tweak documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgallou committed Jul 29, 2024
1 parent 6ee5964 commit f934e9a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
8 changes: 4 additions & 4 deletions R/pkrt-list.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#' automatically references the cited packages in the first (by default)
#' `.bib` file specified in the YAML header if no references of the packages
#' already exist.
#' @param ... Character vectors, separated by a comma, of packages to cite.
#' @param ... Character vectors, separated by commas, of packages to cite.
#' @details
#' This function automatically discards duplicate and base packages. I recommend
#' using `pkrt_list()` in combination with `renv::dependencies()` to cite all
#' the packages used in a project.
#' This function automatically discards duplicate and base packages. You can use
#' `pkrt_list()` in combination with `renv::dependencies()` to cite all the
#' packages used in a project or directory.
#' @return A list of package citations.
#' @examples
#' # Create a list of citations
Expand Down
4 changes: 3 additions & 1 deletion R/pkrt.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
#' in which case `pkrt()` automatically references the cited package in the
#' first (by default) `.bib` file specified in the YAML header if no
#' references of the package already exist.
#' @param x A string of the package to cite. Use `pkrt("R")` to cite R.
#' @param x A string of the package to cite.
#' @returns A character string.
#' @examples
#' pkrt("pakret")
#'
#' pkrt("R")
#' @export
pkrt <- function(x) {
check_character(x)
Expand Down
7 changes: 5 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ make_template <- function(lines, to_render = TRUE) {

## Overview

pakret is a minimalist R package citation tool to reference and cite R packages and objects on the fly in R Markdown and Quarto.
pakret is a minimalist R package citation tool to reference and cite R and R packages on the fly in R Markdown and Quarto.

## Installation

Expand All @@ -46,7 +46,7 @@ pak::pak("arnaudgallou/pakret")

## Usage

Simply use `pkrt()` whenever you want to cite an R package or object in your document:
Simply use `pkrt()` whenever you want to cite R or an R package in your document:

````{r, include = FALSE}
template <- pakret:::dedent('
Expand Down Expand Up @@ -147,3 +147,6 @@ make_template(template) |>
pakret:::read_local_file() |>
cat()
```

By default, pakret writes new references into the first `.bib` file specified in the bibliography list.
You can change which `.bib` file to save references to using `pkrt_set()`.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](h
## Overview

pakret is a minimalist R package citation tool to reference and cite R
packages and objects on the fly in R Markdown and Quarto.
and R packages on the fly in R Markdown and Quarto.

## Installation

Expand All @@ -26,8 +26,8 @@ pak::pak("arnaudgallou/pakret")

## Usage

Simply use `pkrt()` whenever you want to cite an R package or object in
your document:
Simply use `pkrt()` whenever you want to cite R or an R package in your
document:

---
bibliography: references.bib
Expand Down Expand Up @@ -110,3 +110,7 @@ Here’s the result:
Alea Jacta Est*.

Itisalapsus, Julius. 2024. *Bar: Tempus Edax Rerum*.

By default, pakret writes new references into the first `.bib` file
specified in the bibliography list. You can change which `.bib` file to
save references to using `pkrt_set()`.
4 changes: 3 additions & 1 deletion man/pkrt.Rd

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

8 changes: 4 additions & 4 deletions man/pkrt_list.Rd

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

0 comments on commit f934e9a

Please sign in to comment.