Skip to content

Folding large constants? #507

@woodruffw

Description

@woodruffw

First of all, thanks for pdoc! I'm a very happy user, both on my hobby projects and professionally.

Problem Description

I'm working to port a handful of repositories away from pdoc3, for well-trodden reasons. Most of the differences between the two are minor, but one that I'm currently running into is how pdoc renders large constants: it renders the entire constant, rather than either truncating or folding it.

For example, this render:

...becomes this in pdoc:

(it goes on for quite a bit after that 🙂)

Proposal

It'd be nice to have either a default or a configurable option for truncating or folding large constants! I'm not sure if there's a great heuristic for this, so offering folding (i.e., requiring the user to click a <details> element to unfurl) might be slightly better for UX.

Alternatives

I assume I could do this with some template hackery on my own, but I figured this would be a reasonable thing to raise upstream!

Additional context

No other context. If this is functionality that you'd be interested in, I'd be willing to make an attempt at implementing it. Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions