-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
132 lines (93 loc) · 2.73 KB
/
README.Rmd
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ghooks
<!-- badges: start -->
[![R-CMD-check](https://github.com/ThinkR-open/ghooks/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ThinkR-open/ghooks/actions/workflows/R-CMD-check.yaml)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
<!-- badges: end -->
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.
<details>
<summary>Click here to see the content of `app_ui` and `app_server` from `geyser_hook`</summary>
```{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"
)
```
</details>
## 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()
```