Skip to content

Demonstrate return type format in the sample #199

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

Open
per1234 opened this issue Nov 9, 2017 · 5 comments
Open

Demonstrate return type format in the sample #199

per1234 opened this issue Nov 9, 2017 · 5 comments

Comments

@per1234
Copy link
Collaborator

per1234 commented Nov 9, 2017

I notice the formatting of return types documentation is very inconsistent from page to page throughout the documentation. The sample page should establish a formatting standard for return types but currently it only demonstrates how void functions should be documented.

@dkovari
Copy link

dkovari commented Jun 14, 2018

I agree. In fact it would be extremely helpful if the the documentation also included the argument types.
Why not simply include a standard function declaration, for example:
ret_type FUNC_NAME(arg_type1 Arg1, arg_type2 Arg2,...)

For functions with multiple argument options and types why not replicate the format used at cppreference.com (see example: http://en.cppreference.com/w/cpp/numeric/math/pow).

@per1234
Copy link
Collaborator Author

per1234 commented Jun 14, 2018

@dkovari there's a separate issue for that topic: #15

@SeppPenner
Copy link
Contributor

SeppPenner commented Jun 29, 2018

I would like to make a suggestion here, too.

image

I would organize the whole section from parameters to returns (See image) like the example shown below:

Parameters

Parameter name Parameter type Description Optional
pin int The number of the pin on which you want to read the pulse.
value int type of pulse to read: either HIGH or LOW.
timeout unsigned long the number of microseconds to wait for the pulse to start; default is one second

Returns

Return type Description
unsigned long the length of the pulse (in microseconds) or 0 if no pulse started before the timeout ()

For the Syntax section I personally would use the suggestion from @dkovari, like

Syntax

pulseIn(int pin, int value)

pulseIn(int pin, int value, unsigned long timeout)

Gist for example is here: https://gist.github.com/SeppPenner/2df12e8f7fb058a3651913839998d468

@SeppPenner
Copy link
Contributor

@per1234 I think, this issue should be closed as the #15 discusses it and will provide a soultion to this, too. (Hopefully)

@per1234
Copy link
Collaborator Author

per1234 commented Nov 9, 2023

the #15 discusses it and will provide a soultion to this, too

Nope. #15 is about documenting return types in the reference content. This issue is about documenting how return types should be documented in the reference content.

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

No branches or pull requests

5 participants