Data Files

Config and data files open in the code editor with highlighting, folding and formatting. They are plain text, so versioning, diffs, sharing and agent edits all apply.

What opens in the code editor

FormatExtensions
JSON.json
YAML.yaml .yml
TOML.toml
XML.xml
SQL.sql

Each gets its own syntax highlighting, chosen from the extension.

What the editor helps with

  • Bracket pair colouring and always-on bracket matching, so a deeply nested object is navigable.

  • Folding, so a 2000-line JSON file is readable.

  • Formatting as you type and on paste, so a one-line blob of JSON comes out indented.

  • Auto-closing brackets and quotes, two-space indents by default, with detection of the indentation the file already uses.

  • Find and replace, seeded from your selection.

What Monofile does not check

Monofile stores your file as text and does not validate it. A .json file with a trailing comma, a .yaml file with a tab in the wrong place, and an XML document with an unclosed tag all save without complaint. The editor's highlighting usually makes the mistake visible, but nothing rejects the write and nothing enforces a schema.

A half-finished config is a normal state to save in. Validation happens wherever the file is consumed.

CSV and TSV are not a recognised type

There is no CSV file type and no table view. Monofile treats a .csv file as plain text, so it opens in the WYSIWYG markdown editor, which is fine for a quick look and awkward for editing.

Two ways around it, depending on what you want:

  • For data an agent or a script will read, prefer .json or .yaml. They open in the code editor, fold, and diff cleanly.

  • For a table a person will read, write a markdown table in a .md file. It renders as a real table you can tab through, and it shows up in search and in [[wiki-links]].

Data files are text files

Everything general applies:

  • Every write captures a version, and a config change diffs as a readable line diff.

  • An agent can read, write and edit data files, and its changes arrive as a diff you keep or revert as a unit. See File and Shell Tools.

  • You can share a file by link or publish it in a folder.

  • A note can point at a config file with [[wiki-links]], and the config file appears in that note's backlinks.

Canvas boards and .draw drawings store their documents as JSON too, and each has its own editor. Cmd + Shift + V (Ctrl + Shift + V on Windows and Linux) shows a canvas board as raw JSON when you need to see exactly what is in the file. Do not hand-edit either as data; use the board editor, or the canvas and diagram tools.

Next steps

533 words