| colors_solarized_light | R Documentation |
Syntax highlighting theme building tools
colors_solarized_light() copy_base_pandoc_theme(path) set_theme_text_style(data, name, ...) patch_theme_text_style(data, data_patches) write_pandoc_theme(data, output_path)
path |
Path where to save pandoc's built-in syntax highlighting theme. |
data |
List containing data from a syntax highlighting theme's JSON file. |
name |
String name of the text styles to modify (e.g., |
... |
Key-value pairs setting the style appearance. The keys can be one
of the color setters: |
data_patches |
Alternatively, we can provide provide a list of patches
and use those to call |
output_path |
Path where to write out a pandoc syntax highlighting theme JSON file. |
copy_base_pandoc_theme(path) saves the pandoc syntax highlighting
theme's JSON data to path and returns the path invisibly.
set_theme_text_style() and patch_theme_text_style() return a modified
syntax highlighting theme. write_pandoc_theme() writes out the pandoc
syntax highlighting theme to a JSON file and invisibly returns the original
data. colors_solarized_light() returns a list with the solarized light
colors.
Solarized Light Theme colors via https://github.com/altercation/solarized#the-values
## Not run:
s <- tempfile()
copy_base_pandoc_theme(s)
data_theme <- jsonlite::read_json(s)
str(data_theme, max.level = 2)
str(data_theme$`text-styles`$Comment)
# Interactive (pipe-able) interface
# bold pink roman comments
my_theme <- set_theme_text_style(
data_theme,
"Comment",
text = "#ff748c",
bold = TRUE,
italic = FALSE
)
str(my_theme$`text-styles`$Comment)
# Patching interface
# Stub for a Fairy Floss theme https://github.com/sailorhg/fairyfloss
data_theme_patches <- list(
global = list(text = "#F8F8F2", background = "#5A5475"),
Function = list(text = "#C2FFDF"),
Operator = list(text = "#FFB8D1"),
Float = list(text = "#C5A3FF")
)
my_theme2 <- patch_theme_text_style(data_theme, data_theme_patches)
str(my_theme2$`text-styles`$Function)
str(my_theme2$`text-styles`$Float)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.