Skip to content

0.2.6

Latest

Choose a tag to compare

@github-actions github-actions released this 04 Aug 10:56
1ed4247

Arc 4 is closed: every field type Fileclass can hold now has a short video on the page that documents it. This release carries what recording the last two takes turned up, plus one change of substance.

Changed

  • A JSON field stores JSON. It used to parse your text and hand the structure to frontmatter, which Obsidian then wrote back as YAML — so nothing on disk was ever JSON, and the type was a notation for the editor alone. A JSON field now stores the text, which Obsidian writes as a block scalar (import: |-), so a payload keeps the formatting it came with. Verified against Obsidian: a multi-line string is emitted as a block, a block already in the file survives a write to another key untouched, and what comes back is the exact text. The trade-off is the reason to have two types — YAML stores a real structure, which a base reaches into through a formula; JSON keeps the bytes and is opaque to Bases. A field already holding a mapping keeps working: it opens as pretty-printed JSON and becomes text on the next save
  • A declared raw field is not a warning. Obsidian paints a nested value it can't interpret in its warning colour, which is right for a value nobody can make sense of and wrong for a field a class declares and round-trips. The value itself stays raw on screen, which for these two types is the honest answer

Added

  • Convert between the two notations. Changing a field's type doesn't rewrite what it holds, so a JSON field can open on YAML (and the reverse). The editor offers Convert from YAML — and the offer appears and disappears as you type, since it is only shown for text that reads as the other notation
  • A duration reads as a duration in the Properties panel. PT45M44S is the right thing on disk and unreadable on screen, so the human form is shown next to the stored value — never over it, since Obsidian's value there stays editable. A single value gets its reading beside it; an interval sequence gets one reading inside each pill, left of the remove button, so it names the value it reads

Fixed

  • The raw editor stops losing work. Escape or the close button used to discard a blob of JSON or YAML in silence — the editor with the most typing in it was the last one without a guard. It shows Unsaved changes and asks now
  • The parser answers while you type. An invalid document was only reported when you asked to save, so a mistake twenty lines up was learned about on the way out. The error, with its line, its column and a caret under the spot, appears as you type
  • A field's edit button stays on the property's first line, instead of drifting to the middle row of a stacked list
  • A structured value says how much is inside3 keys, 5 items — where {…} said nothing

Learning the plugin

Two new takes finish the arc: a list of grouped fields (ObjectList, per-item ranks, a display template, and a base that counts the editions of each book) and when raw is the honest answer (YAML for structure you will query, JSON for bytes you want kept). Twenty-five videos now, fifty-eight minutes: https://mdelobelle.github.io/fileclass/videos/

Compatibility: minAppVersion 1.12.7. Fileclass builds on the core Bases plugin, which needs to be enabled.