Skip to content

Conversation

@hoodmane
Copy link
Contributor

Summary

Added Python code to the tab switcher for the d1 tutorial.
In order to do this I had to refactor TypeScriptExample into TypeScriptExample and TypeScriptTabs. TypeScriptExample creates the <Tabs> and then uses <TypeScriptTabs> and <TypeScriptTabs> creates the two tab items. That way I can add a Python tab to the tab switcher.

Screenshots (optional)

image

Documentation checklist

Copy link
Contributor

@dom96 dom96 left a comment

Choose a reason for hiding this comment

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

I don't think this refactoring is necessary, we already have a way to add Python to these examples. See how I've done it here for example:

<Tabs syncKey="workersExamples">
<TypeScriptExample omitTabs={true}>
```ts
export class MyDurableObject extends DurableObject<Env> {
constructor(ctx: DurableObjectState, env: Env) {
// Required, as we're extending the base class.
super(ctx, env)
}
}
```
</TypeScriptExample>
<TabItem label="Python" icon="seti:python">
```python
from workers import DurableObject
class MyDurableObject(DurableObject):
def __init__(self, ctx, env):
super().__init__(ctx, env)
```
</TabItem>
</Tabs>

@hoodmane
Copy link
Contributor Author

And I opened it from my production branch. I guess I'll close it and make a new one.

@hoodmane hoodmane closed this Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:d1 D1: https://developers.cloudflare.com/d1/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.