Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(internal): add 'language' prop to all Tabs in docs to enable syncing #6136

Merged
merged 2 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions fern/pages/sdks/capabilities/augment-with-custom-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Simply add your custom files to the SDK repository and list them out in `.ferni
won't override any files that you add in `.fernignore`.

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
<Steps>
### Create a new file `src/helper.ts`

Expand Down Expand Up @@ -49,7 +49,7 @@ won't override any files that you add in `.fernignore`.
```
</Steps>
</Tab>
<Tab title="Python">
<Tab title="Python" language="python">
<Steps>
### Create a new file `src/<package>/helper.py`

Expand Down Expand Up @@ -79,7 +79,7 @@ won't override any files that you add in `.fernignore`.
```
</Steps>
</Tab>
<Tab title="Java">
<Tab title="Java" language="java">
<Steps>
### Create a new file `src/main/java/<package>/Helper.java`

Expand Down Expand Up @@ -122,7 +122,7 @@ won't override any files that you add in `.fernignore`.
```
</Steps>
</Tab>
<Tab title="Go">
<Tab title="Go" language="go">
<Steps>
### Create a new file `helper.go`

Expand Down Expand Up @@ -164,7 +164,7 @@ principle is the same: **extension**. You can inherit the
Fern generated client and add whatever methods you want.

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
<Note>
See an example from Flatfile using this process in their [TypeScript SDK](https://github.com/FlatFilers/flatfile-node)
</Note>
Expand Down Expand Up @@ -218,7 +218,7 @@ Fern generated client and add whatever methods you want.
```
</Steps>
</Tab>
<Tab title="Python">
<Tab title="Python" language="python">
<Note>
See an example from ElevenLabs using this process in their [Python SDK](https://github.com/elevenlabs/elevenlabs-python/blob/main/src/elevenlabs/client.py).
</Note>
Expand Down Expand Up @@ -285,7 +285,7 @@ Fern generated client and add whatever methods you want.
```
</Steps>
</Tab>
<Tab title="Java">
<Tab title="Java" language="java">
<Steps>
### Rename the Fern-generated client
We suggest naming your Fern-generated client something like `BaseClient`to reflect that this client will be extended.
Expand Down Expand Up @@ -331,7 +331,7 @@ Fern generated client and add whatever methods you want.
```
</Steps>
</Tab>
<Tab title="Go">
<Tab title="Go" language="go">
<Steps>
### Create a new file `client/my_client.go`

Expand Down Expand Up @@ -390,8 +390,8 @@ Fern generated client and add whatever methods you want.

To add custom dependencies to your generated SDKs, you can update your `generators.yml`.

<CodeBlocks>
<CodeBlock title="TypeScript">
<Tabs>
<Tab title="TypeScript" language="typescript">
```yaml {4-7}
- name: fernapi/fern-typescript-node-sdk
version: "..."
Expand All @@ -401,8 +401,8 @@ To add custom dependencies to your generated SDKs, you can update your `generato
extraDevDependencies:
"@types/lodash-es": '1.0.0'
```
</CodeBlock>
<CodeBlock title="Python">
</Tab>
<Tab title="Python" language="python">
```yaml {4-7}
- name: fernapi/fern-python-sdk
version: "..."
Expand All @@ -412,5 +412,5 @@ To add custom dependencies to your generated SDKs, you can update your `generato
extra_dev_dependencies:
requests_mock: '1.12.1'
```
</CodeBlock>
</CodeBlocks>
</Tab>
</Tabs>
4 changes: 2 additions & 2 deletions fern/pages/sdks/capabilities/auto-pagination.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: Paginate through API responses easily with offset, cursor, and link
Instead of forcing SDK users to learn the intricacies of your pagination system, Fern SDKs will return an iterator so that users can simply loop through all the results.

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">

When pagination for an endpoint is configured, the TypeScript SDK method
will return a `Page<T>` where `T` is the underlying data type. The `Page<T>`
Expand Down Expand Up @@ -42,7 +42,7 @@ Instead of forcing SDK users to learn the intricacies of your pagination system,
```

</Tab>
<Tab title="Python">
<Tab title="Python" language="python">

When pagination for an endpoint is configured, the Python SDK method
will return a `Pager[T]` (specifically a `SyncPager[T]` or an `AsyncPager[T]`) where `T` is the underlying data type. The `Pager[T]`
Expand Down
4 changes: 2 additions & 2 deletions fern/pages/sdks/capabilities/discriminated-unions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ or
</AccordionGroup>

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">

```ts maxLines=0 {1}
export type Shape = Triangle | Square;
Expand Down Expand Up @@ -173,7 +173,7 @@ export function computeArea(shape: Shape): number {

</Tab>

<Tab title="Go">
<Tab title="Go" language="go">

Go does not have a built-in support for discriminated unions. However, you can define a union struct
to achieve the same effect:
Expand Down
2 changes: 1 addition & 1 deletion fern/pages/sdks/capabilities/forward-compatibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ legacy SDKs. You can safely add additional response properties, enum values, and
The legacy SDKs will safely handle deserializing extra information.

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
### Additional Response Properties
As you make new response properties available,
the legacy SDKs will continue to work. For example, let's say you
Expand Down
6 changes: 3 additions & 3 deletions fern/pages/sdks/capabilities/integration-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ add the test files to your `.fernignore` file to prevent them from being
overwritten by Fern.

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
<Steps>
### Create `tests/custom.test.ts`
```typescript
Expand Down Expand Up @@ -85,7 +85,7 @@ overwritten by Fern.
```
</Steps>
</Tab>
<Tab title="Python">
<Tab title="Python" language="python">
<Steps>
### Create `tests/test_custom.py`
```python
Expand All @@ -111,7 +111,7 @@ overwritten by Fern.
```
</Steps>
</Tab>
<Tab title="Java">
<Tab title="Java" language="java">
<Steps>
### Create `src/test/java/com/example/MyClientTest.java`

Expand Down
2 changes: 1 addition & 1 deletion fern/pages/sdks/capabilities/multipart-form-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Fern generated SDKs natively support uploading files and other media through
multipart form data uploads.

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
The TypeScript SDK will accept either a `fs.readStream`, `fs.ReadableStream` or a
`Blob` for the file types. This is to ensure that the file upload functionality
can be used in the browser, Node.js and edge runtimes like Next.js and Cloudflare.
Expand Down
6 changes: 3 additions & 3 deletions fern/pages/sdks/capabilities/oauth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For the `client-credentials` OAuth flow, the user simply provides their `client-
and they're ready to go.

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">

When OAuth is configured, the TypeScript SDK's client constructor will include the `clientId` and
`clientSecret` parameters.
Expand All @@ -30,7 +30,7 @@ and they're ready to go.

</Tab>

<Tab title="Python">
<Tab title="Python" language="python">

When OAuth is configured, the Python SDK's client constructor will include the `client_id` and
`client_secret` parameters.
Expand All @@ -48,7 +48,7 @@ and they're ready to go.

</Tab>

<Tab title="Java">
<Tab title="Java" language="java">

When OAuth is configured, the Java SDK’s builder methods for setting the `clientId` and `clientSecret` are available.

Expand Down
2 changes: 1 addition & 1 deletion fern/pages/sdks/capabilities/schema-validation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ languages like Python, TypeScript, and Ruby. However, for strongly typed
languages like Go, Java, and C# this is always on.

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
The TypeScript SDK contains a `serialization` folder when generated.

``` {5}
Expand Down
4 changes: 2 additions & 2 deletions fern/pages/sdks/capabilities/server-sent-events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ especially relevant for chat completions, where you want to stream LLM
outputs in real-time.

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
When an endpoint is configured to use Server-Sent Events, the TypeScript SDK
method will return an `AsyncIterable` of the underlying data type. This
allows you to use it in a `for await` loop.
Expand Down Expand Up @@ -45,7 +45,7 @@ outputs in real-time.
}
```
</Tab>
<Tab title="Python">
<Tab title="Python" language="python">
When an endpoint is configured to use Server-Sent Events, the Python SDK
method will return an `typing.Iterator` of the underlying data type.

Expand Down
2 changes: 1 addition & 1 deletion fern/pages/sdks/capabilities/strongly-typed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ code editors. Developers will receive compile errors when they forget to
specify required fields or attempt to access fields that do not exist.

<Tabs>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
TypeScript SDKs are published with type declarations (i.e. `.d.ts` files). This
ensures that TypeScript consumers can leverage compile-time safety and
intellisense when using the SDK.
Expand Down
24 changes: 12 additions & 12 deletions fern/pages/sdks/introduction/customer-showcase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@ Square trusts Fern to generate and maintain **7 SDKs**, ensuring their APIs are
Check out Square's SDKs as they become generally available:

<Tabs>
<Tab title="Go">
<Tab title="Go" language="go">
<Card title="Go SDK" icon="brands golang" iconPosition="left" href="https://github.com/square/square-go-sdk">
View the Go source code in GitHub
</Card>
</Tab>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
<Card title="TypeScript SDK" icon="brands node-js" iconPosition="left">
_Coming soon_
</Card>
</Tab>
<Tab title="PHP">
<Tab title="PHP" language="php">
<Card title="PHP SDK" icon="brands php" iconPosition="left">
_Coming soon_
</Card>
</Tab>
<Tab title="Java">
<Tab title="Java" language="java">
<Card title="Java SDK" icon="brands java" iconPosition="left">
_Coming soon_
</Card>
</Tab>
<Tab title="Ruby">
<Tab title="Ruby" language="ruby">
<Card title="Ruby SDK" icon="regular gem" iconPosition="left">
_Coming soon_
</Card>
</Tab>
<Tab title="Python">
<Tab title="Python" language="python">
<Card title="Python SDK" icon="brands python" iconPosition="left">
_Coming soon_
</Card>
Expand Down Expand Up @@ -84,7 +84,7 @@ ElevenLabs uses Fern to generate SDKs with advanced capabilities for **file uplo

Check out these features in ElevenLabs' SDKs here:
<Tabs>
<Tab title="Python">
<Tab title="Python" language="python">
<CardGroup cols={2}>
<Card title="File Uploads" icon="regular file-arrow-up" iconPosition="left" href="https://github.com/elevenlabs/elevenlabs-python/blob/main/src/elevenlabs/dubbing/client.py#L26">
View the Python source code in GitHub
Expand All @@ -94,7 +94,7 @@ Check out these features in ElevenLabs' SDKs here:
</Card>
</CardGroup>
</Tab>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
<CardGroup cols={2}>
<Card title="File Uploads" icon="regular file-arrow-up" iconPosition="left" href="https://github.com/elevenlabs/elevenlabs-js/blob/main/src/api/resources/dubbing/client/Client.ts#L49">
View the TypeScript source code in GitHub
Expand All @@ -114,14 +114,14 @@ Candid uses Fern to generate an SDK with built in **OAuth support**, enabling se

Check out OAuth in Candid's SDK here:
<Tabs>
<Tab title="Python">
<Tab title="Python" language="python">
<CardGroup cols={1}>
<Card title="OAuth" icon="regular lock" iconPosition="left" href="https://github.com/candidhealth/candid-python/blob/master/src/candid/core/oauth_token_provider.py">
View the Python source code in GitHub
</Card>
</CardGroup>
</Tab>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
<CardGroup cols={1}>
<Card title="OAuth" icon="regular lock" iconPosition="left" href="https://github.com/candidhealth/candid-node/blob/master/src/core/auth/OAuthTokenProvider.ts">
View the TypeScript source code in GitHub
Expand Down Expand Up @@ -153,14 +153,14 @@ Humanloop uses Fern to support **server-sent events (SSE)** in their SDKs, allow

Check out SSE in Humanloop's SDK here:
<Tabs>
<Tab title="Python">
<Tab title="Python" language="python">
<CardGroup cols={1}>
<Card title="Server-Sent Events" icon="regular server" iconPosition="left" href="https://github.com/humanloop/humanloop-python/blob/master/src/humanloop/prompts/client.py#L509">
View the Python source code in GitHub
</Card>
</CardGroup>
</Tab>
<Tab title="TypeScript">
<Tab title="TypeScript" language="typescript">
<CardGroup cols={1}>
<Card title="Server-Sent Events" icon="regular server" iconPosition="left" href="https://github.com/humanloop/humanloop-node/blob/master/src/api/resources/prompts/client/Client.ts#L287">
View the TypeScript source code in GitHub
Expand Down
Loading