Skip to content

Commit

Permalink
feat!: adapt roxy lbls to new funky pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
salim-b committed Mar 4, 2025
1 parent f286e69 commit 07a5d7e
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 37 deletions.
10 changes: 5 additions & 5 deletions R/pkgsnip.gen.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ snip_path <- function(id = ls_file_snips()$id) {
#' pkgsnip::md_snip(id = "rstudio_addin") |> cat()
#'
#' # certain snips require additional args
#' pkgsnip::md_snip(id = "pkg_config",
#' pkgsnip::md_snip(id = "funky_config",
#' pkg = "foo") |>
#' cat()
md_snip <- function(id = data_md_snips$id,
Expand Down Expand Up @@ -366,12 +366,12 @@ param_lbl <- function(id = roxy_lbls(type = "param")$id,
#' pkgsnip::return_lbl(id = "dyn_dots_support")
#'
#' # some labels take additional arguments
#' pkgsnip::return_lbl(id = "pkg_config",
#' pkgsnip::return_lbl(id = "funky_config",
#' pkg = "foo")
#'
#' # note that the `pkg` argument always defaults to the current package
#' # (none if run from the global environment)
#' pkgsnip::return_lbl(id = "pkg_config")
#' pkgsnip::return_lbl(id = "funky_config")
return_lbl <- function(id = roxy_lbls(type = "return")$id,
...) {

Expand Down Expand Up @@ -414,12 +414,12 @@ return_lbl <- function(id = roxy_lbls(type = "return")$id,
#'
#' @examples
#' # some labels take additional arguments
#' pkgsnip::title_lbl(id = "pkg_config",
#' pkgsnip::title_lbl(id = "funky_config",
#' pkg = "foo")
#'
#' # note that the `pkg` argument always defaults to the current package
#' # (none if run from the global environment)
#' pkgsnip::title_lbl(id = "pkg_config")
#' pkgsnip::title_lbl(id = "funky_config")
title_lbl <- function(id = roxy_lbls(type = "title")$id,
as_sentence = FALSE,
...) {
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
10 changes: 5 additions & 5 deletions Rmd/pkgsnip.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ snip_path <- function(id = ls_file_snips()$id) {
#' pkgsnip::md_snip(id = "rstudio_addin") |> cat()
#'
#' # certain snips require additional args
#' pkgsnip::md_snip(id = "pkg_config",
#' pkgsnip::md_snip(id = "funky_config",
#' pkg = "foo") |>
#' cat()
md_snip <- function(id = data_md_snips$id,
Expand Down Expand Up @@ -406,12 +406,12 @@ param_lbl <- function(id = roxy_lbls(type = "param")$id,
#' pkgsnip::return_lbl(id = "dyn_dots_support")
#'
#' # some labels take additional arguments
#' pkgsnip::return_lbl(id = "pkg_config",
#' pkgsnip::return_lbl(id = "funky_config",
#' pkg = "foo")
#'
#' # note that the `pkg` argument always defaults to the current package
#' # (none if run from the global environment)
#' pkgsnip::return_lbl(id = "pkg_config")
#' pkgsnip::return_lbl(id = "funky_config")
return_lbl <- function(id = roxy_lbls(type = "return")$id,
...) {
Expand Down Expand Up @@ -458,12 +458,12 @@ return_lbl <- function(id = roxy_lbls(type = "return")$id,
#'
#' @examples
#' # some labels take additional arguments
#' pkgsnip::title_lbl(id = "pkg_config",
#' pkgsnip::title_lbl(id = "funky_config",
#' pkg = "foo")
#'
#' # note that the `pkg` argument always defaults to the current package
#' # (none if run from the global environment)
#' pkgsnip::title_lbl(id = "pkg_config")
#' pkgsnip::title_lbl(id = "funky_config")
title_lbl <- function(id = roxy_lbls(type = "title")$id,
as_sentence = FALSE,
...) {
Expand Down
12 changes: 6 additions & 6 deletions data-raw/md_snips.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Markdown snippets

[opt_global_max_cache_age]
value = """\
Maximal timespan to preserve the package's [pkgpins](https://pkgpins.rpkg.dev/) cache. Cache entries older than this will be deleted upon package loading.\
"""

[pkg_config]
[funky_config]
value = """\
Some of { if (exists('pkg')) pkg else utils::packageName() }'s functionality is controlled via package-specific global configuration \
which can either be set via [R options](https://rdrr.io/r/base/options.html) or [environment variables](https://en.wikipedia.org/wiki/Environment_variable) \
(the former take precedence). This configuration includes:\
"""

[opt_global_max_cache_age]
value = """\
Maximal timespan to preserve the package's [pkgpins](https://pkgpins.rpkg.dev/) cache. Cache entries older than this will be deleted upon package loading.\
"""

[pkg_required]
value = "To be able to use this function, the package '{ if (exists('pkg')) pkg else utils::packageName() }' is required but it is not installed. Please install it and then try again."

Expand Down
12 changes: 7 additions & 5 deletions data-raw/roxy_lbls.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ value.default = """\
antiquated systems.\n- `\"LFCR\"` for the line feed + carriage return (LF+CR) character sequence (`\"\\n\\r\"`). The standard on RISC OS and some other \
exotic systems.\
"""
[funky_config]
value.default = """\
a [tibble][tibble::tbl_df] with metadata of all possible { if (exists('pkg')) pkg else utils::packageName() } package configuration options. See [funky::config_val()] for more information\
"""
value.title = "{ if (exists('pkg')) pkg else utils::packageName() } package configuration metadata"
[ggplot2_obj]
value.default = "a [ggplot2][ggplot2::ggplot] object"
[glue_chr]
Expand Down Expand Up @@ -55,11 +60,8 @@ value.default = """\
value.default = "a [path][fs::fs_path]"
[paths]
value.default = "a vector of [paths][fs::fs_path]"
[pkg_config]
value.default = """\
a [tibble][tibble::tbl_df] with metadata of all possible { if (exists('pkg')) pkg else utils::packageName() } package configuration options. See [pal::pkg_config_val()] for more information\
"""
value.title = "{ if (exists('pkg')) pkg else utils::packageName() } package configuration metadata"
[pkg]
value.default = "\\R package name. A character scalar. Defaults to the name of the calling package"
[plotly_obj]
value.default = "a [plotly object][plotly::plot_ly]"
[quiet]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ editor_options:
#| child: !expr "pkgsnip::snip_path('_common.Rmd')"
```

`r pkgsnip::md_snip(id = "pkg_config", pkg = pkg_name)`
`r pkgsnip::md_snip(id = "funky_config", pkg = pkg_name)`

::: table-wide
`r pal::print_pkg_config(pkg = pkg_name, roxy_to_md = !is_roxygen)`
`r funky::print_config(pkg = pkg_name, roxy_to_md = !is_roxygen)`
:::
3 changes: 2 additions & 1 deletion man/description_lbl.Rd

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

6 changes: 3 additions & 3 deletions man/md_snip.Rd

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

3 changes: 2 additions & 1 deletion man/param_lbl.Rd

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

7 changes: 4 additions & 3 deletions man/return_lbl.Rd

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

5 changes: 3 additions & 2 deletions man/roxy_lbls.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/snip_path.Rd

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

7 changes: 4 additions & 3 deletions man/title_lbl.Rd

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

0 comments on commit 07a5d7e

Please sign in to comment.