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)

rendertest

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

Example

Print a tibble:

as_tibble(cars)

unicode

Print some unicode: Plain old unicode seems to work.

Ā ā Ġ ☂

Example Crayon

print using crayon directly

cat(blue("Hello", "world!\n"))

Set options in yaml

    - 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

session

sessioninfo::session_info()


mps9506/rendertest documentation built on Sept. 25, 2020, 4:06 a.m.