-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathpal_add_remove.Rd
39 lines (36 loc) · 1.45 KB
/
pal_add_remove.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pal-add-remove.R
\name{pal_add_remove}
\alias{pal_add_remove}
\alias{pal_add}
\alias{pal_remove}
\title{Creating custom pals}
\usage{
pal_add(role, prompt = NULL, interface = c("replace", "prefix", "suffix"))
pal_remove(role)
}
\arguments{
\item{role}{A single string giving the \code{\link[=pal]{pal()}} role.}
\item{prompt}{A file path to a markdown file giving the system prompt or
the output of \code{\link[elmer:interpolate]{elmer::interpolate()}}.}
\item{interface}{One of \code{"replace"}, \code{"prefix"}, or \code{"suffix"}, describing
how the pal will interact with the selection. For example, the
\link[=pal_cli]{cli pal} \code{"replace"}s the selection, while the
\link[=pal_roxygen]{roxygen pal} \code{"prefixes"} the selected code with documentation.}
}
\value{
\code{NULL}, invisibly. Called for its side effect: a pal with role \code{role}
is registered with the pal package.
}
\description{
Users can create custom pals using the \code{pal_add()} function; after passing
the function a role and prompt, the pal will be available on the command
palette.
}
\details{
\code{pal_add()} will register the add-in as coming from the pal package
itself—because of this, custom pals will be deleted when the pal
package is reinstalled. Include \code{pal_add()} code in your \code{.Rprofile} or
make a pal extension package using \code{pal_add(package = TRUE)} to create
persistent custom pals.
}