Skip to content

autodoc: Remove empty params sections or use placeholder text #72

Description

@becky-gilbert

This issue might just be an artifact of the fact that autodoc is not picking up my start parameters (#73), rather than something that happens more generally. But I figured I'd write it up anyway, just in case.

When a parameter section/table is empty, autodoc currently renders it as a section with an empty table:

<!-- jspsych-autodocs:trial-parameters:start -->
### Trial Parameters

Trial parameters are set when adding an extension to the trial object.

```js
var trial = {
  type: jsPsych...,
  extensions: [
    { type: jsPsychExtensionExtensionPause, params: { ... } }
  ]
}
```

| Parameter | Type | Default Value | Description |
| --------- | ---- | ------------- | ----------- |
<!-- jspsych-autodocs:trial-parameters:end -->

Which looks a little weird, since it's a section that shows how to set parameters, followed by an empty parameter table.

<!-- jspsych-autodocs:trial-parameters:start -->
### Trial Parameters

Trial parameters are set when adding an extension to the trial object.

```js
var trial = {
  type: jsPsych...,
  extensions: [
    { type: jsPsychExtensionExtensionPause, params: { ... } }
  ]
}
```

| Parameter | Type | Default Value | Description |
| --------- | ---- | ------------- | ----------- |
<!-- jspsych-autodocs:trial-parameters:end -->

It might be better to detect this case and either remove the entire section, or keep it but replace the content with something like "This [plugin]/[extension] does not take any [PARAMETER_TYPE] parameters."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions