26
26
# '
27
27
# ' @return The path to the file, invisibly.
28
28
add_module <- function (
29
- name ,
30
- pkg = get_golem_wd(),
31
- open = TRUE ,
32
- dir_create = TRUE ,
33
- fct = NULL ,
34
- utils = NULL ,
35
- r6 = NULL ,
36
- js = NULL ,
37
- js_handler = NULL ,
38
- export = FALSE ,
39
- module_template = golem :: module_template ,
40
- with_test = FALSE ,
41
- ...
42
- ) {
29
+ name ,
30
+ pkg = get_golem_wd(),
31
+ open = TRUE ,
32
+ dir_create = TRUE ,
33
+ fct = NULL ,
34
+ utils = NULL ,
35
+ r6 = NULL ,
36
+ js = NULL ,
37
+ js_handler = NULL ,
38
+ export = FALSE ,
39
+ module_template = golem :: module_template ,
40
+ with_test = FALSE ,
41
+ ... ) {
43
42
# Let's start with the checks for the validity of the name
44
43
check_name_length_is_one(name )
45
44
check_name_syntax(name )
@@ -187,13 +186,12 @@ add_module <- function(
187
186
# ' @export
188
187
# ' @seealso [add_module()]
189
188
module_template <- function (
190
- name ,
191
- path ,
192
- export ,
193
- ph_ui = " " ,
194
- ph_server = " " ,
195
- ...
196
- ) {
189
+ name ,
190
+ path ,
191
+ export ,
192
+ ph_ui = " " ,
193
+ ph_server = " " ,
194
+ ... ) {
197
195
write_there <- function (... ) {
198
196
write(... , file = path , append = TRUE )
199
197
}
@@ -204,6 +202,7 @@ module_template <- function(
204
202
write_there(" #'" )
205
203
write_there(" #' @param id,input,output,session Internal parameters for {shiny}." )
206
204
write_there(" #'" )
205
+ write_there(" #' @shinyModule A Golem module." )
207
206
if (export ) {
208
207
write_there(sprintf(" #' @rdname mod_%s" , name ))
209
208
write_there(" #' @export " )
@@ -274,10 +273,9 @@ module_template <- function(
274
273
# ' @return Used for side effect. Returns the path invisibly.
275
274
# ' @export
276
275
use_module_test <- function (
277
- name ,
278
- pkg = get_golem_wd(),
279
- open = TRUE
280
- ) {
276
+ name ,
277
+ pkg = get_golem_wd(),
278
+ open = TRUE ) {
281
279
# Remove the extension if any
282
280
name <- file_path_sans_ext(name )
283
281
# Remove the "mod_" if any
0 commit comments