Summary
notion block append --file <md> passes markdown code-fence language strings straight to the Notion API, which only accepts a fixed enum (typescript, javascript, shell, …). Common short aliases (ts, js, sh, py, yml, …) therefore fail hard.
Repro
cat > /tmp/test.md <<'EOF'
```ts
const x: number = 1;
EOF
notion block append --file /tmp/test.md
Error: append block: validation_error: body failed validation:
body.children[N].code.language should be "abap", "abc", ...
"typescript", "yaml", or "java/c/c++/c#", instead was "ts".
## Expected
CLI should normalize common aliases at markdown-parse time before serializing the request, since the Notion enum is fixed and well-known. Unknown values should fall back to `plain text` with a warning rather than a hard error.
Suggested alias table:
| User writes | Map to |
|---|---|
| `ts` | `typescript` |
| `tsx` | `typescript` |
| `js` | `javascript` |
| `jsx` | `javascript` |
| `py` | `python` |
| `rb` | `ruby` |
| `rs` | `rust` |
| `sh` / `zsh` / `bash` | `shell` (note: `bash` is actually in the enum, so no-op) |
| `yml` | `yaml` |
| `md` | `markdown` |
| `Dockerfile` / `dockerfile` | `docker` |
| `proto` | `protobuf` |
| *(empty / unset)* | `plain text` |
| *(unknown)* | `plain text` + stderr warn: `unknown code language "foo", falling back to plain text` |
## Current workaround
```bash
sed -i 's/^```ts$/```typescript/' file.md
# and similar for each alias in the file
Priority
Medium — trivial to fix and prevents a confusing error message on almost every markdown file produced by modern editors / LLMs.
Summary
notion block append --file <md>passes markdown code-fence language strings straight to the Notion API, which only accepts a fixed enum (typescript,javascript,shell, …). Common short aliases (ts,js,sh,py,yml, …) therefore fail hard.Repro
echo helloEOF
notion block append --file /tmp/test.md
Error: append block: validation_error: body failed validation:
body.children[N].code.language should be
"abap","abc", ..."typescript","yaml", or"java/c/c++/c#", instead was"ts".Priority
Medium — trivial to fix and prevents a confusing error message on almost every markdown file produced by modern editors / LLMs.