knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) library(tibble) library(crayon) ## from: https://github.com/r-lib/crayon/issues/96 # options(crayon.enabled = NULL)
Trying to figure out encoding problems when I use github actions to render readme and pkgdown websites.
.Platform
crayon::has_color()
er <- errorCondition( message = paste("crayon::has_color() ?:", crayon::has_color(), "\nresult:", crayon::red("A barfoo error"))) er
Print a tibble:
as_tibble(cars)
Print some unicode: Plain old unicode seems to work.
Ā ā Ġ ☂
print using crayon directly
cat(blue("Hello", "world!\n"))
- uses: r-lib/actions/setup-r@v1 with: crayon.enabled: FALSE
reset option
options(crayon.enabled = TRUE) cat(blue("Hello", "world!\n")) as_tibble(cars)
Try fansi
old.hooks <- fansi::set_knit_hooks(knitr::knit_hooks)
check output
cat(blue("Hello", "world!\n")) as_tibble(cars) er
sessioninfo::session_info()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.