Appearance
Building Extensions
An extension adds something to Typora: a code-block language that draws a diagram, a view in the detail panel, a viewer for a file type, TeX macros, templates, commands, and more. One extension package runs unchanged on macOS, Windows and Linux.
Most extensions need no code at all. A JSON manifest is enough to add Kroki diagrams, issue links, task lists, input rules or snippets. When you need custom rendering you add an HTML page; when you need logic you add a script that runs in a Worker.
Trust tiers
Everything an extension contributes belongs to one of three tiers. The tier decides where it runs and what it can reach.
| Tier | What it is | Runs in | Can reach |
|---|---|---|---|
| L0 — data | JSON in the manifest, Markdown templates and snippets, TeX macros | Interpreted by Typora | Nothing — Typora applies it |
| L1 — pages | HTML / JS / WASM pages: fence renderers, detail views, file viewers | A sandboxed frame with its own origin | Only the messages Typora sends it, and the View SDK |
| L2 — logic | A main script (one per window) and/or a background script (one per app) | A locked-down Worker per extension | Only the Worker API, filtered by permissions |
Rules that hold for every tier:
- A Markdown document is data. Fence bodies, inline text and front matter are passed to your extension as input. Opening a file never runs code.
- No extension code runs inside the editor. Pages run in sandboxed frames, scripts run in Workers. Neither can touch the editor's DOM or internal state.
- No network, storage or file access by default. Pages and Workers have
connect-src 'none'. Network, storage and clipboard go through Typora and are limited to what the user granted. - Everything is disposable. All contributions are removed when an extension is disabled, uninstalled or reloaded.
There is no "full trust" mode: no shell commands, no arbitrary file system access, no Node.js.
What a package looks like
An extension is a folder named after its id, with a typora-extension.json manifest at the top:
yourname.hello/
typora-extension.json manifest (required)
main.js L2 script, optional
renderer.html L1 page, optional
snippets/ L0 files, optionalInstalled extensions live in ~/.config/Typora/Extensions/<id>/ (inside the app's container in sandboxed macOS builds). Users install them from the store, from a folder or a .typora-extension file in Settings ▸ Extensions.
Where to go next
- Quick Start — write, install and reload a first extension.
- Manifest Reference — every field of
typora-extension.json. - Contribution Points — what you can add, with examples.
- View SDK and Worker API — the APIs for pages and scripts.
- Permissions and Security — what to declare and what users see.
- Publishing — get your extension into the store.
- Samples — fifteen complete extensions to copy from.