[DRAFT] docs: API documentation improvements#4318
Draft
jamesdanielwhitford wants to merge 5 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users API: suggested DX improvements
This PR shows some improvements we have been exploring for the Users API docs.
Problems with the current state
APIFieldentries are expanded by default. On parameter-heavy endpoints this means the reader must scroll through hundreds of field descriptions to reach the next operation.What we changed
The Users API page has been split into 17 sub-pages, one per operation. Each page has a focused TOC with
###-level headings for each request variant, so readers can navigate directly to the lookup method they need. A newCodeExamplecomponent renders a minimal copyable curl/Python snippet directly below each endpoint definition.APIFieldentries are now collapsed by default using a<details>element. Readers can expand only the fields they care about, significantly reducing scroll depth on parameter-heavy pages.Next steps
These changes cover the Users API only. If the approach looks good, the same improvements can be rolled out across all other API reference pages.
CI note
The
check-apis-against-client-json.rbstep in the lint workflow will fail on this PR. It expects to find the built output atdist/docs/apis/users.html, which no longer exists after the page split. Before merging any version of these changes, that script will need to be updated to check the sub-pages atdist/docs/apis/users/*.htmlinstead.