Language Cell Decorator

The language name, on the code block.

What the language-cell-decorator extension did, why Code Window supersedes it, and how to move across.
WarningSuperseded by Code Window

This extension is no longer developed. Code Window replaces it: it labels code blocks with their language by default, and adds window-style decorations besides.

These pages document language-cell-decorator for the projects still using it, and describe the move.

A code block in a Quarto document carries its language in a class, and shows it nowhere. A reader scanning a page of examples has to infer from the syntax which language each block is written in.

language-cell-decorator put the name back on the block.

Moving to Code Window

BASH
quarto remove mcanouil/quarto-language-cell-decorator
quarto add mcanouil/quarto-code-window
YAML
filters:
  - code-window

Code Window shows the language by default, so nothing else is needed to get what this extension did. Its own documentation covers the rest: https://m.canouil.dev/quarto-code-window.

Installation

Still available, for projects that have not moved yet:

BASH
quarto add mcanouil/quarto-language-cell-decorator@0.4.3

This will install the extension under the _extensions subdirectory. If you are using version control, you will want to check in this directory.

Or install it from your editor with Quarto Wizard:

Quick start

YAML
filters:
  - language-cell-decorator

Then write code blocks as usual:

MARKDOWN
```r
summary(cars)
```
R
summary(cars)

The block above is decorated by the extension as this page renders.

See the Reference for the filename label, and the Examples for blocks in several languages.

Where it works

HTML formats, including RevealJS, draw the language above the block. PDF turns the block into a code listing captioned with the language. Typst and Word leave the block as it was.

Back to top