Skip to content

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 ​

ContributionAddsExample
themesThemes: fonts, colours and element styles for documents and the windowSolarized
templates, snippetsDocument templates and insertable snippetsMeeting notes, a theorem block
customFormatsToggleable wrappers such as coloured text<span style="color:teal">…</span>
keyBindingsDefault shortcuts for Typora's or your own commandsMod+Alt+T → insert table
texMacrosGlobal MathJax macros\R → \mathbb{R}
mathjaxMathJax fonts and TeX packages (components that run in the math Worker)STIX Two, a chess package
localizations, dictionariesInterface translations and Hunspell spelling dictionariesDeutsch
inputRulesAuto-pairs and text replacements as you type( → ()
inlineRulesDecoration and ⌘/Ctrl-click actions over matched text#123 → issue link
fenceRenderers with krokiDiagrams drawn by a Kroki server```plantuml
detailViews with queryLists of matching blocks or inlines in the detail panelOpen tasks
configurationA settings form for your extensionServer URL

L1 — pages ​

ContributionAdds
fenceRenderers with entryYour own renderer for a fence language: static (returns SVG) or interactive (a live frame per fence)
detailViews with entryA page in the detail panel, optionally fed the document's blocks
fileViewersA viewer (and editor) for a file type

Pages use the View SDK.

L2 — logic ​

ContributionAdds
commands, menusCommands 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: truemain picks the page and talks to it
fileViewers resolved from mainmain picks the page and handles messages
publishAdaptersBlog publishing shared by the CLI and desktop, handled in main
imageUploadersAn image uploader in Settings ▸ Image, handled in main
syncProvidersA desktop file-sync backend in Settings ▸ Files, handled in main
FormattersRegistered from main with typora.formatters

Scripts use the Worker API.

Where contributions appear ​

  • Items from an extension are grouped under the extension's name in 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.

Theme adapted from Nimbus (MIT).