# Ablaze Robin's personal all-purpose [Obsidian](https://obsidian.md) plugin. Works on desktop and mobile. It adds an **Ablaze** panel (right sidebar) with one button per content type — Entity, Reference, Notion, Idea, Project, Blog, Document, Admin, Personal. Clicking a button opens a modal that creates a new note of that type with the right frontmatter (tags, plus type-specific fields for references, blog posts, and personal notes), warns if the file already exists, and opens the new note in a tab. The panel can be reopened at any time via the ribbon icon or the "Ablaze: Open panel" command. ## Layout - `src/main.js` — the whole plugin: the `Ablaze` plugin class, the sidebar `AblazeView`, and the note-creation `AblazeModal`. Plain JS, no TypeScript; esbuild bundles it (plus `templates.json`) into the root `main.js` that Obsidian actually loads — imports don't resolve at runtime (there's no Node on mobile), so everything has to end up in that one file. - `templates.json` — the content-type definitions (name, colour, icon, tag, and the id used by Supercharged Links). Shared by `src/main.js` and `generate-superstyle.js`. - `generate-superstyle.js` — regenerates `supercharged-config.json`, the style settings for the [Supercharged Links](https://github.com/mdelobelle/obsidian_supercharged_links) plugin (`node generate-superstyle.js`). Careful: the icon prefix uses a six-per-em space (U+2006) that looks exactly like a regular space. ## Developing - `npm i` to install dependencies (just esbuild). - `npm run watch` rebuilds `main.js` on every change to `src/main.js`. - `npm run build` produces the production `main.js`. ## Installing `npm run install-plugin` builds and copies `main.js`, `styles.css`, and `manifest.json` into `VaultFolder/.obsidian/plugins/ablaze/` (set `ABLAZE_VAULT` to target another vault), then reload Obsidian. It must be a real directory, not a symlink — see the gotchas. ## Gotchas learnt the hard way - Views must be registered in `onload()`, which runs on every app launch. `onUserEnable()` only runs the one time the plugin is enabled in settings — registering the view there means that after any restart the persisted tab has no view and Obsidian shows "Plugin no longer active. The plugin that created this tab has gone away." - Obsidian Sync only carries `main.js`, `manifest.json`, `styles.css`, and `data.json` to other devices, and the only version a device shows (Settings → Community plugins) is the one in `manifest.json` — bumping `package.json` alone proves nothing. Bump the manifest (`npm version`) when you need to check that a device actually received a build; the panel also prints its version at the bottom for the same reason. - Don't symlink the plugin directory into the vault. Desktop Obsidian coped with it, but Obsidian Sync never reliably pushed the rebuilt `main.js` to mobile, which kept running a build from before the `onload()` fix above. `install.mjs` copies real files instead.