Skip to content

Commit

Permalink
add assets copy-button and heading-anchor to default site/book ou…
Browse files Browse the repository at this point in the history
…tput
  • Loading branch information
yihui committed Dec 16, 2024
1 parent 776d1f9 commit 06a5de4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/site.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ fuse_site = function(input = '.') {
}
opts = yaml_field(info$yaml, 'html', c('meta', 'options'))
opts[['meta']] = merge_list(list(
css = c("@default", "@article", '@site'),
js = c("@sidenotes", "@appendix", "@toc-highlight"),
css = c("@default", "@article", '@site', "@copy-button", "@heading-anchor"),
js = c("@sidenotes", "@appendix", "@toc-highlight", "@copy-button", "@heading-anchor"),
include_before = nav_menu(info), include_after = format(Sys.Date(), '© %Y')
), opts[['meta']])
opts[['options']] = merge_list(
Expand Down Expand Up @@ -252,8 +252,9 @@ fuse_book = function(input = '.', output = NULL, envir = parent.frame()) {
)
})
tweak_options(format, yaml, list(
body_class = '', css = c("@default", "@article", "@book"),
js = c("@sidenotes", "@appendix", "@toc-highlight")
body_class = '',
css = c("@default", "@article", "@book", "@copy-button", "@heading-anchor"),
js = c("@sidenotes", "@appendix", "@toc-highlight", "@copy-button", "@heading-anchor")
), toc = length(preview) == 0)
fuse_output(input[1], output, unlist(res), full)
}
Expand Down

0 comments on commit 06a5de4

Please sign in to comment.