Skip to content

Commit d4185a9

Browse files
maratalclaude
andcommitted
fix: split mixed shell/js code blocks in Next.js push guide
Separating shell and javascript into distinct Code blocks prevents selecting the shell tab from breaking js-only code blocks on the page. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 348b1e3 commit d4185a9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/pages/docs/push/getting-started/nextjs.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ Navigate to `http://localhost:3000/push` in your browser. Click **Activate Push*
342342

343343
### Test push notifications <a id="step-3-test"/>
344344

345-
Once the device is activated, send a test push notification directly to your client ID using the Ably CLI or from code:
345+
Once the device is activated, send a test push notification directly to your client ID using the Ably CLI:
346346

347347
<Code>
348348
```shell
@@ -351,7 +351,11 @@ ably push publish --client-id push-tutorial-client \
351351
--body "Hello from CLI!" \
352352
--data '{"foo":"bar"}'
353353
```
354+
</Code>
355+
356+
Or from code:
354357

358+
<Code>
355359
```javascript
356360
await client.push.admin.publish(
357361
{ clientId: 'push-tutorial-client' },
@@ -371,7 +375,9 @@ ably push publish --device-id <your-device-id> \
371375
--title "Test push" \
372376
--body "Hello from CLI!"
373377
```
378+
</Code>
374379

380+
<Code>
375381
```javascript
376382
await client.push.admin.publish(
377383
{ deviceId: client.device().id },
@@ -458,7 +464,7 @@ export function ChannelSubscription({ onLog }: { onLog: (msg: string) => void })
458464

459465
`usePush` returns `isActivated` — a reactive boolean shared with `usePushActivation` via a module-level store. When `PushActivationBanner` calls `activate()`, all `usePush` instances update automatically, so the subscribe buttons enable without any extra wiring.
460466

461-
To test channel push, subscribe to the channel in the UI then send a push notification to the channel using the Ably CLI or from code:
467+
To test channel push, subscribe to the channel in the UI then send a push notification to the channel using the Ably CLI:
462468

463469
<Code>
464470
```shell
@@ -467,7 +473,11 @@ ably push publish --channel exampleChannel1 \
467473
--body "Hello from CLI!" \
468474
--data '{"foo":"bar"}'
469475
```
476+
</Code>
470477

478+
Or from code:
479+
480+
<Code>
471481
```javascript
472482
await channel.publish({
473483
name: 'example',

0 commit comments

Comments
 (0)