Skip to content

eval and echo supports numbers for knitr engine per documentation, but YAML validation fails #12178

Open
@cderv

Description

@cderv

I did not use eval: -2 (in-chunk YAML syntax) because that gets rejected before rendering.

In file test.qmd
(line 8, columns 10--12) Field "eval" has value -2, which must instead be `true` or `false`
7: ```{r}
8: #| eval: -2
           ~~~
9: if (TRUE) {
✖ The value -2 is of type number.
ℹ The error happened in location eval.

ERROR: Validation of YAML cell metadata failed.
ERROR: Render failed due to invalid YAML.

Originally posted by @fkohrt in #12164

- name: echo
tags:
contexts: [document-execute]
execute-only: true
schema:
anyOf:
- boolean
- enum: [fenced]
errorDescription: "be `true`, `false`, or `fenced`"
description:
short: Include cell source code in rendered output.
long: |
Include cell source code in rendered output.
- `true` (default in most formats): include source code in output
- `false` (default in presentation formats like `beamer`, `revealjs`, and `pptx`): do not include source code in output
- `fenced`: in addition to echoing, include the cell delimiter as part of the output.
- `[...]`: A list of positive or negative line numbers to selectively include or exclude lines
(explicit inclusion/excusion of lines is available only when using the knitr engine)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestknitryaml-validationIssues with YAML validation and autocompletion in quarto

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions