qiushi 明白了,谢谢。难怪我看bslib包官网的change log显示这个包之前已经出过好几个版本了。
此处歪个楼,就是bslib包在R里面的模板直接knit会报错。
详细描述如下:打开Rstudio-->File-->New File-->RMarkdown-->From Template然后选择{bslib}的模板,打开后直接点击knit会报一个这样的错
Error in curl::curl_download(url, dest, handle = handle, quiet = FALSE, :
Timeout was reached: [] Connection timed out after 10000 milliseconds
这是因为模板中引用了谷歌的字体,于是被神秘力量阻挡了,把设置字体的那几行代码删去就能正常knit出来了。
title: "Theming with bslib and thematic"
output:
html_document:
code_folding: show
theme:
bg: "#202123"
fg: "#B8BCC2"
primary: "#EA80FC"
secondary: "#00DAC6"
# base_font:
# google: Prompt
# heading_font:
# google: Proza Libre
另外 模板中{.tabset .tabset-pills}这个设置可在在输出html文件时也能切换页面了,蛮有意思的。