# DBML Studio for Obsidian Draws a `.dbml` model as an ER diagram inside a note — the same diagram frame the documentation sites embed, fed by the plugin instead of by a web server. Desktop only: the plugin reads the model from disk with Node's `fs`, and the models it is written for live outside the vault. ## Install In Obsidian: **Settings → Community plugins → Browse**, search for "DBML Studio", install it and turn it on. Obsidian keeps it up to date from there. By hand, for a version not in the directory yet: download `main.js`, `manifest.json` and `styles.css` from its release in this repository (`0.2.4` and later) into `/.obsidian/plugins/dbml-studio/`, creating the folder, and turn the plugin on in **Settings → Community plugins**. The plugin unpacks its diagram frame from `main.js` on the first start. Versions `0.2.0` to `0.2.3` were released from DBML Studio's repository, before the plugin moved here: they are among [its releases](https://github.com/AKonyshev/dbml-studio/releases). ## What it does outside the note The Community plugins directory asks a plugin to say these, and they are worth knowing anyway. - **Files outside the vault.** A block's `model:` is a path, resolved from the vault's root or from the note's folder, and `..` may take it out of the vault — that is what it is for. The models a documentation vault draws usually live beside the documentation they describe (an Antora or MkDocs site's `models/`), not inside the vault, and copying them in would leave two versions to drift apart. The plugin reads only the files blocks name, only when a note with the block is drawn or **Refresh diagrams** runs, and never writes them. - **No network.** The plugin downloads nothing and sends nothing anywhere: the model is read from disk and handed to the diagram frame inside Obsidian's own window. The frame is the documentation sites' one, which on a site can fetch a model by URL; hosted by the plugin, it is given the model in a message instead and requests nothing. - **Its own frame, unpacked into its own folder.** The diagram is drawn by a page — `frame/embed.html`, about 16.4 MB — that ships inside `main.js`, gzipped. On the first start, and after every update, the plugin compares `frame/BUILD` in its plugin folder with the build it carries and, when it is missing or different, writes `frame/embed.html` and then `frame/BUILD` there. The page has to be a file in the plugin folder because an `