Difference between revisions of "Manual/Plugins"

From Knotter
Jump to navigation Jump to search
Line 14: Line 14:
 
|-
 
|-
 
! name
 
! name
| Recommended || A unique string that identifies the plugin. If missing is deduced from the file name.
+
|bgcolor=orange| Recommended || A unique string that identifies the plugin. If missing is deduced from the file name.
 
|-
 
|-
 
! type
 
! type
| Recommended || Plugin type, see below for valid values.  If missing or with an invalid value will be overwritten to '''script''' .
+
|bgcolor=orange| Recommended || Plugin type, see below for valid values.  If missing or with an invalid value will be overwritten to '''script''' .
 
|-
 
|-
 
! description
 
! description
| Recommended ||A textual description of the use of the plugin.
+
|bgcolor=orange| Recommended ||A textual description of the use of the plugin.
 
|-
 
|-
 
! requires
 
! requires
| Recommended || String for the minimum version of Knotter required to run the script. (Eg: '''{{Download Version}}''')
+
|bgcolor=orange| Recommended || String for the minimum version of Knotter required to run the script. (Eg: '''{{Download Version}}''')
 
|-
 
|-
 
! author
 
! author
| Suggested || Name of the author of the plugin.
+
|bgcolor=yellow| Suggested || Name of the author of the plugin.
 
|-
 
|-
 
! version
 
! version
| Suggested || Plugin version.
+
|bgcolor=yellow| Suggested || Plugin version.
 
|-
 
|-
 
! license  
 
! license  
| Suggested || Short identifier of the software license covering the plugin.
+
|bgcolor=yellow| Suggested || Short identifier of the software license covering the plugin.
 
|-
 
|-
 
! icon
 
! icon
| Optional || A named icon from the theme or a file name. How this is used can change depending on the plugin type.
+
|bgcolor=#6495ED| Optional || A named icon from the theme or a file name. How this is used can change depending on the plugin type.
 
|-
 
|-
 
! script
 
! script
| Mandatory || Location of the script file that is to be executed by the plugin. The location is considered relative to the directory containing the JSON file. See {{rl|Scripting}} for a description of the language.
+
|bgcolor=red| Mandatory || Location of the script file that is to be executed by the plugin. The location is considered relative to the directory containing the JSON file. See {{rl|Scripting}} for a description of the language.
 
|-
 
|-
 
! auto_enable
 
! auto_enable
| Optional || Whether the plugin is enabled by default. If omitted it's considered true.
+
|bgcolor=#6495ED|Optional || Whether the plugin is enabled by default. If omitted it's considered true.
 
|-
 
|-
 
! ui
 
! ui
| Optional || Name or array of names of Ui files that are loaded by the plugin. The widgets will be available to the script from their object name.
+
|bgcolor=#6495ED| Optional || Name or array of names of Ui files that are loaded by the plugin. The widgets will be available to the script from their object name.
 
|-
 
|-
 
! category
 
! category
| Optional || For '''script''' plugins, the name of the menu that will contain it. Defaults to ''Other''.
+
|bgcolor=#6495ED| Optional || For '''script''' plugins, the name of the menu that will contain it. Defaults to ''Other''.
 
|-
 
|-
 
! plugin_file
 
! plugin_file
| Automatic || Absolute path to the plugin JSON file.
+
|bgcolor=silver| Automatic || Absolute path to the plugin JSON file.
 
|-
 
|-
 
! plugin_dir
 
! plugin_dir
| Automatic || Directory containing the JSON file.
+
|bgcolor=silver| Automatic || Directory containing the JSON file.
 
|-
 
|-
 
! plugin_shortname
 
! plugin_shortname
| Automatic || A unique name deduced from the file name.
+
|bgcolor=silver| Automatic || A unique name deduced from the file name.
 
|-
 
|-
 
! plugin_settings
 
! plugin_settings
| Optional || Name of the settings file for the plugin. If missing a unique value (not shared by any other plugin) is used.
+
|bgcolor=#6495ED| Optional || Name of the settings file for the plugin. If missing a unique value (not shared by any other plugin) is used.
 
|}
 
|}
  

Revision as of 07:34, 23 October 2013

Available Plugins

See the list of available plugins.

Plugin Data

A plugin is described by a JSON file containing the metadata for the given plugin.

The JSON contains an object with the following fields:

Parameter Presence Description
name Recommended A unique string that identifies the plugin. If missing is deduced from the file name.
type Recommended Plugin type, see below for valid values. If missing or with an invalid value will be overwritten to script .
description Recommended A textual description of the use of the plugin.
requires Recommended String for the minimum version of Knotter required to run the script. (Eg: 0.9.6)
author Suggested Name of the author of the plugin.
version Suggested Plugin version.
license Suggested Short identifier of the software license covering the plugin.
icon Optional A named icon from the theme or a file name. How this is used can change depending on the plugin type.
script Mandatory Location of the script file that is to be executed by the plugin. The location is considered relative to the directory containing the JSON file. See Scripting for a description of the language.
auto_enable Optional Whether the plugin is enabled by default. If omitted it's considered true.
ui Optional Name or array of names of Ui files that are loaded by the plugin. The widgets will be available to the script from their object name.
category Optional For script plugins, the name of the menu that will contain it. Defaults to Other.
plugin_file Automatic Absolute path to the plugin JSON file.
plugin_dir Automatic Directory containing the JSON file.
plugin_shortname Automatic A unique name deduced from the file name.
plugin_settings Optional Name of the settings file for the plugin. If missing a unique value (not shared by any other plugin) is used.

Plugin Locations

Plugins are searched in the available data directories, the following directories are always searched:

  • datadir as per configure.sh.
  • current working directory/data
  • executable directory/data

Other directories depend on the system and Qt version. Check Help → About → Plugins for details

Plugin Types

cusp A new cusp style.
script Execute an arbitrary script, when enabled will be available from the Plugin menu.
edge (Planned, not yet available) A new edge type.