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

[Feature] Comment doc block #237

Open
Mte90 opened this issue Jun 24, 2024 · 7 comments
Open

[Feature] Comment doc block #237

Mte90 opened this issue Jun 24, 2024 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@Mte90
Copy link
Member

Mte90 commented Jun 24, 2024

So right now we have tons of function in stdlib.

Can be handy to document them in the file itself, in this way the documentation can generated aautomatically.
So I was thinking something for that.

In Amber looking at the doc there is no way right now for commenting, so we need to choose what is the best way.

Rust uses /** like PHP (https://doc.rust-lang.org/reference/comments.html), python instead use """the sentence""".

@Mte90 Mte90 added the documentation Improvements or additions to documentation label Jun 24, 2024
@b1ek
Copy link
Member

b1ek commented Jun 24, 2024

i think we should use /// and /** */ for doc strings to be consistent with rust

also we should think through tags like this:

/**
    @return It will return none if has failed
*/
async fn get_user() -> Option<User> { ... }

@b1ek
Copy link
Member

b1ek commented Jun 24, 2024

id say we go with these:

tag desc
@return {desc} is used to describe a function's return value
@param {paramName} {desc} is used to describe a function's param
@author {name} is used to describe the author
@license {SPDXID} to describe the license

@Mte90
Copy link
Member Author

Mte90 commented Jun 25, 2024

Seems the best way, maybe with https://docs.rs/comment-parser/latest/comment_parser/ we can implement easily?

@Ph0enixKM
Copy link
Collaborator

At #62 I used /// syntax for doc comments. We could use the @param etc. just like in JSDoc to document particular params and the return type. Not sure if @author and @license are necessary at this stage but yeah

@Mte90
Copy link
Member Author

Mte90 commented Jun 30, 2024

So we want follow the jsdoc standard or one c style?

@Ph0enixKM
Copy link
Collaborator

Ph0enixKM commented Jul 1, 2024

Oh yeah we could add the /** */ syntax - I just forgot to add the multiline comments. I didn't the need to implement them - now it's the good time

@Mte90
Copy link
Member Author

Mte90 commented Jul 2, 2024

If we will go on /** */ syntax we can approve? #238

So in the way I will add all the comments in the stdlib

@Ph0enixKM Ph0enixKM changed the title Comment doc block [Feature] Comment doc block Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants