Is there somewhere a complete list of predefined CSS properties that can be used in R Markdown documents?
Some options are listed in the R Markdown/R Studio/Bookdown documentation, but I'm pretty sure this is not an exhaustive list.
For example
HTML
.tabset
.tabset-fade
.tabset-pills
ioslides
.smaller
data-background
data-background-size
答案 0 :(得分:2)
您可以遵循从功能到基本模板以及支持组件的路径:
https://github.com/rstudio/rmarkdown/blob/0ff85d8db1c1b75386cc752062f6016884709139/R/html_document.R#L265 => https://github.com/rstudio/rmarkdown/blob/0ff85d8db1c1b75386cc752062f6016884709139/inst/rmd/h/default.html => https://github.com/rstudio/rmarkdown/tree/ec8fd0fe0cb82d1a2a0160c8e728486ca45c9891/inst/rmd/h
这可能会令人沮丧(尽管值得研究幕后的魔术),因为其中没有包含这些定义的CSS文件。
另一种方法是使用以下参数创建测试HTML R Markdown文档:
output:
html_document:
self_contained: false
keep_md: true
并在浏览器中的开发人员工具中检查目标元素:
仔细查看会发现RStudiotian依赖于bootstrap作为基础样式(我故意没有将鼠标光标放在<div>
元素上,因此您应该进行探索并发现它仍然存在依靠引导程序。
前一段时间,我一起浏览了一组示例R Markdown模板,以便人们可以看到香肠的制作方法并制作自己的模板。 (https://gitlab.com/hrbrmstr/markdowntemplates)在转换过程中查看所有位的来源可能很方便。
R Markdown ioslides
文档类型的CSS在这里:https://github.com/rstudio/rmarkdown/tree/master/inst/rmd/ioslides/ioslides-13.5.1/theme/css