-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Description
When viewing code examples in the SDK documentation, the expandable code sections show import statements and boilerplate (LLM setup, etc.) in the visible portion, while the actual relevant code for the topic is hidden until the user expands the section.
This creates a suboptimal reading experience where users must always expand code sections to find the code they should focus on.
Example
From the Conversation Persistence guide:
- The code block has 102 lines
- Only import statements are visible before expansion
- The relevant code demonstrating conversation persistence is hidden
This pattern appears across many documentation pages.
Suggested Improvement
Consider restructuring code examples so that:
- The relevant/topic-specific code is visible first (before expansion)
- Boilerplate imports and setup code are secondary (visible after expansion, or at the bottom)
Possible approaches:
- Reorder code blocks to put the most relevant code at the top
- Use separate code blocks: one for the key concept (visible) and one for full runnable example (expandable)
- Add line highlighting to draw attention to the relevant portions
- Consider a "focus mode" that shows only the relevant lines initially
Impact
This would improve the reader experience by making the documentation more scannable and reducing the friction to understand each concept.
Metadata
Metadata
Assignees
Labels
No labels