From 342327290d7c7eb29e1d2839674566a2cb5ef41d Mon Sep 17 00:00:00 2001 From: Omzee <81947646+Omzee15@users.noreply.github.com> Date: Fri, 21 Nov 2025 13:52:11 +0530 Subject: [PATCH] docs: add tree-sitter grammar and comprehensive editor support (#200) * docs: add tree-sitter grammar and editor support documentation - Add comprehensive Editor Support section to README.md - Document tree-sitter-toon grammar with usage examples - Include VS Code extension information - Add Neovim configuration example for tree-sitter - Update tools-and-playgrounds.md with detailed editor support - Add Editor Support to table of contents Resolves #143 Resolves #99 * docs: simplify --------- Co-authored-by: Johann Schopplich --- README.md | 23 +++++++++++++++++++++++ docs/ecosystem/tools-and-playgrounds.md | 24 +++++++++++++++++++----- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 73d0e60..36e59f9 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Think of it as a translation layer: use JSON programmatically, and encode it as - [Benchmarks](#benchmarks) - [Installation & Quick Start](#installation--quick-start) - [Playgrounds](#playgrounds) +- [Editor Support](#editor-support) - [CLI](#cli) - [Format Overview](#format-overview) - [Using TOON with LLMs](#using-toon-with-llms) @@ -770,6 +771,28 @@ Experiment with TOON format interactively using these community-built tools for - [Format Tokenization Playground](https://www.curiouslychase.com/playground/format-tokenization-exploration) - [TOON Tools](https://toontools.vercel.app/) +## Editor Support + +### VS Code + +[TOON Language Support](https://marketplace.visualstudio.com/items?itemName=vishalraut.vscode-toon) - Syntax highlighting, validation, conversion, and token analysis. + +```bash +code --install-extension vishalraut.vscode-toon +``` + +### Tree-sitter Grammar + +[tree-sitter-toon](https://github.com/3swordman/tree-sitter-toon) - Grammar for Tree-sitter-compatible editors (Neovim, Helix, Emacs, Zed). + +### Neovim + +[toon.nvim](https://github.com/thalesgelinger/toon.nvim) - Lua-based plugin. + +### Other Editors + +Use YAML syntax highlighting as a close approximation. + ## CLI Command-line tool for quick JSON↔TOON conversions, token analysis, and pipeline integration. Auto-detects format from file extension, supports stdin/stdout workflows, and offers delimiter options for maximum efficiency. diff --git a/docs/ecosystem/tools-and-playgrounds.md b/docs/ecosystem/tools-and-playgrounds.md index 668d85f..694de22 100644 --- a/docs/ecosystem/tools-and-playgrounds.md +++ b/docs/ecosystem/tools-and-playgrounds.md @@ -19,13 +19,27 @@ npx @toon-format/cli input.json --stats -o output.toon ## Editor Support -TOON syntax highlighting is available for popular editors: +### VS Code -- **VS Code**: Use YAML syntax highlighting as a close approximation (`.toon` files can be associated with YAML language mode). -- **Vim/Neovim**: [toon.nvim](https://github.com/thalesgelinger/toon.nvim) +[TOON Language Support](https://marketplace.visualstudio.com/items?itemName=vishalraut.vscode-toon) - Syntax highlighting, validation, conversion, and token analysis. -> [!NOTE] -> Native TOON syntax highlighting extensions are in development. Contributions welcome! +Install from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=vishalraut.vscode-toon) or via command line: + +```bash +code --install-extension vishalraut.vscode-toon +``` + +### Tree-sitter Grammar + +[tree-sitter-toon](https://github.com/3swordman/tree-sitter-toon) - Grammar for Tree-sitter-compatible editors (Neovim, Helix, Emacs, Zed). + +### Neovim + +[toon.nvim](https://github.com/thalesgelinger/toon.nvim) - Lua-based plugin for Neovim. + +### Other Editors + +Use YAML syntax highlighting as a close approximation. Most editors allow associating `.toon` files with YAML language mode. ## Web APIs