sphinx-doc / sphinx-doc/sphinx

Support word wrapping for types

Open
#11,403 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:proposal
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
This request is to support word wrapping in types for parameters/attributes/...

Describe the solution you'd like

    """...

    Parameters
    ----------
    choices: Union[Dict[:class:`str`, Union[:class:`str`, :class:`int`, :class:`float`]],
             Iterable[Union[:class:`str`, :class:`int`, :class:`float`]]]
        A list of choices that a user must choose.

   ...
   """

Describe alternatives you've considered
I am aware type aliases are possible, but sometimes it is not worth making a whole alias for one type.

Additional context
image
This is the current result, a - in the middle where the wrap took place.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by reproducing the displayed wrapping with the long Python type in a Sphinx-generated document, then trace how parameter and attribute types are rendered and wrapped. Done means long types wrap without inserting a hyphen in the middle while preserving existing type formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.