Skip to content

Commit

Permalink
Add package docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Nov 12, 2021
1 parent f74d9f4 commit 339ad5a
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 25 deletions.
27 changes: 27 additions & 0 deletions R/rsthemes-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#' @description
#' This package provides a set of complete RStudio themes that restyle the
#' IDE and the editor syntax. The themes are built from
#' [sass](https://sass-lang.org) templates into `.rstheme` files that,
#' ultimately, contain the CSS files that provide the themes. The sass templates
#' provide an easy-to-extend framework for customizing the look of RStudio. If
#' you would like to create your own theme, [rstheme()] is designed to help you
#' get started quickly.
#'
#' @section Getting Started:
#'
#' - Would you like to install, try out, or remove RStudio themes from
#' \pkg{rsthemes}? Read more in [rsthemes-actions].
#'
#' - Would you like to automatically choose a dark or light theme? Or would
#' you like to quickly toggle through a set of themes you enjoy? Read more
#' in [auto_theme].
#'
#' - Would you like to create a new theme for RStudio? Read more in
#' [rstheme()].
#'
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
## usethis namespace: end
NULL
22 changes: 7 additions & 15 deletions R/rsthemes.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
#' Full RStudio Themes
#'
#' This package provides a set of complete RStudio themes that restyle the
#' IDE and the editor syntax. The themes are built from
#' [sass](https://sass-lang.org) templates into `.rstheme` files that,
#' ultimately, contain the CSS files that provide the themes. The sass templates
#' provide an easy-to-extend framework for customizing the look of RStudio. If
#' you would like to create your own theme, [rstheme()] is designed to help you
#' get started quickly.
#' Install, List, Try or Remove RStudio Themes
#'
#' @section Palettes: \pkg{rsthemes} includes RStudio themes based on the
#' following colors palettes.
#'
#' ```{r child="man/fragments/palettes.Rmd"}
#' ```
#'
#' @name rsthemes
#' @name rsthemes-actions
NULL

#' @describeIn rsthemes Install RStudio themes
#' @describeIn rsthemes-actions Install RStudio themes
#' @param style Limit to a subgroup of themes, chosen from the options returned
#' by [rsthemes_styles()].
#' @param include_base16 Should the `base16` themes be included?
Expand Down Expand Up @@ -54,7 +46,7 @@ install_rsthemes <- function(style = "all", include_base16 = FALSE, destdir = NU
cli::cli_alert_info("Use {.code rsthemes::try_rsthemes()} to try all installed themes")
}

#' @describeIn rsthemes Remove rsthemes from RStudio
#' @describeIn rsthemes-actions Remove rsthemes from RStudio
#' @export
remove_rsthemes <- function(style = rsthemes_styles(), include_base16 = TRUE) {
requires_rstudioapi()
Expand All @@ -79,7 +71,7 @@ cli_how2install <- function() {
)
}

#' @describeIn rsthemes List installed themes (default) or available themes
#' @describeIn rsthemes-actions List installed themes (default) or available themes
#' @param list_installed Should the installed \pkg{rsthemes} themes be listed
#' (default). If `FALSE`, the available themes in the \pkg{rsthemes} package
#' are listed instead.
Expand Down Expand Up @@ -134,7 +126,7 @@ list_pkg_rsthemes <- function(style = "all", include_base16 = TRUE) {
theme_files
}

#' @describeIn rsthemes Try each rsthemes RStudio theme
#' @describeIn rsthemes-actions Try each rsthemes RStudio theme
#' @param delay Number of seconds to wait between themes. Set to 0 to be
#' prompted to continue after each theme.
#' @export
Expand Down Expand Up @@ -172,7 +164,7 @@ try_rsthemes <- function(
rstudioapi::applyTheme(current_theme$editor)
}

#' @describeIn rsthemes List style options
#' @describeIn rsthemes-actions List style options
#' @param validate If provided to `rsthemes_styles()`, checks that the
#' specified style is valid.
#' @param ... Ignored.
Expand Down
14 changes: 4 additions & 10 deletions man/rsthemes.Rd → man/rsthemes-actions.Rd

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

42 changes: 42 additions & 0 deletions man/rsthemes-package.Rd

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

0 comments on commit 339ad5a

Please sign in to comment.