e2b-dev / E2B

Secure open source cloud runtime for AI apps & AI agents
https://e2b.dev/docs
Apache License 2.0
7.02k stars 458 forks source link

Auto-generate API reference markdown files for the js-sdk #447

Closed 0div closed 1 month ago

0div commented 1 month ago

Description

Test

cd packages/js-sdk
./scripts/generate_api_ref.sh 
ls ./api_ref

Considerations

This could eventually be used directly as .mdx in the docs nextjs app, it would look like this with current styling and TOC:

Screenshot 2024-09-18 at 17 29 22 Screenshot 2024-09-18 at 17 29 32 Screenshot 2024-09-18 at 17 29 45

per my previous slack messages:

typedoc and its typedoc-plugin-markdown are more opinionated than i assumed. The extent of how detailed it documents things about classes and interfaces is less configurable than i thought, for example it forces you to display all inheritance info (there's a plugin to remove that but it's clunky) . Also, linking is not configurable when you are converting to markdown, it seems to keep routing as if it were a static website directory with relative links so i removed all links. Had to create a hacky post-processor to handle these obstacles.

i wish i could figure out a way to use anchor links, i looked into typedoc-plugin-pages but couldn't get it to behave the way I want.

changeset-bot[bot] commented 1 month ago

⚠️ No Changeset found

Latest commit: 89d092195e56d478d97f13ae2b01bbb3d6197876

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

mlejva commented 1 month ago

Overall, this is a good start! We'll get a true feeling of it once we start using it in some v1 on the docs website.

i wish i could figure out a way to use anchor links, i looked into typedoc-plugins but couldn't get it to behave the way I want.

Let's figure out a way to do this. This is a really big value-add for developers.