-
Notifications
You must be signed in to change notification settings - Fork 704
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
Sample doc format update #1142
base: main
Are you sure you want to change the base?
Sample doc format update #1142
Conversation
@mprimi FYI, I can't add you as a reviewer. |
That looks nice, but for default format example, I would also use something with a method/function call with an example, as that's the majority of docs. |
The connect example looks ok. in Rust NATS crate now every single example has proper error handling, as we know (and see on slack) that people copy-paste those examples into their codebases. |
@Jarema TBH, I would prefer shorter, more straightforward examples over proper error handling. Go programmers know well enough that every error should be checked and handled, and that's mostly our audience in go client I think. |
@piotrpio I think this is great and will have good long-term impact. Of course each language/client has their own method for in-code documentation, but we could establish and promote expectations so any generated docs has the same quality of content. I also agree with the "Go programmers are are aware and expected to handle errors" argument. The NATS by Example Go examples also omit error handling for brevity. As an aside, I have been thinking about client/language API docs. As far as I know, all of the languages we officially support have some kind of standard for writing and generating docs. Maybe the exception is the C client 🤷♂️. For the new docs site, other than hand-written examples, we definitely need code-derived API docs. |
This is a first attempt to establish a cleaner and more verbose documentation.
These are not full changes! If this approach will be deemed appropriate, I will continue with improving documentation across the whole repository.
Some rules I am trying to follow:
is formatted to:
example_test.go
.[*net.Dialer]
instead of*net.Dialer
or[GetDefaultOptions]
instead ofGetDefaultOptions()
.