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

API Events, Methods, and Properties are arranged in no obvious order and are not sortable #406

Open
anthroid opened this issue Apr 15, 2023 · 1 comment

Comments

@anthroid
Copy link

I am relatively new to developing with Electron, so I am frequently using the 'API' section of the website to find events, methods, and properties of objects. In the sidebar, the modules themselves are arranged alphabetically, but within each module's page, the events, methods, and properties seem to be in a completely random order. If there was a way to sort these (by name, by category, etc), this would be fine, but as-is, it essentially means you have to scroll through the whole page looking for a particular item, reading every one of them, or use the browser's search feature to find the item on the page (cumbersome, and you have to know what you're searching for).

I am curious whether there is a reason for this organization, or if I am just missing something. From what I could tell, there is no way to find anything other than searching for it explicitly (not always an option if you don't know the exact name), or reading the name of every entry until you find it. It seems logical that there might be a way to sort the lists on the right-hand sidebar, or maybe a drop-down at the top of the object's page to select a sort order.

I assume this might be source-generated documentation, which would mean the resulting sort order is just the order these definitions appear in the source itself, but it would still be very helpful if the user could sort the items on the page after it's generated.

@erickzhao
Copy link
Member

Hey @anthroid, thanks for raising this point.

I assume this might be source-generated documentation, which would mean the resulting sort order is just the order these definitions appear in the source itself, but it would still be very helpful if the user could sort the items on the page after it's generated.

We actually do it in the reverse order. All of our docs are hand-written, and we use those to generate our TypeScript definitions (see https://github.com/electron/docs-parser).

I think the real answer is that the order is just the result of Electron's API surface changing over the last decade or so. There are usually rules of thumb for where an API belongs in the documentation (e.g. we usually group methods by functionality), but no hard and fast rules.

or use the browser's search feature to find the item on the page (cumbersome, and you have to know what you're searching for).

Have you tried using the doc site's search functionality (Ctrl or Command+K)? It usually works well if I'm looking for an API method.

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

No branches or pull requests

2 participants