Skip to content
Discussion options

You must be logged in to vote

This is handled by downlit in R packages like pkgdown and "just works"

@mccarthy-m-g This is only working in pkgdown context right ? Or do you also get coloring working in R Markdown document ?

cli does ANSI coloring, and not HTML coloring. So to make in work in a HTML rendered document, downlit is converting to HTML highlighting (with help of fansi 📦. Moreover, I think by default cli function deactivate ANSI coloring in a knitting context. So it needs to be reactivated to be then handled by downlit.

Also I believe pkgdown is doing a special post processing before downlit as ANSI escape character can be lost otherwise.

All that above explain that this does not "just works" currently wit…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@cscheid
Comment options

Comment options

You must be logged in to vote
5 replies
@cscheid
Comment options

@mccarthy-m-g
Comment options

@cderv
Comment options

@mccarthy-m-g
Comment options

@cderv
Comment options

Answer selected by mccarthy-m-g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants