Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/developers/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,35 @@ To build a local copy of the docs, you will need to install `mkdocs`, `mkdocs-ma

Run the command `poetry install` in the root directory of jsPsych to install `mkdocs`, `mkdocs-material`, and their dependencies.

## Generating plugin documentation

Plugin documentation can be automatically generated from the JSDoc comments in plugin source files. The generator extracts:

- Plugin description from the class JSDoc comment
- Parameter information from the `info.parameters` object
- Data field information from the `info.data` object
- Example file references from the `examples/` directory

To generate documentation for a single plugin:

```bash
npm run generate-plugin-docs -- html-button-response
```

To generate documentation for all plugins:

```bash
npm run generate-plugin-docs -- --all --output docs/plugins
```

To see all available options:

```bash
npm run generate-plugin-docs -- --help
```

The generated documentation follows the same format as the existing plugin docs, including parameters tables, data generated tables, and install instructions.

## Building a local copy of the docs

Run `poetry run mike deploy [version] -u` to build a new version of the documentation or to override an existing version. For example, if you are testing an edit to version `7.2` of the documentation, run `poetry run mike deploy 7.2 -u`.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build:archive": "gulp createCoreDistArchive",
"update-unpkg-links": "gulp updateUnpkgLinks",
"update-plugin-versions": "gulp updatePluginVersions",
"generate-plugin-docs": "node packages/config/generatePluginDocs.js",
"prepare": "node -e 'process.exit(+!process.env.CI)' || (husky install && npm run build)",
"tsc": "turbo tsc",
"changeset": "changeset",
Expand Down
Loading
Loading