Skip to content

Commit f265849

Browse files
committed
fix: update DESCRIPTION title formatting and improve snippets installation details
1 parent 3931cac commit f265849

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: quartify
22
Type: Package
3-
Title: Convert R Scripts to Quarto Markdown Documents
3+
Title: Convert R Scripts to 'Quarto' Markdown Documents
44
Version: 1.1.1
55
Authors@R: c(
66
person("Damien", "Dotta", , "damien.dotta@live.fr", role = c("aut", "cre", "cph"))

R/snippets.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
#' - **tabset**: Insert a tabset structure
1313
#'
1414
#' @details
15-
#' The snippets are installed in your RStudio snippets file for R:
15+
#' By default the snippets are written to a temporary file (inside `tempdir()`)
16+
#' to comply with CRAN's restriction on writing to the user's filespace during
17+
#' examples, vignettes, and tests. To install in your actual RStudio snippets
18+
#' file, provide the explicit path via `path`, for example:
1619
#' - Windows: `%APPDATA%/RStudio/snippets/r.snippets`
1720
#' - Mac/Linux: `~/.config/rstudio/snippets/r.snippets`
1821
#'
@@ -27,8 +30,9 @@
2730
#'
2831
#' @param backup Logical. If TRUE (default), creates a backup of your existing
2932
#' snippets file before modifying it.
30-
#' @param path Character. Custom path for the snippets file. If NULL (default),
31-
#' uses the standard RStudio snippets location. For examples/tests, use tempdir().
33+
#' @param path Character. Path for the snippets file. Defaults to writing in
34+
#' `tempdir()` to comply with CRAN policies. Provide an explicit path when you
35+
#' intentionally want to install into your RStudio snippets directory.
3236
#'
3337
#' @return Invisibly returns the path to the snippets file.
3438
#'
@@ -46,7 +50,7 @@
4650
#' # For testing: install to temp directory
4751
#' temp_snippets <- file.path(tempdir(), "r.snippets")
4852
#' install_quartify_snippets(path = temp_snippets)
49-
install_quartify_snippets <- function(backup = TRUE, path = NULL) {
53+
install_quartify_snippets <- function(backup = TRUE, path = file.path(tempdir(), "r.snippets")) {
5054
# Define the snippets content
5155
snippets <- '
5256
# quartify snippets

0 commit comments

Comments
 (0)