37
37
38
38
frame_element_template = '''`{dep_name}` = structure(list(name = "{dep_name}",
39
39
version = "{project_ver}", src = list(href = NULL,
40
- file = "deps/ "), meta = NULL,
40
+ file = "deps"), meta = NULL,
41
41
script = "{dep_rpp}",
42
42
stylesheet = NULL, head = NULL, attachment = NULL, package = "{rpkgname}",
43
43
all_files = FALSE), class = "html_dependency")'''
44
44
45
45
frame_body_template = '''`{project_shortname}` = structure(list(name = "{project_shortname}",
46
46
version = "{project_ver}", src = list(href = NULL,
47
- file = "deps/ "), meta = NULL,
47
+ file = "deps"), meta = NULL,
48
48
script = "{dep_rpp}",
49
49
stylesheet = NULL, head = NULL, attachment = NULL, package = "{rpkgname}",
50
50
all_files = FALSE), class = "html_dependency")''' # noqa:E501
65
65
}}
66
66
67
67
\\ usage{{
68
- {prefix}{name}({default_argtext}, ... )
68
+ {prefix}{name}({default_argtext})
69
69
}}
70
70
71
71
\\ arguments{{
78
78
Version: {package_version}
79
79
Authors @R: as.person(c({package_author}))
80
80
Description: {package_description}
81
- Depends: R (>= 3.5.0)
81
+ Depends: R (>= 3.0.2)
82
+ Imports: dashR
82
83
Suggests: testthat, roxygen2
83
84
License: {package_license}
84
85
URL: {package_url}
@@ -223,8 +224,7 @@ def generate_class_string(name, props, project_shortname, prefix):
223
224
def generate_js_metadata (pkg_data , project_shortname ):
224
225
"""
225
226
Dynamically generate R function to supply JavaScript
226
- dependency information required by htmltools package,
227
- which is loaded by dashR.
227
+ and CSS dependency information required by dashR package.
228
228
229
229
Parameters
230
230
----------
@@ -305,9 +305,6 @@ def write_help_file(name, props, description, prefix):
305
305
default_argtext = ''
306
306
item_text = ''
307
307
308
- # Ensure props are ordered with children first
309
- props = reorder_props (props = props )
310
-
311
308
prop_keys = list (props .keys ())
312
309
313
310
has_wildcards = any ('-*' in key for key in prop_keys )
@@ -331,6 +328,7 @@ def write_help_file(name, props, description, prefix):
331
328
332
329
if has_wildcards :
333
330
item_text += '\n \n \\ item{...}{wildcards: `data-*` or `aria-*`}'
331
+ default_argtext += ', ...'
334
332
335
333
file_path = os .path .join ('man' , file_name )
336
334
with open (file_path , 'w' ) as f :
@@ -350,6 +348,18 @@ def write_class_file(name,
350
348
prefix = None ):
351
349
props = reorder_props (props = props )
352
350
351
+ # generate the R help pages for each of the Dash components that we
352
+ # are transpiling -- this is done to avoid using Roxygen2 syntax,
353
+ # we may eventually be able to generate similar documentation using
354
+ # doxygen and an R plugin, but for now we'll just do it on our own
355
+ # from within Python
356
+ write_help_file (
357
+ name ,
358
+ props ,
359
+ description ,
360
+ prefix
361
+ )
362
+
353
363
import_string = \
354
364
"# AUTO GENERATED FILE - DO NOT EDIT\n \n "
355
365
class_string = generate_class_string (
@@ -365,26 +375,13 @@ def write_class_file(name,
365
375
f .write (import_string )
366
376
f .write (class_string )
367
377
368
- # generate the R help pages for each of the Dash components that we
369
- # are transpiling -- this is done to avoid using Roxygen2 syntax,
370
- # we may eventually be able to generate similar documentation using
371
- # doxygen and an R plugin, but for now we'll just do it on our own
372
- # from within Python
373
- write_help_file (
374
- name ,
375
- props ,
376
- description ,
377
- prefix
378
- )
379
-
380
378
print ('Generated {}' .format (file_name ))
381
379
382
380
383
381
def write_js_metadata (pkg_data , project_shortname ):
384
382
"""
385
383
Write an internal (not exported) R function to return all JS
386
- dependencies as required by htmltools package given a
387
- function string
384
+ dependencies as required by dashR.
388
385
389
386
Parameters
390
387
----------
@@ -488,10 +485,8 @@ def generate_rpkg(pkg_data,
488
485
pkghelp_stub_path = os .path .join ('man' , package_name + '-package.Rd' )
489
486
490
487
# generate the internal (not exported to the user) functions which
491
- # supply the JavaScript dependencies to the htmltools package,
492
- # which is required by DashR (this avoids having to generate an
493
- # RData file from within Python, given the current package generation
494
- # workflow)
488
+ # supply the JavaScript dependencies to the dashR package.
489
+ # this avoids having to generate an RData file from within Python.
495
490
write_js_metadata (
496
491
pkg_data = pkg_data ,
497
492
project_shortname = project_shortname
0 commit comments