Language Cell Decorator
The language name, on the code block.
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-windowYAML
filters:
- code-windowCode 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.3This 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-decoratorThen 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.
Links
- Code Window, the replacement.
- Reference for the filename label.
- Examples for decorated blocks.
- Changelog for what each release changed.
- Source and issues on GitHub.