-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
docs: Document package options #1193
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ Collate: | |
'io.R' | ||
'nest.R' | ||
'nested-to-tree.R' | ||
'options.R' | ||
'parse.R' | ||
'reindent.R' | ||
'token-define.R' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#' Package options | ||
#' | ||
#' These options can be set via [options()] and queried via [getOption()]. | ||
#' For this, add a `styler.` prefix (the package name and a dot) to the option name. | ||
#' Example: for an option `foo`, use `options(styler.foo = value)` to set it | ||
#' and `getOption("styler.foo")` to retrieve the current value. | ||
#' An option value of `NULL` means that the default is used. | ||
#' | ||
#' @usage NULL | ||
#' @format NULL | ||
#' | ||
#' @name styler_options | ||
#' | ||
#' @examplesIf FALSE | ||
#' getOption("styler.ignore_alignment") | ||
#' options( | ||
#' styler.ignore_alignment = TRUE, | ||
#' styler.quiet = TRUE | ||
#' ) | ||
#' getOption("styler.ignore_alignment") | ||
#' | ||
#' @section Options for the styler package: | ||
#' | ||
#' - `styler.addins_style_transformer`: character. | ||
#' The name of the style transformer to use in the addins. | ||
#' (default: `"styler::tidyverse_style()"`) | ||
#' | ||
#' - `styler.cache_name`: character. | ||
#' The name of the styler cache to use. | ||
#' (default: current styler package version) | ||
#' | ||
#' - `styler.cache_root`: character. | ||
#' The directory where the cache files are stored. | ||
#' (default: `NULL`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could link |
||
#' | ||
#' - `styler.colored_print.vertical`: logical. | ||
#' It decides whether or not the output should be colored with `prettycode::highlight()`. | ||
#' (default: `TRUE`) | ||
#' | ||
#' - `styler.ignore_alignment`: logical. | ||
#' If `TRUE`, alignment, when detected, is ignored. | ||
#' (default: `FALSE`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could link |
||
#' | ||
#' - `styler.ignore_start`, `styler.ignore_stop`: character. | ||
#' Regular expressions to ignore lines that match them. | ||
#' (default: `"styler: off"` and `"styler: on"`, respectively) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can link |
||
#' | ||
#' - `styler.quiet`: logical. | ||
#' It decides whether or not to print an informative message about what the function is doing. | ||
#' If `TRUE`, no output is printed. | ||
#' (default: `FALSE`) | ||
#' | ||
#' - `styler.test_dir_writable`: logical. | ||
#' If `TRUE`, the package tests whether the directory is writable. | ||
#' (default: `TRUE`) | ||
NULL |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could actually put the version here, since roxygen comments can now contain R code to evaluate.