Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quarto Fold Code Extension

Quarto's built-in option for folding code only covers executable cell output. This extension allows non-executable fenced code blocks to be wrapped in a <details> toggle.

Prerequisites

Requires Quarto >= 1.4.0.

Install

quarto add beck-chan/quarto-foldcode

Usage

Add the filter to the YAML frontmatter on a .qmd file or your top-level _quarto.yml:

filters:
  - fold-code

Examples

Add fold=true or .fold to a fenced code block to collapse it:

```{.yaml fold=true}
key: value
```
```{.yaml .fold}
key: value
```

Start expanded with a custom summary label:

```{.yaml fold=false summary="Show config"}
key: value
```

Reference

{.fold} on the block is the same as fold=true.

Attribute Values Default
fold true — collapsed; false — expanded off
summary summary label text show code

Support

If you liked this extension and found it useful, please consider donating via Ko-fi: https://ko-fi.com/beckchan

About

Quarto Extension for folding non-executed code blocks.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages