Skip to content

Commit

Permalink
fix wording and some links
Browse files Browse the repository at this point in the history
  • Loading branch information
jadeddelta committed Nov 20, 2024
1 parent 2f859b8 commit f4ba84a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/developers/extension-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ 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).
For more information on the various types of parameters one can include in their data field, see our [documentation on `ParameterType`s](./plugin-development.md#parameter-types).

### Optional methods

Expand Down
6 changes: 3 additions & 3 deletions docs/developers/plugin-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ const info = {
}
```

??? info "Custom Build Environments"
??? info "Automatic versioning with custom build environments"

If you are using a custom build environment that imports its own `tsconfig.json` file that does not extend jsPsych's, but you want to use this syntax, you must add `"resolveJsonModule": true` to the config's `compilerOptions` object.
If you are using a custom build environment that imports its own `tsconfig.json` file that does not extend jsPsych's, and you want to use this automatic versioning syntax, you must add `"resolveJsonModule": true` to the config's `compilerOptions` object.

If you are not using a build environment that supports `import` and `package.json` (such as writing a plain JS file), you can manually enter the `version` as a string.

Expand Down Expand Up @@ -169,7 +169,7 @@ MyAwesomePlugin.info = info;
#### Parameter Types
jsPsych currently has support for the following parameters:
jsPsych currently has support for the following parameter types:
| Type Name | Description | Example |
| --------- | ----------- | ------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/jspsych-pluginAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Returns nothing.

#### Description

Method that belongs to the AudioPlayer class. Stops the audio loaded into the audio buffer of the AudioPlayer instance for a particular file. If the audio is an HTML5 audio object it pauses it. If the audio is a Webaudio API object it stops it. This will regenerate the audio player, allowing you to call the `play()` method upon it again.
Method that belongs to the AudioPlayer class. Stops the audio loaded into the audio buffer of the AudioPlayer instance for a particular file. If the audio is an HTML5 audio object it pauses it. If the audio is a WebAudio API object it stops it. This will regenerate the audio player, allowing you to call the `play()` method upon it again.

#### Example

Expand Down
7 changes: 2 additions & 5 deletions docs/support/migration-v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ const trial = {
The `button_html` parameter can also support different HTML for each button.
See the [plugin documentation](https://www.jspsych.org/latest/plugins/html-button-response/index.html) for more details.

For plugin developers: if you are writing a plugin and updating parameters to use functions,
make sure to mock these functions in Jest to ensure tests can still run.

## Plugin parameter handling

In version 7.x, a plugin could omit parameters from the `info` object and jsPsych would still evaluate these parameters appropriately in most cases.
Expand All @@ -113,7 +110,7 @@ In version 9.x, we plan to make this a requirement.
In version 7.x, jsPsych's `pluginAPI` class exposed WebAudio and HTML5 audio APIs through `getAudioBuffer()`. However, this required different implementations done by the developer to account for each API.
In version 8.x, we've removed this in favor of `getAudioPlayer()`, which handles both API choices under the hood.

This change only effects plugin developers. If you want to update to use the new `getAudioPlayer()`, it is recommend that you call this new method using the `await` syntax, which requires an asynchronous `trial` function:
This change only affects plugin developers. If you want to update to use the new `getAudioPlayer()`, it is recommend that you call this new method using the `await` syntax, which requires an asynchronous `trial` function:
```js
const audio = await jsPsych.pluginAPI.getAudioPlayer('my-sound.mp3');
```
Expand Down Expand Up @@ -148,7 +145,7 @@ Along with this, the `start()` and `pause()` functions were removed from the `Au
You can still call `stop()` upon an audio ending in order to regenerate the `AudioPlayer`, and be able
to call `play()` on it again.

For a general guide on implementation, the `audio-button-response` plugin uses the `await` syntax
For a general guide on implementation, the [`audio-button-response`](https://github.com/jspsych/jsPsych/blob/main/packages/plugin-audio-button-response/src/index.ts) plugin uses the `await` syntax
to handle playing audio.

## Changes to `finishTrial()`
Expand Down

0 comments on commit f4ba84a

Please sign in to comment.