Skip to content

Information about the seemingly new ansi-escaped-output class is missing from 1.7 release notes (and all documentation?) #12966

@jamesowers-cohere

Description

@jamesowers-cohere

What would you like to do?

Report an issue on quarto.org

Description

My site behaved very strangely today when I upgraded to quarto 1.7 (specifically 1.7.32) - my code outputs containing colour suddenly went all squiffy. This is because I had some custom CSS with a class to enable code cell output scrolling. I checked the HTML and saw a new class: ansi-escaped-output.

Firstly, excellent! I've been wanting coloured code output for ages. Thank you for implementing this.

But please may you add some documentation about this, and perhaps mention it in the 1.7 release notes? I can't find any reference to it in https://quarto.org/docs/download/changelog/1.7, and searching for "ansi-escaped-output", or even simply "ansi" does not return any useful results.

Details about the custom CSS and why I needed it (not really relevant to this issue)

I'd made a styles.css to:

  1. Add a scroll-output class for code cells such that cells with code resulting in long outputs don't take up too much vertical space; they scroll
  2. Add a background colour to code cell output to better distinguish them from the rest of the document
/* css styles */

.scroll-output .cell-output-stdout {
    max-height: 500px;
    display: flex;
}

.scroll-output .cell-output-stdout pre {
    overflow: auto;
    flex-direction: column-reverse;
    display: flex;
}

/* TODO: make scroll-output work for jupyter notebook output cells which use .cell-output-display */

/* TODO: I don't know what I'm doing. I just went into the browser and tried to match colours with the code block.
               This would be much better done dynamically because, as and when we change default style, this will be
               static, and look weird. */
.cell-output-stdout pre code {
    background-color: rgba(233,236,239,.25);
    border-left: 5px solid rgba(233,236,239,.75);
    padding-left: 5px;
}

.cell-output-display pre code {
    background-color: rgba(233,236,239,.25);
    border-left: 5px solid rgba(233,236,239,.75);
    padding-left: 5px;
}

Example usage:

```{bash}
#| classes: scroll-output
code_with_long_output
```
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationDoc improvements & quarto-web

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions