File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ S3method(print,bslib_fragment)
9
9
S3method(print,bslib_page)
10
10
S3method(print,bslib_showcase_layout)
11
11
S3method(print,bslib_value_box_theme)
12
+ S3method(save_html,bslib_fragment)
13
+ S3method(save_html,bslib_page)
12
14
export(accordion)
13
15
export(accordion_panel)
14
16
export(accordion_panel_close)
Original file line number Diff line number Diff line change @@ -36,3 +36,18 @@ print.bslib_page <- function(x, ...) {
36
36
37
37
invisible (NextMethod())
38
38
}
39
+
40
+ # ' @export
41
+ save_html.bslib_fragment <- function (html , file , ... ) {
42
+ html <- attr(html , " bslib_page" )(html )
43
+ save_html(html , file , ... )
44
+ }
45
+
46
+ # ' @export
47
+ save_html.bslib_page <- function (html , file , ... ) {
48
+ old_theme <- bs_global_get()
49
+ bs_global_set(attr(html , " bs_theme" , exact = TRUE ))
50
+ on.exit(bs_global_set(old_theme ), add = TRUE )
51
+
52
+ NextMethod()
53
+ }
You can’t perform that action at this time.
0 commit comments