@@ -130,12 +130,68 @@ Link to related docs rather than repeating content:
130130For automatic tracing, see <PlatformLink to="/configuration/apis/">API Reference</PlatformLink>.
131131```
132132
133- ### Code Block Filenames
133+ ### Code Block Meta Flags
134134
135135Always include filename when showing file-specific code:
136136``` tsx {filename:app/error.tsx}
137137```
138138
139+ Consecutive fenced code blocks are automatically grouped into tabbed code snippets.
140+ Each tab can have a title and filename:
141+
142+ ~~~
143+ ```swift {tabTitle:Swift}
144+ SentrySDK.capture(error: error)
145+ ```
146+
147+ ```objc {tabTitle:Objective-C}
148+ [SentrySDK captureError:error];
149+ ```
150+ ~~~
151+
152+ #### Markdown Export and ` {mdExpandTabs} `
153+
154+ The ` .md ` export (mainly used by LLMs via the "Copy page" button) ** collapses tab groups
155+ by default** : only the first tab is included, with a note listing the other tabs
156+ (e.g. * Other available variations of the above snippet: yarn, pnpm* ). This keeps context lean when tabs show
157+ trivial variations an LLM can infer on its own.
158+
159+ Add ` {mdExpandTabs} ` to the first code fence in a group when the tabs contain code an LLM
160+ ** cannot reliably derive** from seeing just one tab. This is rare — most times, adding only
161+ one tab to the produced ` .md ` is enough.
162+
163+ ~~~
164+ ```swift {tabTitle:Swift} {mdExpandTabs}
165+ SentrySDK.start { options in
166+ options.dsn = "..."
167+ }
168+ ```
169+
170+ ```objc {tabTitle:Objective-C}
171+ [SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
172+ options.dsn = @"...";
173+ }];
174+ ```
175+ ~~~
176+
177+ ** Expand** — the code is too different for an LLM to infer:
178+ - Different languages: Swift / Objective-C, cross-language guides (JS/Python/PHP/Ruby/...)
179+ - Different setup flows: Hono guide init (Cloudflare vs Node.js ` --import ` vs Bun)
180+ - Different APIs or wrappers: GCP Cloud Functions (` wrapHttpFunction ` vs ` wrapCloudEventFunction ` ), serverless async/sync handlers
181+ - Different framework versions with distinct imports: Spring 5/6/7, Spring Boot 2/3/4, Svelte v5+ / v3
182+ - Client / Server splits: Next.js, Remix, React Router (Replay + browser tracing vs Node integrations)
183+ - Different platform tooling: KMP (` commonMain ` / ` iosApp ` / ` androidApp ` ), Flutter navigation (Navigator / GoRouter / AutoRoute)
184+ - Install methods with different patterns: npm (` import ` ) vs CDN (` <script> ` ) vs Loader (` sentryOnLoad ` )
185+ - SDK version migration: SDK 2.x vs 1.x when APIs differ
186+
187+ ** Collapse** (default) — an LLM can figure it out from one tab:
188+ - Package managers: npm / yarn / pnpm, pip / uv, .NET CLI / NuGet
189+ - Module format: ESM / CommonJS (same API, different import syntax)
190+ - Config file formats: JSON / TOML, properties / yml
191+ - Java / Kotlin on the same platform (same APIs, syntactic sugar differences)
192+ - Runtime tabs where only the import path changes (e.g. ` @sentry/hono/cloudflare ` vs ` @sentry/hono/node ` in ` platform-includes/ ` snippets)
193+ - Build tools when only dependency declaration syntax differs: Gradle / Maven / SBT
194+
139195## Review Checklist
140196
141197When reviewing documentation:
0 commit comments