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

Uniform docstrings #345

Open
MartinKl opened this issue Jan 10, 2025 · 2 comments
Open

Uniform docstrings #345

MartinKl opened this issue Jan 10, 2025 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@MartinKl
Copy link
Collaborator

We need a standard way of documenting struct fields in the code, as the documentation is derived from this. We can use this issue to collect several problems and desiderata.

As an example, how do we want to make transparent to the user, whether or not an attribute (struct field) is obligatory. In most cases we mention the default value in the docstring, but to conclude from a non-mentioning of a default that a field is required seems a bit much.

@MartinKl MartinKl added the documentation Improvements or additions to documentation label Jan 10, 2025
@MartinKl
Copy link
Collaborator Author

Also, it would be nice to add a way of print a code snippet from the documentation in a way that it can be copied from command line, which is currently not possible with the terminal tables.

@MartinKl
Copy link
Collaborator Author

If we can modify the following function:
https://github.com/cyqsimon/documented/blob/e2047670133b5469c96650ee56f153b1f1259165/documented-macros/src/derive_impl.rs#L110

... in a way, that it also reads the field attributes and creates constants for optional and obligatory fields (i. e. which field carries serde(default... and which not), we could forward that information to the user.

@MartinKl MartinKl self-assigned this Jan 20, 2025
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

1 participant