diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index d1fd8f374..c7ff155c0 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -63,6 +63,7 @@ Parsing/Pragma/Caption: Pragma Parse Rules Plugins/Add/Caption: Get more plugins Plugins/Add/Hint: Install plugins from the official library Plugins/AlreadyInstalled/Hint: This plugin is already installed at version <$text text=<>/> +Plugins/AlsoRequires: Also requires: Plugins/Caption: Plugins Plugins/Disable/Caption: disable Plugins/Disable/Hint: Disable this plugin when reloading page diff --git a/core/ui/ControlPanel/Modals/AddPlugins.tid b/core/ui/ControlPanel/Modals/AddPlugins.tid index 3c650fcc3..d25dc93ef 100644 --- a/core/ui/ControlPanel/Modals/AddPlugins.tid +++ b/core/ui/ControlPanel/Modals/AddPlugins.tid @@ -67,7 +67,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$ <$set name="currentTiddler" value=<>> <$list filter="[enlist{!!dependents}] [get[parent-plugin]] +[limit[1]]" variable="ignore">
-Also requires: +{{$:/language/ControlPanel/Plugins/AlsoRequires}} <$list filter="[enlist{!!dependents}] [{!!parent-plugin}] +[sort[title]]" variable="dependency"> <$text text=<>/> diff --git a/editions/tw5.com/tiddlers/Plugin Dependencies.tid b/editions/tw5.com/tiddlers/Plugin Dependencies.tid new file mode 100644 index 000000000..5fa9c2f75 --- /dev/null +++ b/editions/tw5.com/tiddlers/Plugin Dependencies.tid @@ -0,0 +1,13 @@ +created: 20190928081852771 +modified: 20190928082758674 +tags: PluginMechanism +title: Plugin Dependencies +type: text/vnd.tiddlywiki + +The simplest form of dependency between plugins is that one plugin can declare itself to be a sub-plugin of another plugin by specifying that plugin in the `parent-plugin` [[field|Plugin Fields]]. Sub-plugins are displayed in the control panel plugin chooser within the expandable area of their parent plugin. For example, the official plugin library includes the [[CodeMirror Plugin]] and also more than a dozen sub-plugins that extend the CodeMirror plugin with optional functionality. Note that sub-plugins cannot themselves have further sub-plugins. + +Plugins can also use their `dependents` [[field|Plugin Fields]] to list the titles of any other plugins that should also be installed. Note that the list is not resolved recursively: dependents of dependents will not be installed. + +When installing a plugin from the plugin library, both the `parent-plugin` and `dependents` fields are used to determine any additional plugins to be installed. + +Note that the `dependents` field is also used by the ThemeMechanism and the LanguageMechanism to switch in dependent theme/language plugins. diff --git a/editions/tw5.com/tiddlers/Plugin Types.tid b/editions/tw5.com/tiddlers/Plugin Types.tid new file mode 100644 index 000000000..c496fdbd0 --- /dev/null +++ b/editions/tw5.com/tiddlers/Plugin Types.tid @@ -0,0 +1,18 @@ +created: 20190928081810311 +modified: 20190928081811355 +tags: +title: Plugin Types +type: text/vnd.tiddlywiki + +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 + +While not supported by the plugin library, it is also possible to use custom plugin types to build plugin-like behaviour with a custom user interface. Plugins with a custom type 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]]. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid b/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid index a2505a188..c51417887 100644 --- a/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid +++ b/editions/tw5.com/tiddlers/mechanisms/PluginMechanism.tid @@ -1,5 +1,5 @@ created: 20130826122000000 -modified: 20190927172137277 +modified: 20190928082000464 tags: Mechanisms title: PluginMechanism type: text/vnd.tiddlywiki @@ -16,20 +16,21 @@ By convention, plugin titles have the form `$:/plugins//`. Plug 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 Types -* `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) +{{Plugin Types}} -The following plugin types are used internally by the core: +! Plugin Dependencies -* `import` - for the special $:/Import plugin created while importing is in progress -* `info` - for the special $:/temp/info-plugin tiddler created by the InfoMechanism +{{Plugin Dependencies}} -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]]. +! Plugin Ordering -See [[Plugin Fields]] for details of the other fields used by plugins. +{{Plugin Ordering}} + +! Plugin Fields + +{{Plugin Fields}} ! More information diff --git a/editions/tw5.com/tiddlers/plugins/Plugin_Fields.tid b/editions/tw5.com/tiddlers/plugins/Plugin_Fields.tid index f4d7e6d0a..5c2bb6fdf 100644 --- a/editions/tw5.com/tiddlers/plugins/Plugin_Fields.tid +++ b/editions/tw5.com/tiddlers/plugins/Plugin_Fields.tid @@ -1,11 +1,9 @@ created: 20161015122718559 -modified: 20190927172655698 +modified: 20190928083018378 tags: PluginMechanism title: Plugin Fields type: text/vnd.tiddlywiki -! Plugin fields - Plugins are stored as tiddlers with the following fields: |!Field |!Description | @@ -14,6 +12,7 @@ Plugins are stored as tiddlers with the following fields: |description |Description of plugin | |list |Names of exposed plugin information tiddlers (see below) | |name |Brief name of the plugin | +|plugin-priority |//(optional)// Numerical priority (higher numbers install later, the core plugin has a priority of zero | |plugin-type |Generally ''plugin'', ''language'' or ''theme''; see PluginMechanism for details | |parent-plugin |//(optional)// <<.from-version "5.1.22">> Title of the plugin under which this plugin should be displayed as a sub-plugin in the control panel plugin chooser | |source |//(optional)// Source URL of plugin | diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 054a0a536..11d5b3cfc 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -2179,7 +2179,12 @@ a.tc-tiddlylink.tc-plugin-info:hover .tc-plugin-info > .tc-plugin-info-chunk > s } .tc-plugin-info-dropdown-body { - padding: 1em 1em 1em 1em; + padding: 1em 1em 0 1em; +} + +.tc-plugin-info-sub-plugins { + padding-top: 0.5em; + background: <>; } .tc-plugin-library-listing .tc-install-plugin {