1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-03 01:10:45 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid
2019-09-27 21:57:46 +01:00

38 lines
2.3 KiB
Plaintext

created: 20130826122000000
modified: 20190927172137277
tags: Mechanisms
title: PluginMechanism
type: text/vnd.tiddlywiki
! Introduction
[[Plugins]] are bundles of tiddlers that are distributed and managed as a single unit. Users can install them with drag and drop, or using the [[plugin library|Installing a plugin from the plugin library]].
<<.from-version "5.1.22">> Plugins that contain JavaScript modules require a reload of the wiki before they will work. Plugins that do not contain JavaScript modules are automatically dynamically loaded and unloaded.
Plugins can be used to package any tiddler content, including JavaScript [[modules|Modules]] that extend and enhance the core TiddlyWiki5 functionality. The tiddlers within registered plugins are ShadowTiddlers: they can be freely overwritten by creating a tiddler with the same title, but deleting that tiddler restores the underlying tiddler value from the plugin.
By convention, plugin titles have the form `$:/plugins/<publisher>/<name>`. Plugins that are part of the core TiddlyWiki distribution have titles of the form `$:/plugins/tiddlywiki/<name>`.
When [[running TiddlyWiki under Node.js|TiddlyWiki on Node.js]], plugins can also be stored as individual tiddler files in [[PluginFolders]].
Plugins have a `plugin-type` field that determines how it is treated. The following values are defined by the core:
* `plugin` - an ordinary plugin
* `theme` - a theme plugin (see ThemeMechanism). Only the theme plugin named in the tiddler $:/theme is activated at any one time (along with any dependent theme plugins)
* `language` - a language plugin (see TranslationMechanism). Only the language plugin named in the tiddler $:/language is activated at any one time (along with any dependent language plugins)
The following plugin types are used internally by the core:
* `import` - for the special $:/Import plugin created while importing is in progress
* `info` - for the special $:/temp/info-plugin tiddler created by the InfoMechanism
Custom plugin types can also be used. They will automatically receive the same behaviour as plain plugins but can display a custom user interface using an appropriate [[view template segment|SystemTag: $:/tags/ViewTemplate]].
See [[Plugin Fields]] for details of the other fields used by plugins.
! More information
<<list-links "[tag[PluginMechanism]]">>