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

[Feature] Limit language for Endpoint Request Snippet #5242

Open
aweaver89 opened this issue Nov 21, 2024 · 0 comments
Open

[Feature] Limit language for Endpoint Request Snippet #5242

aweaver89 opened this issue Nov 21, 2024 · 0 comments

Comments

@aweaver89
Copy link

Problem description

Under certain situations, you don't really need users to see all available snippets.
It would be very helpful to be able to define which language(s) you want to display in the Endpoint Request Snippet component

Why would it be useful?

If you're taking a customer through an example built for using the API in Go (for example) and want to show the pre-generated code but in a nice component, there is currently no way to make it so that this sample is pulled directly from your code samples and only one is displayed.

Moreover, when using these blocks as a part of more custom built html, it's sometimes easier to control if you only have a single sample to work with.

Describe the solution (optional)

Add a lang=[] option that would use the same values as the sdk parameter x-fern-samples. This way you could easily add lang=[curl, python] to the EndpointRequestSnippet component and only show these.

Additional context

I actually recently ran into an issue where I wanted to use this component and ended up building quite a lot of custom html. The issue in the end was that when you changed samples the size of the element changed and then caused it to run over other components. It was perfect for curl and I would have been fine just leaving it with a single sample.

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

No branches or pull requests

1 participant