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

Add indentation to API docs #736

Closed
Tracked by #479
Eric-Arellano opened this issue Jan 31, 2024 · 1 comment
Closed
Tracked by #479

Add indentation to API docs #736

Eric-Arellano opened this issue Jan 31, 2024 · 1 comment

Comments

@Eric-Arellano
Copy link
Collaborator

Eric-Arellano commented Jan 31, 2024

See https://www.figma.com/file/sNXucK1uMaZ8XXyLTZrdrs/OneDocs?type=design&node-id=4918-32646&mode=design&t=eQXKiDCRAEETmXbh-0

Screenshot 2024-01-31 at 2 20 59 PM Screenshot 2024-01-31 at 2 20 48 PM

There are a few levels of indentation going on:

  • code objects like methods and attributes are indented relative to their containing class
  • within each code object, like a method, the specific contents are indented.

--

Pay attention to how we implement #735, using a <div> vs MDX component. We'll need to auto-compute the indentation levels I think and set the appropriate HTML class.

@Eric-Arellano
Copy link
Collaborator Author

We added indentation to functions/methods and are happy with how it looks:

Screenshot 2024-04-19 at 4 51 05 PM

Note that we don't indent the same as the original issue, where the subsections like Returns are further indented. Doing that is actually fairly complex because it would require having structured data—such as a new MDX component—for the web app to know how to indent properly. Something like <Returns>content</Returns>, or <Function returns="content">. That is challenging to do reliably and risks many edge cases.

We think the status quo is sufficient. If we decide otherwise, we can reopen this issue or a new one.

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

No branches or pull requests

2 participants