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

Use tab sets to avoid synchronization of input/ouput tabs in Sphinx #2577

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yefrig
Copy link
Contributor

@yefrig yefrig commented Apr 7, 2025

Background

The current implementation in Smithy-docgen synchronizes all "Input" and "Output" tabs across operation examples, which creates a poor user experience when dealing with multiple examples in Sphinx.

It is not yet possible to avoid tab synchronization without changing the tab labels which in this case are fixed to "Input" and "Output" for all examples.

We can instead use tab sets supported in sphinx-design.

Testing

  • I did an end-to-end doc generation run for a quick-start example and verified the tabs are no longer synchronized.
  • I also did an end-to-end doc generation run without the inline_tab dependency to verify it is no longer needed.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

yefrig added 2 commits April 4, 2025 14:22
Currently, the sphinx inline tab plugin is used for tabs but that
synchronizes all tabs with the same label together. When an operation
has multiple examples, synchronizing the input and output tabs is not
ideal UX.
@yefrig yefrig requested a review from a team as a code owner April 7, 2025 14:43
@yefrig yefrig requested a review from haydenbaker April 7, 2025 14:43
Copy link
Contributor

@JordonPhillips JordonPhillips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The motivating example isn't actually a problem. There's only an Input and Output tab right now to showcase that examples are tabbed. Both should be removed entirely when we have actual examples in languages being generated. Each tab then will be a language, and we definitely want those synchronized.

@yefrig
Copy link
Contributor Author

yefrig commented Apr 7, 2025

I think the use case for the language tabs makes sense. In the meantime, I would not be opposed to merging the change given that tab synchronization was added to sphinx-design as well.

@JordonPhillips
Copy link
Contributor

If you want to use the sphinx-design tabs, I'd lean into it by adding an overload that accepts a tab group name so that things sync deliberately. Off the top of my head, both examples and protocols should be synced.

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

Successfully merging this pull request may close these issues.

2 participants