html - 将颜色主题更改为 HTML markdown

标签 html css r r-markdown background-color

我正在尝试更改 HTML Markdown 背景,但我做不到。例如,'cerulean' 主题有白色背景,这很烦人,因为我的眼睛很快就会疲劳。

我知道 prettydoc 中有很多主题,tint 等等,但我想知道如何使用 CSS 更改主题的背景颜色、字体样式和字体颜色。

最佳答案

**Themes for R Markdown**
*With the powerful rmarkdown package, we could easily create nice HTML document by adding some meta information in the header, for example*
-------------
title: Nineteen Years Later
author: S M Sharif Mia
date: feb 03, 2019
output:
  rmarkdown::html_document:
    theme: lumen
----------------
*The html_document engine uses the Bootswatch theme library to support different styles of the document. This is a quick and easy way to tune the appearance of your document, yet with the price of a large file size (> 700KB) since the whole Bootstrap library needs to be packed in.
For package vignettes, we can use the html_vignette engine to generate a more lightweight HTML file that is meant to minimize the package size, but the output HTML is less stylish than the html_document ones.*

**The prettydoc Engine**
*The prettydoc package provides an alternative engine, html_pretty, to knit your R Markdown document into pretty HTML pages. Its usage is extremely easy: simply replace the rmarkdown::html_document or rmarkdown::html_vignette output engine by prettydoc::html_pretty in your R Markdown header, and use one of the built-in themes and syntax highlighters. For example*
---
title: Nineteen Years Later
author: S M Sharif Mia
date: feb 03, 2019
output:
  prettydoc::html_pretty:
    theme: cayman
    highlight: github
---
**Options and Themes**
*The options for the html_pretty engine are mostly compatible with the default html_document (see the documentation) with a few exceptions:*

 1. Currently the theme option can take the following values. More themes will be added in the future. 
  = cayman: Modified from the Cayman theme.
  = tactile: Modified from the Tactile theme.
  = architect: Modified from the Architect theme.
  = leonids: Modified from the Leonids theme.
  = hpstr: Modified from the HPSTR theme.
 2. The highlight option takes value from github and vignette.
 3. Options code_folding, code_download and toc_float are not applicable.

关于html - 将颜色主题更改为 HTML markdown,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54502270/

相关文章:

javascript - Twitter 新移动网络体验背后的技术

javascript - 调用 json 中的第一个字符串

javascript - 使用 jquery 的 float 表单

r - 如何在 Shiny 模块中使用 ShinyFiles 包 - 命名空间问题?

javascript - 未捕获的语法错误 : Unexpected identifier in Spring MVC JSP

javascript - 缩短响应表中单词的最佳方法

html - CSS:如何修复不必要的间隙

javascript - 如何更改压缩圆d3中圆的对齐方式

R 中的递归回归(提取残差)

r - 将函数应用于 R 中矩阵的每个单元格