ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

TOON

by mpgirro ALL

TOON Syntax Highlighting for Sublime Text 3

Details

Installs

  • Total 5
  • Win 1
  • Mac 1
  • Linux 3
Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31
Windows 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0

Readme

Source
raw.​githubusercontent.​com

TOON for Sublime Text

CI

Syntax highlighting for TOON (Token-Oriented Object Notation) in Sublime Text - and in bat, which reads the same .sublime-syntax format.

Installation

Package Control

Once the package is accepted: Command Palette > Package Control: Install Package > TOON.

Manual (Sublime Text)

Clone into your Packages/ directory as TOON (macOS path shown):

git clone https://github.com/mpgirro/sublime-toon-syntax.git \
  "$HOME/Library/Application Support/Sublime Text 3/Packages/TOON"

bat

Until bundled with bat itself, install as a local syntax:

mkdir -p "$(bat --config-dir)/syntaxes"
git clone https://github.com/mpgirro/sublime-toon-syntax.git "$(bat --config-dir)/syntaxes/sublime-toon-syntax"
bat cache --build
bat sample.toon   # highlighted

What gets highlighted

Comments, keys (quoted and unquoted), array headers with length markers [N], delimiter markers (, / tab / |) and {field,lists}, list items and their payloads (- key: value, nested headers), double-quoted strings with escape validation, numbers, true/false/null, inline primitive arrays (tags[3]: a,b,c), and tabs in indentation flagged as invalid.

Tabular rows are delimiter-aware: only the delimiter declared in the header separates cells, and primitives highlight as complete cells only - v1.2 stays plain, 7 lights up (see docs/adr/0003-delimiter-aware-rows.md).

Development

# Symlink for live development (macOS); the name TOON matters
ln -s "$PWD" "$HOME/Library/Application Support/Sublime Text 3/Packages/TOON"

Tests live in syntax_test_toon.toon. Run them inside Sublime via Tools > Build, or headlessly with syntect's test runner (this also proves bat compatibility):

git clone --depth 1 https://github.com/trishume/syntect.git
cargo build --example syntest --manifest-path syntect/Cargo.toml
mkdir -p /tmp/pkg && ln -sfn "$PWD" /tmp/pkg/TOON
syntect/target/debug/examples/syntest syntax_test_toon.toon /tmp/pkg

License

MIT - see LICENSE.