Skip to content

Properly add <wbr> tags to the left (site) menu and the central content list items #2940

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

Closed
sanex3339 opened this issue Apr 21, 2025 · 1 comment
Labels
good first issue Easier issue for first time contributors help wanted Contributions are especially encouraged
Milestone

Comments

@sanex3339
Copy link

sanex3339 commented Apr 21, 2025

Problem

Right now, the typedoc adds <wbr> tags to the menu items of the right (page) menu.
But the left (site) menu and content menu items don't have <wbr> tags added, it causes scroll bars on narrow screen width.
It can be solved via a customjs logic, but this is far from ideal.

It would be nice to have native support for <wbr> tags for the mentioned lists

Suggested Solution

Add tags to the left (site) menu and the central content list items.

The images below show how the left and content menus would look after the <wbr> tags are added to items.
Image

Image

Image

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 21, 2025

PR welcome, this would have to be done in the JS that builds the navigation on the client side:

https://github.com/TypeStrong/typedoc/blob/master/src/lib/output/themes/default/assets/typedoc/Navigation.ts#L113

It will need a version of the wbr helper implemented which works on regular strings rather than with JSX elements:

https://github.com/TypeStrong/typedoc/blob/master/src/lib/output/themes/lib.tsx#L43-L64

@Gerrit0 Gerrit0 added help wanted Contributions are especially encouraged good first issue Easier issue for first time contributors labels Apr 21, 2025
@Gerrit0 Gerrit0 added this to the v0.28.4 milestone Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Easier issue for first time contributors help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

2 participants