TOON Syntax Highlight

by Sebastián Salas
5
4
3
2
1
Score: 50/100

Description

Syntax highlighting for TOON (Token-Oriented Object Notation) in Obsidian fenced code blocks

Reviews

No reviews yet.

Stats

0
stars
67
downloads
0
forks
82
days
82
days
82
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
3
commits

Latest Version

3 months ago

Changelog

No plugin code changes — identical behaviour to 1.0.0.

Release artifacts are now signed with GitHub build provenance attestations, so main.js, manifest.json and styles.css can be cryptographically verified as built from this repository:

gh attestation verify main.js --repo sebasalas/obsidian-toon-syntax

README file from

Github

TOON Syntax Highlight

Syntax highlighting for TOON (Token-Oriented Object Notation) in fenced code blocks, so tabular dumps stay readable inside your notes.

Colors come from Obsidian's own --code-* variables, so the highlighting adapts to whatever theme you use, in both light and dark mode.

Usage

Tag a fenced code block with toon:

```toon
# inventory snapshot
warehouse: north
items[3]{sku,name,qty,price,note}:
  1001,Keyboard,42,29.99,null
  1002,Monitor,7,189.50,"Restock by: 2025-06-30"
  1003,Mouse,0,12.00,null
```

Works in Reading View and Live Preview. Source mode shows plain text, since it is a rendered-markdown post processor and Source mode renders no HTML.

What gets highlighted

Token Matches Obsidian variable
Key table name and header fields --code-property
String double-quoted text --code-string
Number integers and decimals, incl. exponents --code-value
Keyword null, true, false --code-keyword
Punctuation [ ] { } , : --code-punctuation
Comment lines starting with # --code-comment
Plain everything else --code-normal

Quoted values are parsed properly: a colon inside "Restock by: 2025-06-30" does not turn the row into a key: value line, and "" / \" escapes are respected.

Settings

Setting Default Effect
Wrap long lines Off Wraps block content instead of scrolling horizontally

Wrapping uses overflow-wrap: anywhere because TOON rows are comma-separated with no spaces — plain pre-wrap finds no break opportunity in a line of UUIDs and timestamps.

Installation

From the community plugin store

Settings → Community plugins → Browse → search for TOON Syntax Highlight.

Manual

  1. Download main.js, manifest.json and styles.css from the latest release.
  2. Put them in <vault>/.obsidian/plugins/toon-syntax/.
  3. Reload Obsidian and enable the plugin in Settings → Community plugins.

Development

Plain JavaScript, no build step. Clone into your vault's plugins folder and reload:

git clone https://github.com/sebasalas/obsidian-toon-syntax.git \
  <vault>/.obsidian/plugins/toon-syntax

Releases are automated: push a tag matching the manifest.json version and the workflow in .github/workflows/release.yml drafts a release with the three required assets.

git tag 1.0.1 && git push origin 1.0.1

License

MIT