Skip to content

Conversation

@franrob-projects
Copy link
Contributor

@franrob-projects franrob-projects commented Oct 22, 2025

This PR:

  • Converts https://ably.com/docs/api/sse to MDX

EDU-2114

@franrob-projects franrob-projects added the review-app Create a Heroku review app label Oct 22, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 22, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch EDU-2114-convert-sse-api-ref-to-mdx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ably-ci ably-ci temporarily deployed to ably-docs-edu-2114-conv-nb75qw October 22, 2025 14:07 Inactive
@franrob-projects franrob-projects temporarily deployed to ably-docs-edu-2114-conv-nb75qw October 23, 2025 14:14 Inactive
@franrob-projects franrob-projects temporarily deployed to ably-docs-edu-2114-conv-nb75qw October 23, 2025 14:55 Inactive
@franrob-projects franrob-projects force-pushed the EDU-2114-convert-sse-api-ref-to-mdx branch from dfb305a to 02fa986 Compare October 23, 2025 14:57
@franrob-projects franrob-projects temporarily deployed to ably-docs-edu-2114-conv-nb75qw October 23, 2025 14:57 Inactive
@franrob-projects franrob-projects temporarily deployed to ably-docs-edu-2114-conv-nb75qw October 27, 2025 10:06 Inactive
@franrob-projects franrob-projects force-pushed the EDU-2114-convert-sse-api-ref-to-mdx branch from 67c765c to 31ce47a Compare October 27, 2025 11:07
@franrob-projects franrob-projects temporarily deployed to ably-docs-edu-2114-conv-nb75qw October 27, 2025 11:07 Inactive
Copy link
Contributor

@GregHolmes GregHolmes left a comment

Choose a reason for hiding this comment

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

Few rendering issues here but other than that it's good

Comment on lines +43 to +73
<Code>
```javascript
var apiKey = '{{API_KEY}}';
var url = 'https://main.realtime.ably.net/event-stream?channels=myChannel&v=1.2&key=' + apiKey;
var eventSource = new EventSource(url);

eventSource.onmessage = function(event) {
var message = JSON.parse(event.data);
console.log('Message: ' + message.name + " - " + message.data);
};
```

```python
import json
import sseclient

api_key='{{API_KEY}}'
url = "https://main.realtime.ably.net/sse?channels=myChannel&v=1.2&key=%s" % (api_key)

def with_urllib3(url):
import urllib3
http = urllib3.PoolManager()
return http.request('GET', url, preload_content=False)

response = with_urllib3(url)
client = sseclient.SSEClient(response)
for event in client.events():
message = json.loads(event.data)
print("Channel: %s - Message: %s - %s " % (message['channel'], message['name'], message['data']))
```
</Code>
Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2025-10-27 at 16 59 53

This is going to cause the issue in the screenshot.

we should only render the one specific to the language, no need for the language choice in the code block.

I can't recommend the example as the triple backticks, cause issues as this is markdown textbox.

But basically it should be

If

Code
backticks-language
The actual code
backticks
EndCode

EndIf

Here is an example: https://github.com/ably/docs/pull/2927/files#diff-40e8319d4cd9fc5550d96816bea937bdb9bada6c0fd46336c7bee3928d636a48R205

```
</Code>

<Code language="bash,javascript nodejs, python">
Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2025-10-27 at 17 02 59

This should just be not the language part.

</Code>

<Code language="bash,javascript nodejs, python">
```bash
Copy link
Contributor

Choose a reason for hiding this comment

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

shell


Once a streaming response is established, every line (other than empty lines sent as keepalive packets) will be a simple JSON object of the following form:

<Code language="javascript, nodejs, python">
Copy link
Contributor

Choose a reason for hiding this comment

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

only.


##### Code example

<Code language="bash, javascript, nodejs, python">
Copy link
Contributor

Choose a reason for hiding this comment

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

only.

##### Code example

<Code language="bash, javascript, nodejs, python">
```bash
Copy link
Contributor

Choose a reason for hiding this comment

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

shell

```
</Code>

<Code>
Copy link
Contributor

Choose a reason for hiding this comment

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

I know we don't recommend in this instance making changes. But I think we should here.

First we should wrap this in an If lang="nodejs" If statement.
Then we should duplicate it and replace the <If lang="nodejs" and the backticks nodejs. with javascript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

4 participants