You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just discovered the class.source and class.output options introduced in #1335 and really appreciate this feature for adding CSS classes to chunk outputs in HTML. But I noticed that the class.output value is not added to outputs from "side effect" chunk outputs, such as messages, warnings and errors.
It would be great if this class could be applied to messages, warnings and errors as well. I would even more appreciate it if each of these could receive a custom CSS class -- perhaps class.message, class.warning, class.error -- that defaults to class.output if not otherwise specified.
Here's a small demo reprex.
RMD source
---
title: "class.output for messages, warnings, errors"
output: html_document
---
```{r setup}
# setup
knitr::opts_chunk$set(echo = TRUE, class.output = "output-style")
```
```{css}
/* class.output */
.output-style {
background: #A2CD5A;
}
```
```{r}
cat("Normal R chunk output")
```
```{r, error = TRUE}
stop("An error occurred in this chunk.")
```
```{r}
message("This is a message")
```
```{r}
warning("This is a warning")
```
The text was updated successfully, but these errors were encountered:
Btw, I looked in NEWS.md and thought this would be in version 1.22, but I just noticed you put this issue in the v1.21 milestone. Let me know if I need to revise my post.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
I just discovered the
class.source
andclass.output
options introduced in #1335 and really appreciate this feature for adding CSS classes to chunk outputs in HTML. But I noticed that theclass.output
value is not added to outputs from "side effect" chunk outputs, such as messages, warnings and errors.It would be great if this class could be applied to messages, warnings and errors as well. I would even more appreciate it if each of these could receive a custom CSS class -- perhaps
class.message
,class.warning
,class.error
-- that defaults toclass.output
if not otherwise specified.Here's a small demo reprex.
RMD source
The text was updated successfully, but these errors were encountered: