Esc

COMARK0424 · warning

comark/charts/invalid-spec-json

Write a Vega-Lite spec as one JSON object

The vega-lite block is read as JSON, and it must be one object. A trailing comma, a comment, or a key without quotes stops it from parsing, and the block shows the table and the spec as they are.

Incorrect

::chart{title="Ducks per pond"}
| pond | ducks |
| --- | --: |
| north | 12 |
| south | 7 |
| east | 9 |

```vega-lite
{
  "mark": "bar",
  "encoding": {
    "x": { "field": "pond", "type": "nominal" },
    "y": { "field": "ducks", "type": "quantitative" },
  }
}
```
::
md
lint-comark example.mdexample.md:1:1 comark/charts/invalid-spec-json::chart 1: its Vega-Lite spec isn't valid JSON (Expected double-quoted property name in JSON at position 141 (line 6 column 3)).Fix it, or remove the vega-lite block to let comark-charts choose the chart.✖ 1 problem

Correct

::chart{title="Ducks per pond"}
| pond | ducks |
| --- | --: |
| north | 12 |
| south | 7 |
| east | 9 |

```vega-lite
{
  "mark": "bar",
  "encoding": {
    "x": { "field": "pond", "type": "nominal" },
    "y": { "field": "ducks", "type": "quantitative" }
  }
}
```
::
md
lint-comark example.md✔ No problems