-
Notifications
You must be signed in to change notification settings - Fork 487
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
Blocks to show parents in docs headers. #5381
Conversation
I'm worried about the side effects of introducing content duplication on the same page for components where the same block is used in multiple parts of the overall hierarchy. In particular, I'm concerned that readers will get overwhelmed with thinking that there's more behaviors about a component to learn, when in reality some behavior is shared. Aside from the hierarchy table we have today, are there any other ways we can include metadata about a particular block to show it's hierarchy that don't involve literally including it on the page multiple times? |
Hi @rfratto, I think you are referring to a different issue. The goal of this PR is to make distinct headers for two blocks which have the same name. In the case of I agree with you about the repetition, but I think it should be handled in a separate PR. In the case with
|
I haven't checked yet... but... how much deeper do we go than:
and so on? Are there cases of field > label > something > something else ? Another option would be to make these another heading level and H4 should still work cleanly (I want to test it) So the toc would be more like:
|
@ptodev Just thought of something on this that might make the proposed change a bit awkward. When you have child elements used in more than one place like...
|
A much broader overhaul of how blocks are documented is underway. It will include parts of this PR. I am closing this PR so that we can open a new one with much more changes. |
There are two issues with the current best practices for writing flow components:
#5229 introduced the
otelcol.processor.k8sattributes
component which contains two blocks called "label". The best practices for writing flow components docs do not mention what to do in this case. If we follow them, we will end up with two blocks with the same name in the table of contents:In this PR, I am proposing two changes:
This is what the table of contents looks like for
otelcol.processor.k8sattributes
after this change:I believe this looks much cleaner. There are only two issues which I can think of:
Obviously, it's a lot of work to update all the docs to follow this convention. For now we can just do it for
otelcol.processor.k8sattributes
, and we can also update other docs over time. I believe the long term gain in usability is worth the short term inconsistency.The table of contents might look a bit off for deeply nested blocks. The name of the block goes on another line, and that line starts to look like a whole other block hierarchy. However, I think this is not such a bit problem, because when you mouse over you see that it's all one big link. Also, I don't expect deeply nested blocks to be common (but I have not checked if that's the case). It might be better if we somehow don't let an overflow to a new line though, and instead we could have a horizontal scrollbar like the one we have if a block name is too long (see point 3). I could raise a ticket with the website team to ask if it's possible?
![Screenshot 2023-10-05 at 18 34 26](https://private-user-images.githubusercontent.com/5834788/272992947-ade98314-cbe4-4cc0-b1be-b4984feceab2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMTU5NDYsIm5iZiI6MTczOTMxNTY0NiwicGF0aCI6Ii81ODM0Nzg4LzI3Mjk5Mjk0Ny1hZGU5ODMxNC1jYmU0LTRjYzAtYjFiZS1iNDk4NGZlY2VhYjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMjMxNDA2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTZhZTUwYjg1ODkwZTc4MGQ2NGIzZjUyNWY4YjFiOTVkMzc4NTFjMDdlNGYyZDEyZjI3MGU4YmQ2N2E3OWQzNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.-kQriw5UgTj000TeTFg3Gn7Qhy2pfVJk2kPElScNdD4)
![Screenshot 2023-10-05 at 18 34 34](https://private-user-images.githubusercontent.com/5834788/272992949-f2c5e2a7-37e9-433a-8a30-651c07af4a10.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMTU5NDYsIm5iZiI6MTczOTMxNTY0NiwicGF0aCI6Ii81ODM0Nzg4LzI3Mjk5Mjk0OS1mMmM1ZTJhNy0zN2U5LTQzM2EtOGEzMC02NTFjMDdhZjRhMTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMjMxNDA2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjM3OTFkZDAzMzg4NmRmZjNlYWMyMDMwMDJlM2EwNmEzYTAxMzAxNDdlNmQyM2RhYzZkNjkwNDEwMDJjNzJmNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.O69_bhn5HUjJEJLd33MW4BYl02q2ylhAJoqGdtaadyU)
I also tried how it looks for blocks with very long names - we get a scrollbar, so I think that's all good: