Set the code-fold
chunk option to show
or false
:
---
code-fold: true
---
```
# Block to fold initially
```
```
#| code-fold: show
# Block to keep unfolded initially
```
```
#| code-fold: false
# This block is always shown and not foldable
```
Here's the relevant page in the quarto guide.