-
Notifications
You must be signed in to change notification settings - Fork 160
Documentation practices
Roman Useinov edited this page Sep 25, 2024
·
1 revision
A lot of the best practices for Rust documentation could be found here. Most of the things on the list below are reflected in the aforementioned page.
Here’s a list of things that would be nice to have in every existing or newly introduced module:
- Any new module that’s introduced should ideally have a doc describing what it’s purpose is, with some code examples if applicable. If said module is complex - some flow diagrams would be highly desired.
- The public API (types, structs, static methods etc) should be documented, with code examples.
- Domain-specific logic, especially when it’s lengthy - should either be split into smaller self-explanatory helper methods or documented within the code. The aim is to reduce the amount of context switching and the amount of time a reader needs to spend to review and wrap their head around the code.
- Tests are often a good way to document the code and it’s usages, when done right and self-explanatory enough. In particular cases an
examples
folder could do the trick as well.
A readme should typically contain:
- Installation instructions for end-user.
- Installation instructions for developers willing to compile the project locally.
- Running instructions for end-users:
- A sample command for each binary present in the repo, at least those relevant for end users.
- System requirements, if applicable.
- Caveats.
- Contribution instructions for devs:
- Prerequisites if applicable: e.g. we need node.js to format md files.
- A list of commands that are relevant to building and testing the codebase.
- A concise project description, what it does.
- Some usage examples, where applicable. If there needs to be an
examples
folder with some sample code - there has to be. - Caveats, where applicable.
Home | Communications | Forest Progress | Team | Forest Beta