jsPsych icon indicating copy to clipboard operation
jsPsych copied to clipboard

Code-based plugin parameter docs

Open bjoluc opened this issue 3 years ago • 3 comments

Making this PR against core-rewrite for cleaner diffs, but it should target v8 once #2858 is merged.

We can have mkdocs auto-generate plugin parameter tables to reduce some redundancy, prevent mismatches, and – by moving extended parameter descriptions into source files – improve in-editor code hints :tada: This setup uses the mkdocs-macros plugin and TypeDoc under the hood: When writing {{ plugin_parameters('html-keyboard-response') }} in a plugin's documentation, mkdocs invokes a python function that uses TypeDoc to parse the plugin's index.ts, retrieving a JSON representation which it uses to generate and return the markdown table :sparkles:

To try it, check out the PR, run npm install, poetry install and npm run docs:preview. The html-keyboard-response.md docs look the same, but were generated on-the-fly :+1: Editing packages/plugin-html-keyboard-response/src/index.ts rebuilds the documentation.

bjoluc avatar Nov 21 '22 17:11 bjoluc

⚠️ No Changeset found

Latest commit: 8be09f93480b22a47ad6a63f10ce36ee01b9e0a0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Nov 21 '22 17:11 changeset-bot[bot]

Oh that's fantastic. I've been dreaming of something like this for a while and never had the time to figure out how to pull it off. Excited to try it out and make the switch.

jodeleeuw avatar Nov 21 '22 19:11 jodeleeuw

@Bankminer78 and @vzhang03 - this could be another thing we do over the next 2 weeks.

jodeleeuw avatar Jul 19 '24 00:07 jodeleeuw