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

integrate Speakeasy generated code snippets directly into Mintlify #36

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Coniferish
Copy link
Collaborator

@Coniferish Coniferish commented May 14, 2024

This PR integrates Speakeasy's generated code snippet examples for the SDKa into Mintlify as described here

In the unstructured-python-client and unstructured-js-client repos there are codeSamples.yaml files. This file in each repo is an overlay file that is used to modify an openapi specification. These files are generated through the workflow.yaml in the respective repo whenever the client is updated/speakeasy run is used (see more here).

In this repo, workflow.yaml and sdk_generation.yaml files have been added and are used to create a final openapi_with_sdk_codeSamples.yaml that contains code samples from both the js and python skds (this is also generated with the command speakeasy run). This file can be used by Mintlify to create .mdx files with the command npx @mintlify/scraping@latest openapi-file openapi_with_sdk_codeSamples.yaml.

TODO:
The mdx file generated from openapi_with_sdk_codeSamples.yaml does not contain much and there may be an issue with how it is currently generated. When testing locally with mintlify dev to preview changes, the SDK tab appears, but does not load when clicked.

@Coniferish Coniferish marked this pull request as draft May 14, 2024 14:21
@Coniferish Coniferish force-pushed the jj/sdk-code-snippets branch 2 times, most recently from 44cde13 to 7954af8 Compare May 14, 2024 16:11
@Coniferish Coniferish marked this pull request as ready for review May 14, 2024 16:11
@Coniferish Coniferish marked this pull request as draft May 14, 2024 16:11
awalker4 pushed a commit to Unstructured-IO/unstructured-python-client that referenced this pull request May 17, 2024
Setup for integrating Speakeasy generated code snippets directly into
our Mintlify docs repo
https://www.speakeasyapi.dev/docs/mintlify#manual-setup

Also see Unstructured-IO/docs#36
@Coniferish Coniferish closed this May 23, 2024
@Coniferish Coniferish deleted the jj/sdk-code-snippets branch May 23, 2024 20:39
@Coniferish Coniferish restored the jj/sdk-code-snippets branch May 23, 2024 21:19
@Coniferish Coniferish reopened this May 24, 2024
Copy link
Collaborator

@MKhalusova MKhalusova left a comment

Choose a reason for hiding this comment

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

Sorry for the delay in reviewing this. Some notes:

  1. The SDK parameters, and code snippets should be a part of the API documentation, not a separate tab. The tabs are reserved for a) products, b) notebooks & code examples, c) glossary & FAQ. Let's not overcrowd that menu.
  2. The SDK link goes nowhere, it redirects to the index page
  3. What do the code examples look like? If we're only showing the API parameters and their description, we have them already listed under "Using Unstructured API | API Parameters". We could potentially automatically generate those. Or are these code snippets with examples? In this case it would make sense to add them to the "Using Unstructured API | Examples" page, with meaningful descriptions.

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

Successfully merging this pull request may close these issues.

None yet

3 participants