Appearance
Contribution Points
Contribution points are the keys of contributes in the manifest. Each one adds something to Typora. Start with the lowest tier that does the job: L0 needs no code, installs without a permission prompt (unless it uses the network), and is the easiest to review for the store.
L0 — declarative
| Contribution | Adds | Example |
|---|---|---|
themes | Themes: fonts, colours and element styles for documents and the window | Solarized |
templates, snippets | Document templates and insertable snippets | Meeting notes, a theorem block |
customFormats | Toggleable wrappers such as coloured text | <span style="color:teal">…</span> |
keyBindings | Default shortcuts for Typora's or your own commands | Mod+Alt+T → insert table |
texMacros | Global MathJax macros | \R → \mathbb{R} |
mathjax | MathJax fonts and TeX packages (components that run in the math Worker) | STIX Two, a chess package |
localizations, dictionaries | Interface translations and Hunspell spelling dictionaries | Deutsch |
inputRules | Auto-pairs and text replacements as you type | ( → () |
inlineRules | Decoration and ⌘/Ctrl-click actions over matched text | #123 → issue link |
fenceRenderers with kroki | Diagrams drawn by a Kroki server | ```plantuml |
detailViews with query | Lists of matching blocks or inlines in the detail panel | Open tasks |
configuration | A settings form for your extension | Server URL |
L1 — pages
| Contribution | Adds |
|---|---|
fenceRenderers with entry | Your own renderer for a fence language: static (returns SVG) or interactive (a live frame per fence) |
detailViews with entry | A page in the detail panel, optionally fed the document's blocks |
fileViewers | A viewer (and editor) for a file type |
Pages use the View SDK.
L2 — logic
| Contribution | Adds |
|---|---|
commands, menus | Commands in the palette, / menu and editor context menu, handled in main |
detailViews with provider: "main" | A list computed by a checker in main |
fenceRenderers with resolver: true | main picks the page and talks to it |
fileViewers resolved from main | main picks the page and handles messages |
publishAdapters | Blog publishing shared by the CLI and desktop, handled in main |
imageUploaders | An image uploader in Settings ▸ Image, handled in main |
syncProviders | A desktop file-sync backend in Settings ▸ Files, handled in main |
| Formatters | Registered from main with typora.formatters |
Scripts use the Worker API.
Where contributions appear
- Items from an extension are grouped under the extension's
namein menus, palettes and Settings. - Templates, snippets and custom formats from extensions are read-only in Settings; users can't edit them in place.
- Disabling, uninstalling or reloading an extension removes all of its contributions immediately.