ondreu116 downloadsYAML Databases turns YAML files into interactive Obsidian databases—edit as spreadsheet/form/raw, with sub-tables, find/replace, linting, and exports (CSV/XLSX/YAML/HTML).
An Obsidian plugin to view, create and edit YAML files as interactive databases — through a clean, native-feeling UI as a spreadsheet, a form, or raw source.
It was built for maintaining bills of materials (kusovníky) whose changes are
tracked with git diff, so its output is deterministic and diff-friendly: a
single edit produces a single-line change. It works just as well for any YAML —
inventories, contact lists, changelogs, recipes, configuration, knowledge bases.
.yaml.md)?Databases are stored as Markdown files with a .yaml.md suffix
(e.g. bom.yaml.md). The file is plain text with two parts:
---
title: Drone BOM
owner: ondreu
status: draft
---
- part: Main assembly
qty: 1
components:
- part: M3x8 bolt
qty: 12
- part: 007 washer
qty: 24
This gives you the best of both worlds:
--- block is indexed as
frontmatter / properties, so your databases show up in Bases and
metadata queries just like any other note. Tags, links, and Dataview-style
filters work on database files too.git diff shows exactly what changed: one cell → one line. Reviews
and merges are trivial..yaml / .yml files are also supported — owned directly via
extension registration, opened the same way (without the Markdown benefits)..yaml.md / .yaml / .yml files in the main area by clicking
them in the file explorer. For .yaml.md the plugin intercepts the default
Markdown view and swaps in its own (only the built-in Markdown view is
touched, never other plugins' views). If another plugin grabbed the file,
use the command Open current file in YAML Databases.Level column) so a spreadsheet
shows every part on its own line instead of a JSON blob in one cell.1, 1.1, 1.2.1…), the id placed first.--- YAML document ahead of the body. A plain
file with no frontmatter is left untouched.enum rule renders as a
dropdown; cells that violate a rule are outlined.# comment that round-trips through all three views (Table,
Form, and Source). Comments follow the row when reordered. Commented cells
show a corner mark (Table) or a # marker (Form) and a hover tooltip;
Source view shows the raw # comment inline and is editable directly.required, unique, type, min/max, enum, pattern, nonEmpty)
set in settings; results show in a panel from the Lint button..yaml dump of the database with its frontmatter,
for sharing with tools that expect plain YAML..html file that browses the database offline
(drill-down, search, and its own CSV/XLSX/YAML download buttons). Drop it on
a USB stick, email it, host it statically — no Obsidian needed.*.yaml.md file
and click it in the file explorer..yaml.md files are regular Markdown notes to Obsidian, so they show up in the
file explorer and their frontmatter is available to Bases and metadata
queries. The plugin renders the YAML body; the default Markdown view is replaced
automatically when such a file is opened.
drone.yaml.md:
---
title: Drone BOM
owner: ondreu
status: draft
---
- part: Airframe
qty: 1
supplier: In-house
inStock: true
components:
- part: M3x8 bolt
qty: 12
- part: M3 nut
qty: 12
- part: 007 washer
qty: 24
supplier: Bolts Ltd
inStock: false
- part: PCB v2
qty: 1
supplier: JLC
inStock: true
Open it in the Table view, drill into the components sub-table of the Airframe
row, run Flatten to roll up quantities across the whole tree, then export
the flat parts list to XLSX for purchasing.
Settings → Lint rules:
rules:
- column: sku
required: true
unique: true
pattern: "^[A-Z]{3}-\\d{4}$"
- column: quantity
type: integer
min: 0
- column: status
enum: [in-stock, ordered, discontinued]
Now the status column renders as a dropdown, out-of-stock violations are
outlined in red, and the Lint panel lists every problem with row + column.
---
title: Sourdough
tags: [bread, vegan]
---
- ingredient: Bread flour
amount: 500
unit: g
- ingredient: Water
amount: 350
unit: g
- ingredient: Salt
amount: 10
unit: g
- name: Ada Lovelace
email: [email protected]
role: engineer
- name: Alan Turing
email: [email protected]
role: mathematician
Cell/field input is coerced conservatively: true/false → boolean, empty or
null → null, canonical numbers → number, everything else stays a string.
Leading-zero values such as 007 are kept as strings so part numbers are not
mangled.
npm install # install dependencies
npm run dev # watch-build main.js
npm run build # type-check + production build
npm test # run model round-trip / shape / coercion tests
To try it in a vault, copy main.js, manifest.json and styles.css into
<vault>/.obsidian/plugins/yaml-databases/ and enable the plugin in
Settings → Community plugins. Then create or open any *.yaml.md (or
*.yaml) file.
src/
main.ts plugin entry (view + extension + menu + command + ribbon)
constants.ts view type, extensions, icons
settings.ts settings + settings tab
model/
YamlDocument.ts parse / deterministic serialize
shape.ts shape detection + column collection
coerce.ts scalar type inference / formatting
view/
YamlView.ts TextFileView host, mode switching
Renderer.ts renderer contract
TableRenderer.ts spreadsheet editor
FormRenderer.ts recursive form / tree editor
SourceRenderer.ts raw YAML editor with validation
export/
csv.ts xlsx.ts html.ts zip.ts
import/
csvRead.ts xlsxRead.ts
lint/
lint.ts
MIT © ondreu