[Workers AI] Expand all usage code examples by default on model pages#28462
[Workers AI] Expand all usage code examples by default on model pages#28462superhighfives wants to merge 1 commit intocloudflare:productionfrom
Conversation
Add 'open' attribute to all Details components in model code examples so users can immediately see Worker, Python, and curl examples without needing to click to expand them. Jira: AI-4123
There was a problem hiding this comment.
Pull request overview
This PR updates Workers AI model documentation components so that code example sections are expanded by default, letting users immediately see the Workers/TypeScript, Python, and curl snippets on model pages without extra clicks.
Changes:
- Adds the
openattribute to<Details>blocks across model code example components. - Ensures code snippets are visible by default for Workers/TypeScript, Python, and curl examples (where present).
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/components/models/code/WhisperBase64Code.astro | Expand Workers/Python/curl code examples by default via open. |
| src/components/models/code/TranslationCode.astro | Expand Workers/Python/curl code examples by default via open. |
| src/components/models/code/TextToImageCode.astro | Expand Workers/curl code examples by default via open. |
| src/components/models/code/TextGenerationCode.astro | Expand all code example sections (including streaming/lora variants) by default via open. |
| src/components/models/code/TextEmbeddingCode.astro | Expand Workers/Python/curl code examples by default via open. |
| src/components/models/code/TextClassificationCode.astro | Expand Workers/Python/curl code examples by default via open. |
| src/components/models/code/SummarizationCode.astro | Expand Workers/curl code examples by default via open. |
| src/components/models/code/StableDiffusion-v1-5-inpaintingCode.astro | Expand Workers/curl code examples by default via open. |
| src/components/models/code/StableDiffusion-v1-5-img2imgCode.astro | Expand Workers/curl code examples by default via open. |
| src/components/models/code/OpenAIResponsesTextGenerationCode.astro | Expand Worker/Python/curl examples by default via open. |
| src/components/models/code/ObjectDetectionCode.astro | Expand Workers/curl code examples by default via open. |
| src/components/models/code/MelottsCode.astro | Expand Workers/TypeScript example by default via open. |
| src/components/models/code/LlamaGuard.astro | Expand Worker/Python/curl examples by default via open. |
| src/components/models/code/ImageToTextCode.astro | Expand Workers/TypeScript example by default via open. |
| src/components/models/code/ImageClassificationCode.astro | Expand Workers/curl code examples by default via open. |
| src/components/models/code/Flux-2.astro | Expand Workers/curl code examples by default via open. |
| src/components/models/code/Flux-1-Schnell.astro | Expand both Workers examples and curl by default via open. |
| src/components/models/code/DeepgramNova.astro | Expand Worker/curl code examples by default via open. |
| src/components/models/code/DeepgramFlux.astro | Expand the step-by-step Details sections by default via open. |
| src/components/models/code/DeepgramAura.astro | Expand Worker/curl code examples by default via open. |
| src/components/models/code/Bge-Reranker-Base.astro | Expand Worker/Python/curl examples by default via open. |
| src/components/models/code/AutomaticSpeechRecognitionCode.astro | Expand Workers/curl code examples by default via open. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </Details> | ||
|
|
||
| <Details header="cURL"> | ||
| <Details header="cURL" open> |
There was a problem hiding this comment.
The header casing is inconsistent within this component: it uses "cURL" in one section but "curl" elsewhere. Since these Details are now expanded by default, the inconsistency is more visible; consider standardizing on one label (the rest of the model examples appear to use "curl").
| <Details header="cURL" open> | |
| <Details header="curl" open> |
Summary
openattribute to all<Details>components in Workers AI model code examplesJira
https://jira.cfdata.org/browse/AI-4123