https://github.com/ThinkR-open/ghooks
'Golem' Hooks for Standard 'Shiny' Apps
https://github.com/ThinkR-open/ghooks
golemverse shiny shiny-apps shiny-r
Last synced: 4 months ago
JSON representation
'Golem' Hooks for Standard 'Shiny' Apps
- Host: GitHub
- URL: https://github.com/ThinkR-open/ghooks
- Owner: ThinkR-open
- License: other
- Created: 2023-03-24T19:52:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-16T14:12:12.000Z (8 months ago)
- Last Synced: 2024-11-28T21:53:02.140Z (5 months ago)
- Topics: golemverse, shiny, shiny-apps, shiny-r
- Language: R
- Homepage:
- Size: 23.4 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - ThinkR-open/ghooks - 'Golem' Hooks for Standard 'Shiny' Apps (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# ghooks
[](https://github.com/ThinkR-open/ghooks/actions/workflows/R-CMD-check.yaml)
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)The goal of `{ghooks}` is to provide `{ghooks}` hooks for standard `{shiny}` apps.
## Installation
You can install the development version of `{ghooks}` like so:
``` r
pak::pak("thinkr-open/ghooks")
```## About
You're reading the doc about version : `r pkgload::pkg_version()`
This README has been compiled on the
```{r}
Sys.time()
```Here are the test & coverage results :
```{r}
devtools::check(quiet = TRUE)
``````{r echo = FALSE}
unloadNamespace("ghooks")
``````{r}
covr::package_coverage()
```## `{golem}` hooks
`{golem}` hooks are functions that are called by `{golem}` at specific moments of the app lifecycle.
They are used to add custom code to the app, notably when creating the app with `create_golem()`.You can find more info about `{golem}` hooks on [`{golem}` documentation](https://thinkr-open.github.io/golem/articles/f_extending_golem.html).
The hooks can be called with `golem::create_golem(project_hook = )`, when creating a new golem project via the RStudio widget, as show on the screenshot in the [Extending `{golem}`](https://thinkr-open.github.io/golem/articles/f_extending_golem.html#defining-your-own-project_hook) Vignette.
Below is the list of curently available hooks:
### `geyser_hook`
This hook is mainly intended at demoing the `{golem}` hooks system.
It adds the "Old Faithful Geyser Data" app to your golem project.Click here to see the content of `app_ui` and `app_server` from `geyser_hook`
```{r}
pth <- tempfile(pattern = "geyser")
old_wd <- getwd()
unlink(pth, recursive = TRUE)
golem::create_golem(
pth,
project_hook = ghooks::geyser_hook,
open = FALSE
)
``````{r}
cat(
readLines(
file.path(pth, "R", "app_ui.R")
),
sep = "\n"
)
``````{r}
cat(
readLines(
file.path(pth, "R", "app_server.R")
),
sep = "\n"
)
```## About
You're reading the doc about version : `r pkgload::pkg_version()`
This README has been compiled on:
```{r}
Sys.time()
```Here are the test & coverage results :
```{r}
devtools::check(quiet = TRUE)
``````{r echo = FALSE}
unloadNamespace("ghooks")
``````{r}
covr::package_coverage()
```