No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
nnra6864 b13014ae8a feat: YAML files can be edited by path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 02:16:31 +01:00
.gitignore feat: YAML files can be edited by path 2026-11-17 02:16:31 +01:00
build.zig feat: YAML files can be edited by path 2026-11-17 02:16:31 +01:00
build.zig.zon feat: YAML files can be edited by path 2026-11-17 02:16:31 +01:00
README.md feat: YAML files can be edited by path 2026-11-17 02:16:31 +01:00
root.zig feat: YAML files can be edited by path 2026-11-17 02:16:31 +01:00

kosm_yaml

YAML for kosm: the yaml adapter, claiming .yaml and .yml files and enabling edit.

var file = try output.edit(.{ .files = "~/.config/wlr-which-key/config.yaml" });
try file.set("background", self.background);
try file.set("corner_r", self.corner_r);
  • A file holds one document. Block mappings (key: value on lines of their own) nest, so menu.0.submenu.0.cmd reaches into a list of mappings.
  • Block and flow sequences (- item, [a, b]) are lists, reached with * and indices.
  • A flow mapping ({a: 1}) is one value: paths do not see into it.
  • Quoted keys match without their quotes: "\"a.b\"" is the key a.b.
  • A tag or anchor before a value (!!str, &size) is kept when the value is set.
  • Strings and colors are written double-quoted, since a bare # starts a comment; lists and tables are written in flow style. Booleans are true and false.
  • Only edits: the adapter does not generate files or insert missing keys.