Skip to content

Commit 5787c93

Browse files
Copilotjodeleeuw
andcommitted
Update documentation to describe plugin docs generation
Co-authored-by: jodeleeuw <595524+jodeleeuw@users.noreply.github.com>
1 parent 5613013 commit 5787c93

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

docs/developers/documentation.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,35 @@ To build a local copy of the docs, you will need to install `mkdocs`, `mkdocs-ma
1212

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

15+
## Generating plugin documentation
16+
17+
Plugin documentation can be automatically generated from the JSDoc comments in plugin source files. The generator extracts:
18+
19+
- Plugin description from the class JSDoc comment
20+
- Parameter information from the `info.parameters` object
21+
- Data field information from the `info.data` object
22+
- Example file references from the `examples/` directory
23+
24+
To generate documentation for a single plugin:
25+
26+
```bash
27+
npm run generate-plugin-docs -- html-button-response
28+
```
29+
30+
To generate documentation for all plugins:
31+
32+
```bash
33+
npm run generate-plugin-docs -- --all --output docs/plugins
34+
```
35+
36+
To see all available options:
37+
38+
```bash
39+
npm run generate-plugin-docs -- --help
40+
```
41+
42+
The generated documentation follows the same format as the existing plugin docs, including parameters tables, data generated tables, and install instructions.
43+
1544
## Building a local copy of the docs
1645

1746
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`.

0 commit comments

Comments
 (0)