Always use a list for `Params` and `Raises` in API docs
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 106
- Forks
- 223
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 72
Description
Sphinx does not use an unordered list <ul> if there is only a single element:
Compare that to:
We think it would be more readable if we always used a bullet list, even when there is only one element:
This is the path forward for adding indentation, https://github.com/Qiskit/documentation/issues/736.
--
This change should happen in the API conversion script, rather than the web app. That is, the change should happen in the children of the <Function> component, rather than the component itself making this transformation. We would update processHtml.ts to convert single values into a <ul> with one <li>.
This should be done for Params, Raises, probably Yields, and probably more of https://sphinxcontrib-napoleon.readthedocs.io/en/latest/#docstring-sections. But it should not be added to everything. For example, return type should not have indentation since it never has >1 element.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading processHtml.ts and the children of the component in the API conversion path. Check how Sphinx sections such as Params, Raises, and Yields are currently converted, while keeping return type unchanged. Done means eligible single-value sections render as a
- containing one
- , without changing the web component itself.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100