Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@ This event is emitted on instances of `SomeClass`, not on the module itself.
* Methods have (list of arguments, returned value if defined, description).
* Modules have (description, Properties, Functions, Classes, Examples).
* Properties have (type, description).

Every Function and Method should have an in-line example showing their use.
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure if this is the best location to document goals. Also, I think this might be too broad.

Copy link
Member Author

Choose a reason for hiding this comment

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

@tniessen I looked at either this doc or https://github.com/nodejs/node/tree/master/doc and this felt was the better of the 2. I agree neither is a great fit. Another option might be to add a maintaining-api-docs.md guide in https://github.com/nodejs/node/tree/master/doc/contributing. Do you have any other suggestions?

When you say too broad, do you mean that having an in-line example for every function and method does not make sense or that the description needs to be more specific in some way?

Copy link
Member

@Trott Trott Mar 9, 2022

Choose a reason for hiding this comment

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

Suggested change
Every Function and Method should have an in-line example showing their use.
Every function should have a usage example.

Copy link
Member

Choose a reason for hiding this comment

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

When you say too broad, do you mean that having an in-line example for every function and method does not make sense or that the description needs to be more specific in some way?

I think it does not make sense in all cases, for example, when a class has many methods that aren't particularly helpful on their own, but only when used together. But since the PR has changed to restrict its scope to functions, I don't have a strong opinion on this.