Skip to content

Commit

Permalink
add gallery of pal extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch authored Oct 30, 2024
1 parent 88190aa commit eed7d98
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ Imports:
rstudioapi,
shiny
Suggests:
gt,
knitr,
rmarkdown,
testthat (>= 3.0.0),
tibble,
withr
Remotes:
hadley/elmer
Expand Down
2 changes: 2 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ As-is, the package provides ergonomic LLM assistants for R package development:
* `"testthat"`: [Convert to testthat 3](https://simonpcouch.github.io/pal/reference/pal_testthat.html)
* `"roxygen"`: [Document functions with roxygen](https://simonpcouch.github.io/pal/reference/pal_roxygen.html)

Users have also contributed a number of pals for a wide range of tasks--see `vignette("gallery", package = "pal")` for a gallery of user-contributed pals!

That said, all you need to create your own pal is a markdown file with some instructions on how you'd like it to work. See `prompt_new()` and `directory_load()` for more information, and [palpable](https://github.com/simonpcouch/palpable) for an example pal extension package.

## How much do pals cost?
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ development:
- `"roxygen"`: [Document functions with
roxygen](https://simonpcouch.github.io/pal/reference/pal_roxygen.html)

Users have also contributed a number of pals for a wide range of
tasks–see `vignette("gallery", package = "pal")` for a gallery of
user-contributed pals!

That said, all you need to create your own pal is a markdown file with
some instructions on how you’d like it to work. See `prompt_new()` and
`directory_load()` for more information, and
Expand Down
45 changes: 45 additions & 0 deletions vignettes/gallery.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: "Gallery"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Gallery}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

<br><br>

```{r}
#| echo: false
#| eval: !expr rlang::is_installed(c("gt", "tibble"))
# Contributors: to add your pal to this table, add one row per pal in the
# following `tribble()` call. If you've authored a pal extension that includes
# multiple pals, include a row for each pal.
quartochunk_code <-
'prompt_new(
"quartochunk",
"replace",
"https://gist.githubusercontent.com/hfrick/1ca8fc2cb2a4409b743e8120c6cc2223/raw/a9703edfbd4e83839af0278c33add1b33e243d02/quartochunk-replace.md"
)'
gallery <-
tibble::tribble(
~Description, ~Role, ~Interface, ~Author, ~`Use it via...`,
"[Convert erroring code to use cli](https://simonpcouch.github.io/pal/reference/pal_cli.html)", "cli", "replace", "Simon Couch", "library(pal)",
"[Convert unit tests to testthat 3e](https://simonpcouch.github.io/pal/reference/pal_testthat.html)", "testthat", "replace", "Simon Couch", "library(pal)",
"[Template function documentation with roxygen](https://simonpcouch.github.io/pal/reference/pal_roxygen.html)", "roxygen", "prefix", "Simon Couch", "library(pal)",
"[Transition to Quarto-style chunk headers](https://gist.github.com/hfrick/1ca8fc2cb2a4409b743e8120c6cc2223)", "quartochunk", "replace", "Hannah Frick", quartochunk_code,
# silly example to be removed once there are other pal extension pkgs
"[Always reply 'beep bop boop'](https://github.com/simonpcouch/palpable)", "boop", "replace", "Simon Couch", "pak::pak(\"simonpcouch/palpable\")\nlibrary(palpable)"
)
gallery$`Use it via...` <- paste0("```\n", gallery$`Use it via...`, "\n```")
library(gt)
gt(gallery) %>%
fmt_markdown(c(Description, `Use it via...`)) %>%
opt_interactive(use_search = TRUE) %>%
cols_width(c(Description, `Use it via...`) ~ px(220))
```

0 comments on commit eed7d98

Please sign in to comment.