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

TOC overlaying wide content #1047

Open
glenncarr opened this issue Feb 27, 2024 · 4 comments
Open

TOC overlaying wide content #1047

glenncarr opened this issue Feb 27, 2024 · 4 comments

Comments

@glenncarr
Copy link

We have a few pages that display some wide tables. The rightmost columns have links that are not clickable due to the "In This Article"/TOC div element. For example:
image

Also, when scrolling down the TOC overlays the content. Same above page after scrolling down:
image

Any suggestions other than not using tables for the content? Would it be possible on a page-by-page basis to disable the TOC or make it always display at the top of the page as it does when the browser window is very narrow?

Thanks,
Glenn

@EWSoftware
Copy link
Owner

I'm not seeing that behavior. The divs create columns and the content is typically restricted to the width of each column (TOC on the left, content in the middle, and In This Article on the right). Can you provide an example that shows the behavior you are seeing?

@glenncarr
Copy link
Author

@EWSoftware
Copy link
Owner

EWSoftware commented Feb 28, 2024

The problem is caused by long, unbroken strings of text that cannot be word wrapped. They seem to cause a minimum column width which makes the div exceed its normal bounds and causes the overlapping. You can work around it to some extent by inserting HTML word break elements (wbr) in the long text strings so that the browser knows were it can break the text and allow wrapping. It's not a valid MAML element but due to the way the elements are handled, it'll be recognized and passed through anyway.

<entry>
    <legacyBold>XXXXXXX<wbr/>XXXXXXXXXXX_<wbr/>XXXXXXXX_<wbr/>XXXXXXXXXXX</legacyBold>
</entry>

I do that in the link text for API members, but it looks like I missed a number of places so it's not consistent and I'll have to go back through fix those up. My knowledge of HTML and CSS is marginal so I'm not sure if there's a way to prevent the overlapping and just make it scroll horizontally instead or hide it if it overlaps. For me, it would probably be easier to just provide an option to hide the In This Article div for the page on a case-by-case basis.

@glenncarr
Copy link
Author

glenncarr commented Feb 28, 2024

We actually generate the MAML for this particular page with another tool as a build step before finally building the .shfbproj. It would be possible to add <wbr/>'s, those specific values are symbols that would look strange if broken. I'd thought about making that into a definitionTable, but it loses its value without the other information in the columns.

For me, it would probably be easier to just provide an option to hide the In This Article div for the page on a case-by-case basis.

That would be great and very much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants