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

Double side TOC for GitHub/GitLab tabs headers #736

Open
1 task done
fharper opened this issue Aug 12, 2024 · 2 comments
Open
1 task done

Double side TOC for GitHub/GitLab tabs headers #736

fharper opened this issue Aug 12, 2024 · 2 comments
Labels
P2 - Need It's needed, but not require for using our product. Great to have for a better user experience. wrong Some information in the documentation is wrong

Comments

@fharper
Copy link
Contributor

fharper commented Aug 12, 2024

What type of suggestions?

Something's not working

What page is concerned?

https://docs.kubefirst.io/aws/overview

What version of the docs?

2.4+

What is the issue?

In all documentation page where there is a GitHub/GitLab tab with the same header (the content structure of those are usually the same), Docusaurus display the two headers on the right side of the page, and not the one only visible. That wouldn't be such an issue if Docusaurus was able to display the right tab if you click on the header of the unfocussed one (we could have giving them specific name), but it's not. So it doesn't look good, and it's not totally functionnal.

tabs-output.mp4

Code of Conduct

  • I agree to follow this project's Code of Conduct
@fharper fharper added wrong Some information in the documentation is wrong P2 - Need It's needed, but not require for using our product. Great to have for a better user experience. labels Aug 19, 2024
@fharper
Copy link
Contributor Author

fharper commented Aug 19, 2024

Not critical, but it doesn't look good.

@fharper
Copy link
Contributor Author

fharper commented Aug 26, 2024

So there is no way to prevent this as Docusaurus isn't dynamically creating the TOC at runtime. The "solution" is to either

  1. remove the headers from tabs (which would go against why we use them—to deduplicate content),
  2. use HTML tags for headers inside the tabs so Docusaurus won't use them in the TOC.
  3. remove the right side TOC entirely.

Option one is going against why we use tabs, which is to minimize duplicated content. Option two make the TOC working differently depending on the situation, so not ideal: it will also be a PITA to remember to use HTML element vs Markdown for headers when inside a tab. Option three is the most clean in terms of keeping the same experience everywhere, but it will remove a TOC that may be useful for the users to find the content, so really not the best option here.

See #743 for more information.

It's not that critical as an issue, but it doesn't look professional as the TOC is something that should be quite simple to manage. In addition to that, the TOC item only work for the content displayed in the actual select tabs. Let's say I selected the GitHub tab, like in the screenshot from the initial issue comment, if I click on the first Application the browser will move to the proper anchor. If I click on the second Application, which is the one from the GitLab tab, if GitHub is selected, it will do nothing, caused the header is not visible. So it become non-useful.

Really not sure what to do here (option #2 seem the most "appropriate"), so thinking out loud if anyone has any ideas or preferences.

For now, I'll leave it like this unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 - Need It's needed, but not require for using our product. Great to have for a better user experience. wrong Some information in the documentation is wrong
Projects
None yet
Development

No branches or pull requests

1 participant