diff --git a/ui/v2.5/src/docs/en/Manual/EmbeddedPlugins.md b/ui/v2.5/src/docs/en/Manual/EmbeddedPlugins.md index 43fc18799..1fc217ffc 100644 --- a/ui/v2.5/src/docs/en/Manual/EmbeddedPlugins.md +++ b/ui/v2.5/src/docs/en/Manual/EmbeddedPlugins.md @@ -6,19 +6,19 @@ Embedded plugin tasks are executed within the stash process using a scripting sy Stash currently supports Javascript embedded plugin tasks using [goja](https://github.com/dop251/goja). -# Javascript plugins +## Javascript plugins -## Plugin input +### Plugin input The input is provided to Javascript plugin tasks using the `input` global variable, and is an object based on the structure provided in the `Plugin input` section of the [Plugins](/help/Plugins.md) page. Note that the `server_connection` field should not be necessary in most embedded plugins. -## Plugin output +### Plugin output The output of a Javascript plugin task is derived from the evaluated value of the script. The output should conform to the structure provided in the `Plugin output` section of the [Plugins](/help/Plugins.md) page. There are a number of ways to return the plugin output: -### Example #1 +#### Example #1 ``` (function() { return { @@ -27,7 +27,7 @@ There are a number of ways to return the plugin output: })(); ``` -### Example #2 +#### Example #2 ``` function main() { return { @@ -38,7 +38,7 @@ function main() { main(); ``` -### Example #3 +#### Example #3 ``` var output = { Output: "ok" @@ -51,20 +51,20 @@ output; See the `Javascript API` section below on how to log with Javascript plugins. -# Plugin configuration file format +## Plugin configuration file format -## exec +### exec For embedded plugins, the `exec` field is a list with the first element being the path to the Javascript file that will be executed. It is expected that the path to the Javascript file is relative to the directory of the plugin configuration file. -## interface +### interface For embedded plugins, the `interface` field must be set to one of the following values: * `js` -# Javascript API +## Javascript API -## Logging +### Logging Stash provides the following API for logging in Javascript plugins: @@ -77,7 +77,7 @@ Stash provides the following API for logging in Javascript plugins: | `log.Error()` | Log with the `error` log level. | | `log.Progress()` | Sets the progress of the plugin task, as a float, where `0` represents 0% and `1` represents 100%. | -## GQL +### GQL Stash provides the following API for communicating with stash using the graphql interface: @@ -85,7 +85,7 @@ Stash provides the following API for communicating with stash using the graphql |--------|-------------| | `gql.Do(, )` | Executes a graphql query/mutation on the stash server. Returns an object in the same way as a graphql query does. | -### Example +#### Example ``` // creates a tag