You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 90a04bd
Browse filesBrowse the repository at this point in the historyBrowse files
authored
feat(docs): add YAML input to Playground with tests (#303)
* feat(docs): add YAML input to Playground with tests
- Add input format selector and YAML parsing (YAML 1.2, merge keys off)
- Extract parse/stringify helpers for testability and SPEC-aligned encoding
- Add Vitest for docs package and playground parse tests
- Update Playground copy in package README and ecosystem docs
* refactor(docs): simplify Playground YAML support
- Inline parse/stringify helpers into the component, drop the separate
parse-input module and its tests
- Rename input state from `jsonInput`/`formattedJson`/`jsonTokens` to
`inputText`/`formattedInput`/`inputTokens` so names no longer lie when
YAML is selected
- Hide the JSON Baseline selector in YAML mode and make the token-count
tooltip conditional on input format
- Store input under `state.input` with a fallback read of legacy
`state.json` so existing share URLs keep working
- Drop redundant YAML parse options (merge/version match library
defaults); use lineWidth: 0 for editor display so long scalars do not
fold mid-sentence
- Remove the duplicated vitest devDep, docs vitest.config.ts, and `test`
script – the playground is verified through the dev server
* chore(docs): tighten Playground wording and drop empty-string fallback
- "in real-time" → "in real time" (real-time only hyphenates as a
compound modifier before a noun)
- Header copy now matches the ecosystem page: "Convert JSON or YAML to
TOON in real time"
- Token-count tooltip unified across input formats; the JSON baseline
selector is right next to it and already communicates the format
- Drop `?? ''` fallback on state.input — decodeState already gates on
successful JSON parse; the chain falls through to the legacy
state.json field
---------
Co-authored-by: Sweta <[email protected]>
Co-authored-by: Johann Schopplich <[email protected]>
Copy file name to clipboardExpand all lines: packages/toon/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -817,7 +817,7 @@ Experiment with TOON format interactively using these tools for token comparison
817
817
818
818
### Official Playground
819
819
820
-
The [TOON Playground](https://toonformat.dev/playground) lets you convert JSON to TOON in real-time, compare token counts, and share your experiments via URL.
820
+
The [TOON Playground](https://toonformat.dev/playground) lets you convert JSON or YAML to TOON in realtime, compare token counts, and share your experiments via URL.
0 commit comments