Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folding large constants? #507

Closed
woodruffw opened this issue Feb 17, 2023 · 2 comments
Closed

Folding large constants? #507

woodruffw opened this issue Feb 17, 2023 · 2 comments

Comments

@woodruffw
Copy link

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!

@mhils
Copy link
Member

mhils commented Feb 17, 2023

Hi @woodruffw! Thank you for the kind words. I absolutely agree this is something we should fix. I'd be happy with either truncation and folding, both are clear improvements. Please shoot a PR with whatever you think works best, and let me know if I can help with anything!

@woodruffw
Copy link
Author

Opened #508 with my attempt!

mhils added a commit to mhils/pdoc that referenced this issue Feb 19, 2023
mhils added a commit to mhils/pdoc that referenced this issue Feb 19, 2023
@mhils mhils closed this as completed in 419a8c4 Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants