elevenlabs / elevenlabs-docs

Documentation for elevenlabs.io/docs
https://elevenlabs.io/docs
55 stars 244 forks source link

Add snippets automation #254

Closed handotdev closed 1 month ago

handotdev commented 4 months ago

Summary

This PR adds the script for automatically adding the ElevenLabs SDK snippets to the request examples via x-codeSamples. You can check out the example at https://elevenlabs-sdk.mintlify.app/api-reference/text-to-speech.

CleanShot 2024-05-09 at 15 06 09@2x

Note

Please make sure to add a .env with the FERN_API_KEY

How it works

Note

This changes the workflow so that you need to run node index.js in order to update to update the OpenAPI spec.

Recommendation: Add the script logic into either the last step in the the CI/CD workflow where OpenAPI spec is generated or as a GitHub action on every update to the docs repo.

lharries commented 2 months ago

Thanks Han! I'm picking this back up now

Before After
Screenshot Text To Speech - ElevenLabs (Arc) 2024-07-06 at 17 28@2x Screenshot Text To Speech - ElevenLabs (Arc) 2024-07-06 at 17 28@2x

Two questions:

  1. Is there a way to keep the PHP, Go and Java examples we currently have?
  2. The interactive examples link doesn't work, is this meant to go somewhere?
  3. How can I select row rather than it switching to a dropdown?

And is this still valid to merge?