diff --git a/docs/developers/extension-development.md b/docs/developers/extension-development.md index cdfec7245f..1407c77983 100644 --- a/docs/developers/extension-development.md +++ b/docs/developers/extension-development.md @@ -66,7 +66,7 @@ let trial = { extensions: [ {type: myAwesomeExtension, params: {demo: 'value'}} ] -}); +}; //... extension code ...// class MyAwesomeExtension { @@ -91,7 +91,7 @@ let trial = { extensions: [ {type: myAwesomeExtension, params: {demo: 'value'}} ] -}); +}; //... extension code ...// class MyAwesomeExtension { @@ -122,7 +122,7 @@ let trial = { on_finish: (data) => { console.log(data.awesome); // will output 'value'. } -}); +}; //... extension code ...// class MyAwesomeExtension { @@ -168,9 +168,11 @@ The `version` field describes the version of the extension used and then durin t The `data` field is an object containing all of the `data` generated for the plugin. Each 'data' object has a `type` and `default` property. Additionally, this should be only used for data you choose to generate. Any jsdoc (comments included in the /** */ tags) you include will be scraped as metadata if you are choosing to generate metadata. This scraped metadata will also be used to create the JsPsych documentation. +For more information on the various types of parameters one can include in their data field, see [here](./plugin-development.md#parameter-types). + ### Optional methods -The extension can also include any additional methods that are necessary for interacting with it. See the [webgazer extension](../extensions/webgazer.md) for an example. +The extension can also include any additional methods that are necessary for interacting with it. See the [WebGazer extension](../extensions/webgazer.md) for an example. ## Advice for writing extensions diff --git a/docs/overview/extensions.md b/docs/overview/extensions.md index bf69628fbc..dd4a0972c0 100644 --- a/docs/overview/extensions.md +++ b/docs/overview/extensions.md @@ -1,6 +1,6 @@ # Extensions -Extensions are jsPsych modules that can interface with any plugin to extend the functionality of the plugin. A canonical example of an extension is eye tracking. An eye tracking extension allows a plugin to gather gaze data and add it to the plugin's data object. +In jsPsych, extensions allow one to extend the functionality of various plugins, giving individual plugins the ability to collect more data, display additional stimuli, and more. A canonical example of an extension is [eye tracking](../extensions/webgazer.md), which allow plugins to gather gaze data and add it to the their respective data objects. For a full list of extensions directly included in the jsPsych release, see [here](../extensions/list-of-extensions.md). ## Using an Extension @@ -16,7 +16,7 @@ To use an extension in an experiment, you'll load the extension file via a `